Repository navigation
fix(site): docs demos use real parts; InputGroupToggle; demo intervals stop (#97) - #164
Merged
Merged
Conversation
… the end, and Replay starts a new one (#97)
…sed-looking Buttons
…f a hand-styled table
…nset; the favorite demo uses it
… ui-sdk's Label for the URL prefix
Owner
Author
|
Verifier: PASS+NOTES on merge tree 8947239b (ui-sdk 6be0088 + head 7e817b1). check, build, 561 tests. Browser: Toggles press and the agent can setPressed, the Toggle Group theme picker switches themes, Scroll Area scrolls both axes, demo timers stop at the end, the account row is named 'shadcn Pro', 0 console errors. Re-checked registry on the merge with #163 (a6a078e8): check-registry passes. Follow-ups for the docs commit: record the InputGroupToggle choice in ARCHITECTURE.md; the input-group.md Toggle section needs its own preview. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The goal for the
ui-sdkbranch is to fix every bug we can fix on our side. This PR covers the docs demos. AGENTS.md says a demo must never fake a component with a native element or hand-rolled styles. Every part these demos faked now exists, so the demos use the real parts. Agents then see real controls insnapshot(), and readers copy the real pattern. It also fixes #97, the mention half of #52, and a regression from #142 in the sidebar demo.What
InputGroupButtons with a hand-setaria-pressed. OurTogglecan't render throughInputGroupButton: two styled parts on one element makewithStylesthrow. Rendering ui-sdk'sTogglethrough it put two entries for one element insnapshot()(buttonandtoggle), the same defect ARCHITECTURE.md records for Command. So this PR addsInputGroupToggle, a new public part. It is ourTogglewithdata-input-group-button, sizedsm,icon-xs(default) oricon-sm, and it has novariant.styles.buttonis split intoaction(both parts) andbutton(boxShadow: none, InputGroupButton only), so the toggle keeps its pressed fill. The registry item gainstoggle. Docs: a Toggle section and an API row ininput-group.md, andbutton-group.mdis updated.secondarywhen picked) are now aToggleGroupnamed "Theme", single-select withdeselectable={false}.<table>with hand-rolled cells. OurTableowns its own horizontal scroller. Inside the demo's area, the outer viewport only scrolled down (382x238 visible, 382x321 content) and the table scrolled sideways itself (737 wide). So the demo now scrolls a 6-column grid of the page's existing tiles (880x720 content). The snippet is updated.<label>is now ui-sdk's unstyledLabelrendered byButtonGroupText, which draws it. OurLabelis styled, so it would throw. Theoxlint-disablecomment is gone.Buttonwith the same row styles, as Sidebar's rows are. The sibling TanStack RouterLinkrows stay as they are. This is site chrome, not a demo.sx={styles.mention}. ThebuttonStylesspreads athover-card.tsx:104/110are left alone, because they are the documented style-getter pattern (ARCHITECTURE.md, Composition).type="label", so it names the row. It now reads "shadcn Pro", which matches the visible text. The in-sheet "Close sidebar" label is unchanged.createDropdownMenuController<Doc>(), a trigger per row passingpayload, and content rendered from the payload. This is ui-sdk's documented detached-trigger pattern (@ui-sdk/react/docs/components/menu.md, "Connect external triggers and one menu to acreateMenuController<File>()"). Our docs teach it too, anddropdown-menu.test.tsxpins it.Verification
vpr checkpasses.vpr testpasses: 71 files, 556 passed, 1 expected fail.demos/{progress,markdown,trace}.test.tsxfailed on base withexpected 1 to be +0(the timer still running after the end state; 3 failed, 3 passed). They pass on the fix commit. The failing tests land first, in 126b1ae.input-group.test.tsxchecks that aria-pressed flips once per press,type=button, thedata-input-group-buttonattribute, and that the agent snapshot lists exactly one entry,["toggle"](a throwaway test of the earlier shape got["toggle","button"]).demos/button-group.test.tsxcovers voice mode (one flip per click, input disabled, one snapshot entry), Favorite, and thehttps://label naming the input.snapshot()on the built site, base → after:button press→toggle setPressed(one entry).button press→toggle setPressed(one entry).buttonPolaris/Vega/Antares →toggle×3, plus grouptoggle | Theme | setValue,toggle.shadcn→shadcn Pro.button | press, one entry each.vpr agent-audit, base → after: 84 pages, 81 with unnamed entries, 13 with ambiguous names → the same numbers, and the per-page lines are identical.ambiguousInflags only same name + same action, so it couldn't see the doubled entry. The new tests pin that case.secondaryButton fill. Dark: 3 px.Tradeoffs
InputGroupToggleis a new public part, so the lead should look at it in the batch pass. The other option was ui-sdk'sTogglehand-assembled in the demos, which doubles the agent entry, or a hand-written marker attribute in a snippet. The advisor picked building the part, per AGENTS.md "Dependencies first".Tablecan't sit in a both-axes ScrollArea because it scrolls sideways itself. A tile grid shows the same behavior without faking a component.Label/Buttonwould clash with the part that draws, so the primitive supplies the behavior and one part draws, as ARCHITECTURE.md's Composition rule asks.Tracker
Row 185 (demos faking parts): done in this PR. Toggle →
InputGroupToggle(new part), theme picker → Toggle Group, scroll-area table → tile grid (Table can't nest in a both-axes ScrollArea), native label → ui-sdk Label via ButtonGroupText, mobile nav → ui-sdk Button primitive, shared row menu kept (documented ui-sdk pattern). Also closes #97 (demo intervals) and does the mention half of #52 (hover cardsx); #52 also asks forsx={buttonStyles(...)}on the link triggers, kept as spreads per the lead, so #52 stays open for the owner's call, and restores the sidebar account row's name, "shadcn Pro". Follow-up: ARCHITECTURE.md Composition could nameInputGroupTogglebesideInputGroupButton.