Skip to content

Autorefresh htmx fragment#2306

Open
vcombey wants to merge 9 commits intodigitallyinduced:masterfrom
vcombey:autorefresh-htmx-fragment
Open

Autorefresh htmx fragment#2306
vcombey wants to merge 9 commits intodigitallyinduced:masterfrom
vcombey:autorefresh-htmx-fragment

Conversation

@vcombey
Copy link

@vcombey vcombey commented Feb 6, 2026

Makes HTMX fragments work with auto-refresh.

This PR is based on the autorefresh-with branch because it modifies the auto-refresh implementation, but it’s independent and could be rebased onto master.

What

Add utilities to improve HTMX integration and make auto-refresh work with HTMX fragments.

Why

Using HTMX with ihp was difficult to debug because the existing helpers.js intercepts form submissions and does some unexpected stuff. It turns out helpers.js is easily replaceable with a full HTMX-based approach using hx-boost and HTMX morphdom.
Auto-refresh is a fantastic feature, but before this PR it could only refresh the entire page. As the app grows,
it becomes harder to split pages into multiple components, and auto-refresh gets more resource-intensive since it re-renders the whole page for every small change.
It is also useful for small live UI elements like a header notification badge. On relevant DB changes (e.g. another user creates content in the workspace), only that HTMX fragment is re-rendered.

Related: #1807

here is a demo project that show the usage: https://github.com/vcombey/test-autorefresh-htmx

@vcombey vcombey force-pushed the autorefresh-htmx-fragment branch from 64e1669 to 6194027 Compare February 18, 2026 19:16
@vcombey vcombey force-pushed the autorefresh-htmx-fragment branch from 6194027 to a2282e4 Compare February 18, 2026 19:21
@vcombey vcombey closed this Feb 18, 2026
@vcombey vcombey reopened this Feb 18, 2026
@vcombey vcombey marked this pull request as ready for review February 18, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments