Repository navigation
[Bug Fix] DataTablePerPageSelect: match shadcn's Select and submit without an inline onchange - #579
Conversation
…nchange Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
…ta is left untouched Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-handler Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cirdes
left a comment
There was a problem hiding this comment.
@pierry01, great timing on this PR. Over the last few days I refactored every ruby-ui component to match shadcn exactly, and I created a skill called /shadcn-audit or something close to that. It runs a full comparison between our component and the shadcn one.
Could you run that skill so it takes the screenshots and does the audit, then request review again? Thanks!
There was a problem hiding this comment.
All reported issues were addressed across 5 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
…n SelectInput's actions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shadcn audit
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, toolbar spacing) (ruby-ui#659) * [Bug Fix] DataTable: toggle trigger as a toolbar flex item, dashboard-01 status badges in the audit fixture DataTableColumnToggle's wrapper and its DropdownMenu root are display: contents, so the Columns button is a flex item of the toolbar like shadcn's trigger (its inline-flex blockifies to flex). The audit fixture's badges follow the dashboard-01 block (default size, px-1.5 text-muted-foreground, CircleCheck/Loader status icons), and the native checkbox's display and text-align differences are registered as divergences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * [Bug Fix] DataTableToolbar: 24px before the table, as dashboard-01 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Related issue
None opened, small self-contained fix.
Description
DataTablePerPageSelectsubmitted through an inlineonchange="this.form.requestSubmit()", which a Content-Security-Policy without'unsafe-inline'blocks, so changing the page size did nothing there. It now submits through aruby-ui--data-table-per-page-selectStimulus controller.After the shadcn audit it also renders as shadcn's dashboard-01 block does:
RubyUI::SelectwithSelectTrigger size: :sm, class: "w-20"labelled by the<label for>and the list opening on top, instead of aNativeSelect.SelectInputcarriesname/valueand the submit controller: picking a size fireschangethere and the form submitsGET ?per_page=N(search and sort kept, page reset) into the Turbo Frame. The public API of the component is unchanged.The server-driven submit is registered in
audit/divergences/data_table.yml, and the component map'sDataTablePerPageSelectselector now points at the trigger.shadcn audit · main
shadcn audit · this PR
The two ❌ left (Columns trigger and row checkbox
display) are pre-existing and go to a separate PR, together with the menu behavior this audit didn't cover.Testing instructions
cd gem && bundle exec rake→ 780 runs, 0 failures, StandardRB clean.cd mcp && bundle exec rake→ 33 runs, 0 failures./docs/data_table_demo: open "Rows per page" and pick 10 → the frame reloads with 10 rows.5→ 50, Enter →?per_page=50. Esc closes it and focus returns to the trigger.on*attribute.🤖 Generated with Claude Code