Skip to content

docs: Show useQuery sorting as a team table that sorts by any column - #4493

Merged
ntucker merged 10 commits into
masterfrom
claude/project-thread-6rd4cs
Oct 27, 2026
Merged

ntucker merged 10 commits into
masterfrom
claude/project-thread-6rd4cs

Conversation

@ntucker

@ntucker ntucker commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Demo: a team table (name, role, posts, joined). Click a column header to sort by it, click again to reverse. A segmented control shows All, Admins or Members. One Query over All(User) filters and sorts; the page passes the choice as useQuery args. The demo plays itself once in view (Posts, Posts again, Admins, Joined). Same shape in the Vue example.
  • Design system (DesignSystem/design-system.css):
    • table: rule-free rows on the sheet, a rounded row band under the pointer, headers styled as group labels, value cells end-aligned. Infima's borders and stripes are dropped.
    • button.sort in a th: label plus an arrow; aria-sort on the th shows and turns the arrow. The arrow shares the upvote's shape.
    • buttonGroup buttons with aria-pressed="true" show the chosen segment.
    • New --ds-accent-pressed token replaces four copies of the pressed wash.
  • The Scalar demo's table drops its inline style and align attributes for the shared table style and value cells.

Assumptions and validation

  • yarn check:doc-examples react and vue pass (high).
  • Checked in a local dev site with Playwright: desktop light and dark, iPhone 13 light and dark; sorting, filtering, and the full auto-run sequence; the Scalar demo table (high).
  • Translated Scalar pages keep align until the weekly translation run, so their header cells left-align until then (medium: not checked in a browser).
  • The auto-run targets header and filter text (hasText), not aria-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 useQuery examples (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 use useSuspense plus split components (UsersTable, RoleFilter, etc.); the docs playground gets teamFixtures, sortDemo auto-run, and default tab UsersTable.

Extends the playground design system with table layout, segmented filter track, pill / button.sort / aria-sort, initials Avatar (name without src), and shared --ds-accent-pressed / --ds-raised tokens. Scalar table snippets drop inline styles and align in favor of value cells and the shared table styles; Playground README and Monaco Avatar types are updated to match.

Reviewed by Cursor Bugbot for commit f57b53b. Bugbot is set up for automated code reviews on this repo. Configure here.

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
@ntucker ntucker self-assigned this Oct 27, 2026
@changeset-bot

changeset-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f57b53b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T04:20:53.433443Z c3011e9 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview: https://docs-site-pr-4493-data-client.vercel.app

Built from f57b53b merged into master (this build). Locales: en (the merge queue builds every locale).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread docs/core/api/useQuery.md
@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.37%. Comparing base (25dfbcc) to head (f57b53b).
⚠️ Report is 2 commits behind head on master.

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.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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
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
@ntucker
ntucker added this pull request to the merge queue Oct 27, 2026
Merged via the queue into master with commit 5a08c80 Oct 27, 2026
33 checks passed
@ntucker
ntucker deleted the claude/project-thread-6rd4cs branch October 27, 2026 04:32

This branch was successfully deployed

1 active deployment
docs-preview — f57b53b1 Deployed Oct 27, 2026 by ntucker via preview / docs deploy #4280
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants