Restore catalog navigation and use compact-only sizing - #9
Merged
Conversation
Restore the original sidebar and content proportions with complete grouped navigation, responsive component selection, and reliable fragment navigation. Make compact sizing permanent in Library and Lab without density controls or labels. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Resolve the stale-hash behavior and strengthen the remount-survival test.
Pull request overview
Restores grouped catalog navigation and responsive layout while standardizing Library and Lab on compact sizing.
Changes:
- Restores sidebar, context rail, mobile picker, and hash navigation.
- Removes density controls and persisted density preferences.
- Expands navigation, contract, visual, mobile, and documentation coverage.
File summaries
| File | Reviewed changes | Findings |
|---|---|---|
scripts/visual-review.mjs |
Layout and navigation validation | — |
scripts/verify-contracts.mjs |
Catalog and sizing contract updates | — |
scripts/mobile-quality-review.mjs |
Mobile navigation and sizing checks | — |
README.md |
Catalog layout and sizing documentation | — |
packages/ui/tests/catalog-navigation.test.tsx |
Catalog navigation coverage | Moderate (1 vote): does not verify preview state survives remounting. |
apps/specimens/src/specimens.css |
Shell, rail, picker, and responsive styles | — |
apps/specimens/src/specimens-fixes.css |
Responsive safeguard updates | — |
apps/specimens/src/lab.css |
Removes density-control styling | — |
apps/specimens/src/app.tsx |
Catalog navigation, hash handling, and compact sizing | Moderate (1 vote): stale hashes can desynchronize the URL, selection, and visible component after filtering. |
apps/specimens/index.html |
Sets compact initial density | — |
Review details
Suppressed comments (2)
apps/specimens/src/app.tsx:500
- When search removes the component named by the current hash, this handler falls back to
library-overviewbut leaves the stale fragment in the URL. Clearing the search then recreates that target without scrolling to it, and the nextonScrollcan overwriteactiveId, so the URL, selected sidebar entry, and visible component diverge. Clear/replace an invalid hash when filtering removes its target, or explicitly restore and scroll to it when the target reappears.
const onHashChange = () => {
const id = window.location.hash.slice(1);
setActiveId(
document
.getElementById(id)
packages/ui/tests/catalog-navigation.test.tsx:148
- This test does not actually verify the “without remounting previews” behavior it names:
ModeSwitchis controlled byuseSpecimens, so itsaria-pressedvalue can remaintrueeven if the preview subtree remounts. Seed state owned by a preview (for example the Composer draft or an open source tab), navigate via the picker/hash, and assert that state survives.
it("navigates from the mobile picker and follows hash history without remounting previews", async () => {
const { container } = render(<App />);
const mode = within(
container.querySelector("#mode-switch")! as HTMLElement,
);
fireEvent.click(mode.getByRole("button", { name: "chat" }));
fireEvent.change(
screen.getByRole("combobox", { name: "Jump to component" }),
{
target: { value: "send-control" },
},
);
expect(window.location.hash).toBe("#send-control");
const navigation = screen.getByRole("navigation", {
name: "Component navigation",
});
await waitFor(() =>
expect(
within(navigation).getByRole("link", { name: "Send control" }),
).toHaveAttribute("aria-current", "location"),
);
act(() => {
window.history.replaceState(null, "", "#mode-switch");
window.dispatchEvent(new HashChangeEvent("hashchange"));
});
expect(
screen.getByRole("combobox", { name: "Jump to component" }),
).toHaveValue("mode-switch");
expect(mode.getByRole("button", { name: "chat" })).toHaveAttribute(
"aria-pressed",
"true",
);
- Files reviewed: 10/10 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Remove stale fragments without changing the query string or history state when search hides their targets. Cover preview-owned draft and source-tab state across navigation, and assert stale-fragment cleanup in browser journeys. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
Addressed both review observations in 7391d51:
All 18 targeted tests pass; fresh CI and browser checks are running. |
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.
Summary
Validation
pnpm check) passed on the final head: https://github.com/OpenCoven/ui/actions/runs/34462792389opencoven-uiVercel deployment is Ready.Existing deployment issue
The separate Vercel
uiproject retains the pre-existingNo Output Directory named "dist" foundfailure documented in #7, after running the library build. No deployment settings or branch protections were changed.