Repository navigation
Update startapp for htmx 4 - #50
Merged
Merged
Conversation
htmx 4 no longer inherits attributes implicitly, so the page-content wrapper needs hx-target:inherited for its links and forms to target it. HX-Target is now sent as tag#id, so the list view matches div#page-content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated templates now require htmx 4. Stop with a clear message if the project's package.json has an older htmx, with --force to skip the check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the
startapptemplates for htmx 4, to go with the Pegasus htmx 4 upgrade.Changes
Templates (
7a26ea2)#page-contentwrapper in the home, list, detail and form templates now useshx-target:inherited="#page-content". Without it, links and the form inside the wrapper would target themselves.HX-Targetastag#idinstead of the bare id, so the list view now checksrequest.htmx.target == "div#page-content". Previously the comparison always failed on htmx 4, and breadcrumb navigation to the list page rendered only the table partial.Pagination (
web/components/paginator_htmx.html) is updated on the Pegasus side. The create/edit form, redirect +hx-push-url, and the plain-POST delete form need no changes.htmx version check (
86eed0f)startappnow readshtmx.orgfrom the project'spackage.json, and if its major version is below 4 it stops with a message: upgrade Pegasus, installpegasus-cli<0.17, or re-run with--force.package.json, no htmx dependency, or an unreadable version spec all let the command run.Notes
pegasus-cli>=0.15; the htmx 4 Pegasus release should bump that to this version.Testing
pytest: 133 passed, including new tests intests/test_startapp.py.startappin a scratch dir against an htmx 2package.json: it errors, and with--forceit generates the app with the new attributes and view check.widgetsapp in a Pegasus project on htmx 4.0.1 and clicked through it in the browser; it works. (For comparison, the same app generated by the released 0.16 CLI nests every swap inside the clicked element on htmx 4.)🤖 Generated with Claude Code