Repository navigation
docs: Show useQuery sorting as a team table that sorts by any column - #4493
Conversation
The Sorting & Filtering demo is now a team table: pick a column header to sort by it (again to reverse), or a segment to show admins or members. One Query does both on what the store already holds, so nothing refetches. It plays itself once in view. The design system gains rule-free tables (value cells end-aligned, a row band under the pointer), a sortable header button (`sort`, with `aria-sort` driving its arrow) and a chosen segment for `buttonGroup` filters (`aria-pressed`). The Scalar demo's table drops its inline styles and align attributes for these. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5ZC3WYndrqLXmu9F42e
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Docs preview: https://docs-site-pr-4493-data-client.vercel.app Built from f57b53b merged into |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2173c77ce0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5ZC3WYndrqLXmu9F42e
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4493 +/- ##
=======================================
Coverage 98.37% 98.37%
=======================================
Files 161 161
Lines 3080 3080
Branches 605 605
=======================================
Hits 3030 3030
Misses 10 10
Partials 40 40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
UsersPage now holds just the Query and the state it reads with useQuery, so the highlighted line sits beside the schema it uses. The table and its sortable headers move to UsersTable (which decides how a header click changes the sort), and the role switch to RoleFilter. Vue follows the same split. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5ZC3WYndrqLXmu9F42e
UsersTable now holds the Query and reads it with the sort and role it gets as props, handing the rows to UsersTableView, which only renders them. UsersPage keeps the sort and filter state. Vue follows the same split. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5ZC3WYndrqLXmu9F42e
Sort and SortBy move to resources/User, so UsersTableView, UsersTable and UsersPage all import them from there and no component imports from the one that renders it. Vue's header click handler is named toggleSort. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5ZC3WYndrqLXmu9F42e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5ZC3WYndrqLXmu9F42e
Adds design-system elements for the sort demo: a segmented filter whose pill slides to the chosen choice, role pills, and initials avatars. Tables lose the row hover (their rows aren't actionable) and value cells get tabular figures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5ZC3WYndrqLXmu9F42e
Avatar takes a src or a name (one is required), and the segmented control's four-choice limit is documented. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5ZC3WYndrqLXmu9F42e
The pill shares the first segment's grid cell, so it sizes itself without counting segments; buttons reuse the base control's font and focus ring; the raised pill's colors are theme tokens. Avatar falls back to initials whenever it has no src, and touch screens keep the regular filter size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5ZC3WYndrqLXmu9F42e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5C5ZC3WYndrqLXmu9F42e
Requested by Nathaniel · project thread
Motivation
Improvement. The useQuery Sorting & Filtering demo was three names in plain divs, sorted once. It did not show the point: a Query re-sorts and filters what the store already holds, so a user's choice never refetches.
Solution
QueryoverAll(User)filters and sorts; the page passes the choice asuseQueryargs. The demo plays itself once in view (Posts, Posts again, Admins, Joined). Same shape in the Vue example.DesignSystem/design-system.css):table: rule-free rows on the sheet, a rounded row band under the pointer, headers styled as group labels,valuecells end-aligned. Infima's borders and stripes are dropped.button.sortin ath: label plus an arrow;aria-sorton thethshows and turns the arrow. The arrow shares the upvote's shape.buttonGroupbuttons witharia-pressed="true"show the chosen segment.--ds-accent-pressedtoken replaces four copies of the pressed wash.alignattributes for the shared table style andvaluecells.Assumptions and validation
yarn check:doc-examples reactandvuepass (high).alignuntil the weekly translation run, so their header cells left-align until then (medium: not checked in a browser).hasText), notaria-labels; a copy edit to those labels needs the script updated (low risk, accepted to keep the demo code free of test hooks).Generated by Claude Code
Note
Low Risk
Documentation, playground CSS, and demo fixtures only; no runtime library or API behavior changes.
Overview
Replaces the Sorting & Filtering
useQueryexamples (docs, agent skills, React and Vue) with an interactive team table: column-header sort (with reverse), a segmented All / Admins / Members filter, and copy that stresses Query re-sorts/filters cached data without refetching. Examples now useuseSuspenseplus split components (UsersTable,RoleFilter, etc.); the docs playground getsteamFixtures,sortDemoauto-run, and default tabUsersTable.Extends the playground design system with table layout,
segmentedfilter track,pill/button.sort/aria-sort, initialsAvatar(namewithoutsrc), and shared--ds-accent-pressed/--ds-raisedtokens. Scalar table snippets drop inline styles andalignin favor ofvaluecells and the shared table styles; Playground README and MonacoAvatartypes are updated to match.Reviewed by Cursor Bugbot for commit f57b53b. Bugbot is set up for automated code reviews on this repo. Configure here.