Fix comments section UX regressions and HTMX reply/Turnstile behavior #49

Merged
mark merged 2 commits from fix/comments-standardize-htmx-turnstile into main 2026-03-04 12:22:54 +00:00
Owner

Summary

This PR fixes the current comment-section regressions and aligns the experience with a more standard, cohesive modern comment UI.

Closes #48.

What changed

  • Refactored top-level and reply comment templates to a consistent, conventional layout.
  • Replaced brittle HTMX OOB reply target selector with stable per-parent container IDs (#replies-for-<comment_id>).
  • Updated HTMX success response for approved top-level comments to delete stale empty-state block (#comments-empty-state).
  • Added client-side static/js/comments.js to:
    • re-initialize Cloudflare Turnstile widgets after HTMX swaps,
    • keep comments empty-state visibility synchronized with rendered comments.
  • Updated article comments section markup to always render list container and provide stable empty-state element.
  • Preserved reply form values on HTMX validation errors.

Tests

  • docker compose run --rm web pytest -o addopts='' apps/comments/tests apps/blog/tests/test_views.py -q

Notes

  • Local bare pytest is unavailable in this workspace, so tests were executed in the project Docker environment.
## Summary This PR fixes the current comment-section regressions and aligns the experience with a more standard, cohesive modern comment UI. Closes #48. ## What changed - Refactored top-level and reply comment templates to a consistent, conventional layout. - Replaced brittle HTMX OOB reply target selector with stable per-parent container IDs (`#replies-for-<comment_id>`). - Updated HTMX success response for approved top-level comments to delete stale empty-state block (`#comments-empty-state`). - Added client-side `static/js/comments.js` to: - re-initialize Cloudflare Turnstile widgets after HTMX swaps, - keep comments empty-state visibility synchronized with rendered comments. - Updated article comments section markup to always render list container and provide stable empty-state element. - Preserved reply form values on HTMX validation errors. ## Tests - `docker compose run --rm web pytest -o addopts='' apps/comments/tests apps/blog/tests/test_views.py -q` ## Notes - Local bare `pytest` is unavailable in this workspace, so tests were executed in the project Docker environment.
mark added 1 commit 2026-03-04 11:47:03 +00:00
Fix comments UX regressions and HTMX/Turnstile behavior
Some checks failed
CI / nightly-e2e (pull_request) Has been skipped
CI / deploy (pull_request) Has been skipped
CI / pr-e2e (pull_request) Successful in 1m32s
CI / ci (pull_request) Failing after 1m39s
a001ac1de6
- standardize comment and reply UI layout
- target replies with stable OOB container IDs
- remove stale empty-state on approved HTMX comments
- initialize Turnstile widgets after HTMX swaps
- add regression tests for empty-state, OOB targets, and reply form rerender

Refs #48
mark added 1 commit 2026-03-04 12:17:23 +00:00
Rebuild Tailwind CSS for comments UI updates
All checks were successful
CI / nightly-e2e (pull_request) Has been skipped
CI / deploy (pull_request) Has been skipped
CI / pr-e2e (pull_request) Successful in 1m31s
CI / ci (pull_request) Successful in 1m38s
badd61b0aa
codex_a approved these changes 2026-03-04 12:21:24 +00:00
codex_a left a comment
Owner

Re-reviewed with strict QA focus. Previous comments UX/HTMX regressions appear resolved:\n- Stable reply OOB target now uses #replies-for-.\n- Reply partial rendering/context path is consistent.\n- Reply form values are preserved on HTMX validation errors.\n- Comment empty-state handling and Turnstile re-init client script are wired into the page.\n\nVerification run (Docker):\n- pytest -o addopts='' apps/comments/tests apps/blog/tests/test_views.py -q\n- python manage.py check\n\nNo blocking issues found in this PR.

Re-reviewed with strict QA focus. Previous comments UX/HTMX regressions appear resolved:\n- Stable reply OOB target now uses #replies-for-<id>.\n- Reply partial rendering/context path is consistent.\n- Reply form values are preserved on HTMX validation errors.\n- Comment empty-state handling and Turnstile re-init client script are wired into the page.\n\nVerification run (Docker):\n- pytest -o addopts='' apps/comments/tests apps/blog/tests/test_views.py -q\n- python manage.py check\n\nNo blocking issues found in this PR.
mark merged commit d39fff2be0 into main 2026-03-04 12:22:54 +00:00
mark deleted branch fix/comments-standardize-htmx-turnstile 2026-03-04 12:22:54 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nohype/main-site#49