Skip to content

Use htmx for users list GridView#54

Open
vjik wants to merge 9 commits intomasterfrom
htmx
Open

Use htmx for users list GridView#54
vjik wants to merge 9 commits intomasterfrom
htmx

Conversation

@vjik
Copy link
Copy Markdown
Member

@vjik vjik commented Mar 19, 2026

Q A
Is bugfix?
New feature? ✔️
Breaks BC?
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 0% with 87 lines in your changes missing coverage. Please review.
✅ Project coverage is 13.21%. Comparing base (12e425a) to head (4288890).

Files with missing lines Patch % Lines
src/UseCase/Users/List/UsersList.php 0.00% 80 Missing ⚠️
src/UseCase/Users/List/Action.php 0.00% 4 Missing ⚠️
...sentation/Site/ResponseFactory/ResponseFactory.php 0.00% 2 Missing ⚠️
src/UseCase/Users/List/template.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## master #54 +/- ## ============================================ - Coverage 13.38% 13.21% -0.17%  - Complexity 378 382 +4  ============================================ Files 121 122 +1 Lines 2234 2262 +28 ============================================ Hits 299 299 - Misses 1935 1963 +28 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@vjik vjik requested a review from Copilot March 19, 2026 11:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an HTMX-powered rendering path for the Users listing so the grid can be refreshed via partial HTML responses instead of full-page renders.

Changes:

  • Extracted the Users GridView into a dedicated UsersList widget and added HTMX attributes to its container.
  • Updated the Users list action to return only the grid HTML when the request is an HTMX request.
  • Added HTMX as a global site asset dependency and introduced a createHtmlResponse() helper on the site ResponseFactory.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/UseCase/Users/List/template.php Replaces inline GridView rendering with UsersList::widget().
src/UseCase/Users/List/UsersList.php New widget encapsulating the GridView and HTMX container attributes.
src/UseCase/Users/List/Action.php Returns partial HTML for HTMX requests; otherwise renders the full template.
src/Presentation/Site/ResponseFactory/ResponseFactory.php Adds HtmlResponseFactory dependency and createHtmlResponse() helper.
src/Presentation/Site/Layout/MainAsset.php Adds HtmxAsset as a dependency so HTMX loads site-wide.
src/Presentation/Site/Layout/HtmxAsset.php New asset bundle to load HTMX from a CDN with SRI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an htmx-enabled Users listing by extracting the existing GridView configuration into a reusable widget and returning a partial HTML response for htmx requests, enabling in-place sorting/filtering/pagination updates without a full page reload.

Changes:

  • Replaced the inline Users GridView markup with a new UsersList widget that adds hx-* attributes to GridView interactions.
  • Updated the Users list action to detect htmx requests and return only the grid HTML for partial page updates.
  • Added an HtmxAsset (loaded via MainAsset) and introduced ResponseFactory::createHtmlResponse() for returning raw HTML responses.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/UseCase/Users/List/template.php Switches from inline GridView to rendering the new UsersList widget.
src/UseCase/Users/List/UsersList.php New widget encapsulating Users GridView configuration + htmx attributes for AJAX updates.
src/UseCase/Users/List/Action.php Returns partial HTML for htmx requests, otherwise renders the full page template.
src/Presentation/Site/ResponseFactory/ResponseFactory.php Adds createHtmlResponse() helper to emit HTML responses (used for htmx partial).
src/Presentation/Site/Layout/MainAsset.php Adds HtmxAsset dependency so htmx is available on site pages.
src/Presentation/Site/Layout/HtmxAsset.php New asset bundle loading htmx from jsdelivr with SRI.
composer.json Bumps dev dependency vimeo/psalm version constraint.
composer.lock Updates locked dependency versions/hashes accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vjik vjik requested a review from a team March 19, 2026 12:10
@vjik vjik added the status:code review The pull request needs review. label Mar 19, 2026
@vjik vjik requested a review from samdark March 21, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:code review The pull request needs review.

3 participants