Skip to content

handy search item paths for easier future finding - #431

Merged
lewisrenfrew merged 3 commits into
mainfrom
search-paths
Sep 9, 2026
Merged

handy search item paths for easier future finding#431
lewisrenfrew merged 3 commits into
mainfrom
search-paths

Conversation

@lewisrenfrew

Copy link
Copy Markdown
Contributor

No description provided.

@lewisrenfrew
lewisrenfrew requested review from a team and a lite review from Copilot September 9, 2026 10:25

Copilot AI 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.

🟡 Changes recommended

The new hover-driven tab selection can leave the UI in an invalid or “stuck highlighted” state (and can produce invalid Tabs values), which should be corrected before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR enhances the Navigation search UX by attaching section/context information to search results, displaying a breadcrumb path for each result, and visually linking search results to their parent navigation section via tab highlighting on hover.

Changes:

  • Enrich Navigation search entries with sectionId and a computed breadcrumb string, and render that breadcrumb in the results list.
  • Add “hover-to-highlight-tab” behavior by plumbing a new hover callback from SearchPanel into Navigation.
  • Update Storybook sample data to use realistic routes and bump version/changelog.
File summaries
File Description
src/components/SearchPanel.js Builds breadcrumbed search entries and renders breadcrumb text; adds hover callbacks on results.
src/components/Navigation.js Tracks hovered section id and uses it to drive Tabs selection while the search panel is open.
src/components/Panel.stories.js Updates sample hrefs to real-ish paths for better Storybook demos.
src/components/Navigation.stories.js Updates sample hrefs to real-ish paths for better Storybook demos.
package.json Bumps package version to 34.1.0.
CHANGELOG.md Adds 34.1.0 entry describing the search path/breadcrumb enhancement.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/components/Navigation.js Outdated
Comment thread src/components/Navigation.js
Comment thread src/components/SearchPanel.js Outdated
Comment thread src/components/SearchPanel.js Outdated
Copilot AI review requested due to automatic review settings September 9, 2026 11:34

Copilot AI 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.

🟡 Changes recommended

There are a few correctness/performance issues in the new hover + memoized entry logic that should be addressed to avoid sticky tab selection and unnecessary allocations.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

Previously missed (2) — in code that hasn't changed since the last review.

src/components/SearchPanel.js:27

  • menuEntries calls menu.flatMap(...), which will throw if menu is ever null/undefined. Since this component already provides a default for onHoverSection, it would be safer to also default menu to an empty array to avoid runtime crashes if the prop is omitted or not yet loaded.
    src/components/SearchPanel.js:58
  • uniqueEntries uses object spread inside reduce, which creates a new object on every iteration and can become unnecessarily expensive as the menu grows. Mutating the accumulator in-place keeps the same behavior (first entry per href) without the extra allocations.
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/components/Navigation.js Outdated
Copilot AI review requested due to automatic review settings September 9, 2026 11:42

Copilot AI 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.

🟡 Changes recommended

The new hover-to-highlight behavior can leave stale tab selection state and the updated SearchPanel markup has invalid list semantics that impacts accessibility.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread src/components/Navigation.js Outdated
Comment on lines 100 to +104
<Box key={entry.href}>
<a href={entry.href} style={{ textDecoration: 'none' }}>
<a
href={entry.href}
style={{ textDecoration: 'none' }}
onMouseEnter={() => onHoverSection(entry.sectionId)}
Comment on lines +53 to +58
menuEntries.reduce((uniques, entry) => {
if (!uniques[entry.href]) {
return { ...uniques, [entry.href]: entry };
}
return uniques;
}, {})
Copilot AI review requested due to automatic review settings September 9, 2026 11:46

Copilot AI 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.

🔵 Needs a closer look

Search results currently include items regardless of showInMenu, which can expose hidden menu entries and diverges from how Panel renders the same navigation data.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/components/SearchPanel.js:47

  • Search results currently include every category.items entry, even ones that are not shown in the navigation menu (showInMenu: false). Since Panel hides non-menu items, the search panel should apply the same filter to avoid exposing hidden routes and inconsistent UX.
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@lewisrenfrew
lewisrenfrew merged commit dd6d5a7 into main Sep 9, 2026
2 checks passed
@lewisrenfrew
lewisrenfrew deleted the search-paths branch September 9, 2026 11:55
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.

3 participants