Repository navigation
fix(templates): five top and side nav examples get working links and actions - #12049
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 9c02d65 |
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Requesting changes. The code itself holds up: in Chromium at this head each changed control responds, the new links render as real anchors with the selected side nav item keeping aria-current="page", and every before/after frame at 390 and 1280 px is pixel-identical at rest. What needs fixing is the wording around it.
- The changeset and the description's opening sentence claim the top nav and side nav example blocks as a family, but the Profile button in
packages/cli/assets/templates/blocks/components/TopNav/TopNavHoverMenu.tsx:70andTopNav/TopNavWithLogo.tsx:30, the Dashboard item inSideNav/SideNavNestedItems.tsx:56and the Pin to top and Rename rows inSideNav/SideNavEndContent.tsx:97-98are still dead at this head, so either narrow the wording to the five blocks this change touches or wire those controls and list any you leave, as the earlier page-template sweeps did. - The evidence line "Browser check: each changed control shows its note (Copy really copies)" names a Copy control that none of the five changed files contains, so drop or correct that parenthetical.
Two non-blocking notes: none of the nine handlers passes uniqueID, so three presses of Search leave three identical toasts stacked where the merged page templates replace theirs; and the three blocks that now call useToast do not list Toast in componentsUsed, which is what a component's example-block list and block search read.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the changeset's "top nav and side nav example blocks" scope for the demo notes and the links. False as written: four controls in those two block families keep no handler and no destination at this head.
- Claim: the description's "in the top nav examples, Search, Notifications and Profile show a demo toast". Verified for the three changed blocks; false for the top nav examples as a whole.
- Claim: Sign in, Get started and Upgrade become links with the same look and no toast. Verified: each renders as an anchor with
href="#", and the at-rest frames are pixel-identical. - Claim: the side nav items in the header-menu side nav become links. Verified: both items render as anchors, and the selected one keeps
aria-current="page". - Claim: these blocks rendered buttons and menu items that did nothing. Partly false: no menu item changed here; the header menu's rows already carried a destination on the base.
- Claim: pixel-identical at rest at 390 and 1280 px, and the toast appears only after a click. Verified with script running; the script-off variant was not reproduced in this review.
- Claim: each changed control shows its note. Verified for all nine handlers by click and by keyboard; the "Copy really copies" parenthetical is false.
- Claim: a build replay shows no start, alternatives or block list changes. Not reproduced here; it is consistent with the code, because a block indexes on its authored
componentsUsedand ids, which this change leaves unchanged, and the template, search, golden-read and discovery suites pass at this head. - Claim: typecheck (strict), lint and prettier pass. Verified: prettier and eslint are clean on the five files, the template-doc typecheck is clean, and the strict typecheck reports only two errors in untouched files caused by an unbuilt theme package in this environment.
- Claim: no props, API, layout or styling change. Verified: only example source and a changeset change, and nothing moves at rest.
- Claim: public text contains no internal context. Verified over the added lines, the title, the branch name and the commit message.
- File
.changeset/block-controls-nav.md: finding, the scope wording above. - File
TopNav/TopNavShowcase.tsx: clear, with theuniqueIDandcomponentsUsednotes. - File
TopNav/TopNavCenteredNavigation.tsx: clear, same two notes. - File
TopNav/TopNavEnterpriseDashboard.tsx: clear, same two notes plus thehref={'#'}spelling. - File
TopNav/TopNavMegaMenu.tsx: clear, with thehref={'#'}spelling note. - File
SideNav/SideNavWithHeaderMenu.tsx: clear, with thehref={'#'}spelling note. - Consistency across the changed files: the nine toast strings follow one shape, and the five blocks keep their existing layout, icons and docs.
| endContent={ | ||
| <> | ||
| <Button | ||
| onClick={() => showToast({body: 'Demo: search would open here'})} |
There was a problem hiding this comment.
Non-blocking: without a uniqueID, three presses of Search leave three identical toasts stacked. The merged page templates pass one, for example pages/messaging-shell/page.tsx:391 (uniqueID: what).
| <> | ||
| <Button label="Sign in" variant="ghost" /> | ||
| <Button label="Get started" variant="primary" /> | ||
| <Button href={'#'} label="Sign in" variant="ghost" /> |
There was a problem hiding this comment.
Non-blocking: the templates write href="#" in 154 places; href={'#'} is the only spelling of its kind. Templates are copied verbatim, so the plain string reads better in a copy.
|
/approve-spec cf62150 |
There was a problem hiding this comment.
Requesting changes. The description update fixed both wording findings in it; what remains is the same family-wide claim in the release note and the title.
- The changeset (
.changeset/block-controls-nav.md) still says "Top nav and side nav example blocks: …", but the Profile button inTopNav/TopNavHoverMenu.tsxandTopNav/TopNavWithLogo.tsx, the Dashboard item inSideNav/SideNavNestedItems.tsxand the Pin to top and Rename rows inSideNav/SideNavEndContent.tsxare still dead, so name the five blocks this change touches (and the header-menu side nav for the side nav links). - Miss: the title "top and side nav examples have working links and actions" makes the same family-wide claim against those four controls, so narrow it the same way, for example "five top and side nav examples get working links and actions".
The two earlier non-blocking notes still apply: the nine notes pass no uniqueID, so repeated presses stack identical notes, and the new destinations are written href={'#'} where the templates write href="#".
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0)
- Changeset: the top nav and side nav example blocks get demo notes and links. False as written: four controls in those families stay dead.
- Title: top and side nav examples have working links and actions. False as written, for the same four controls.
- In the top nav examples, Search, Notifications and Profile show a demo note. Verified for the three changed top nav blocks; the description now says other blocks are unchanged.
- Sign in, Get started and Upgrade become links with the same look and no note. Verified: each renders an anchor to
#, and the at-rest frames are unchanged. - The side nav items in the header-menu side nav become links. Verified; the selected item keeps
aria-current="page". - Some controls in these blocks did nothing. Verified on the base.
- Other controls in these blocks and in other blocks are unchanged. Verified: only the five blocks and the changeset change.
- No props, API, layout or styling change. Verified.
- Pixel-identical at rest at 390 and 1280 px; the note appears only after a click. Verified with script running; the script-off variant was not reproduced.
- Each changed control shows its note. Verified for the nine notes.
- A build replay shows no start, alternatives or block list changes. Not reproduced; consistent with the code, since no doc metadata changes.
- Typecheck, lint and prettier pass. Verified for lint and prettier on the changed files; the strict typecheck reports nothing in the changed files.
- Example blocks only, with no component or API change. Verified.
- Public text contains no internal context. Verified over the added lines, title, body, branch name and commit messages.
- File
.changeset/block-controls-nav.md: the scope finding above. - Files
TopNavShowcase.tsx,TopNavCenteredNavigation.tsx,TopNavEnterpriseDashboard.tsx: clear, with theuniqueIDnote. - Files
TopNavMegaMenu.tsx,SideNavWithHeaderMenu.tsx: clear, with thehrefspelling note; the five blocks stay consistent with each other.
|
/approve-spec f533730 |
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet.
The release note and the title now name exactly the five blocks this change touches, which settles both earlier findings; the code was already sound. Two optional notes still apply: passing a uniqueID to each demo note would stop repeated presses from stacking identical notes, and href="#" matches how the other templates write these destinations.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0)
- Title: five top and side nav examples get working links and actions. Verified: only those five blocks change, and each gains demo notes or links.
- Changeset: in the five named blocks, Search, Notifications and Profile show a demo note, and Sign in, Get started, Upgrade and the header-menu side nav items are links; other top and side nav examples are unchanged. Verified block by block (
TopNavShowcase.tsx:34-57,TopNavCenteredNavigation.tsx:34-48,TopNavEnterpriseDashboard.tsx:47-62,TopNavMegaMenu.tsx:91-92,SideNavWithHeaderMenu.tsx:90-91); no other such control exists in those blocks. - Description: Search, Notifications and Profile in the top nav examples show a demo note. Verified for the three changed top nav blocks; the description also says other blocks are unchanged.
- Description: Sign in, Get started and Upgrade become links with the same look and no note. Verified: each renders an anchor to
#, and the link style only removes the underline. - Description: the header-menu side nav items become links. Verified; the selected item keeps its current-page state.
- Description: some controls in these blocks did nothing. Verified on the base, where they had no handler and no destination.
- Description: other controls in these blocks and in other blocks are unchanged. Verified from the diff.
- Description: no props, API, layout or styling change. Verified: no component source, layout or style line changes.
- Description: pixel-identical at rest at 390 and 1280 px with script on and off, and the note appears only after a click. Verified from the code: the at-rest markup differs only by button to anchor with no visible style change, and the toast host is created on the first press.
- Description: each changed control shows its note. Verified: each toast control's click handler shows its note.
- Description: a build replay shows no start, alternatives or block list changes. Verified from the code: blocks are found by their doc metadata, which this change does not touch.
- Description: typecheck, lint and prettier pass. Verified: strict typecheck reports nothing in the changed files, and eslint and prettier are clean on them.
- Description: example blocks only, with no component or API change. Verified.
- Description: public text contains no internal context. Verified over the added lines, title, body, branch name and commit messages.
- File
.changeset/block-controls-nav.md: clear. - Files
TopNavShowcase.tsx,TopNavCenteredNavigation.tsx,TopNavEnterpriseDashboard.tsx: clear, with the optionaluniqueIDnote. - Files
TopNavMegaMenu.tsx,SideNavWithHeaderMenu.tsx: clear, with the optionalhrefspelling note; the five blocks stay consistent with each other.
What
In the top nav examples, Search, Notifications and Profile show an honest "Demo: ... would ... here" toast. Sign in, Get started and Upgrade are navigation, so they become links (
href="#", same look) with no toast, as do the side nav items in the side nav with a header menu.Why
Some controls in these example blocks did nothing when used. The controls listed above now do what they say or say plainly that the example stops there. Other controls in these blocks and in other blocks are unchanged. No props, API, layout or styling change.
Evidence
Scope