Skip to content

fix: navigation highlighting logic and update Wiki absolute URL#9

Merged
nschimme merged 2 commits intoMUME:masterfrom
nschimme:fix-nav-highlighting-and-wiki-link-2493545194803403115
May 3, 2026
Merged

fix: navigation highlighting logic and update Wiki absolute URL#9
nschimme merged 2 commits intoMUME:masterfrom
nschimme:fix-nav-highlighting-and-wiki-link-2493545194803403115

Conversation

@nschimme
Copy link
Copy Markdown
Contributor

@nschimme nschimme commented May 2, 2026

  • Refactored isActive logic in Layout.vue to ensure the "Community" navbar item is only highlighted (gold) on the home page.
  • Ensured "Open Source", "Links", and "Interviews" sections correctly highlight their parent navigation items when their respective pages or sub-pages are active.
  • Updated all MUME Wiki links to use the absolute path https://docs.mume.org/wiki/.

Summary by Sourcery

Adjust navigation active-state logic and update external Wiki URLs to the new docs host.

Bug Fixes:

  • Correct navbar highlighting so the Community item is only active on the home page and subsection pages highlight their own items.

Enhancements:

  • Introduce a reusable route-based isActive helper for computing active navigation states.

Documentation:

- Refactored `isActive` logic in `Layout.vue` to ensure the "Community" navbar item is only highlighted (gold) on the home page.
- Ensured "Open Source", "Links", and "Interviews" sections correctly highlight their parent navigation items when their respective pages or sub-pages are active.
- Updated all MUME Wiki links to use the absolute path `https://docs.mume.org/wiki/`.
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 2, 2026

Reviewer's Guide

Refactors navbar route-activity detection into a reusable isActive helper to correctly control highlighting for the Community and its child menu items, and updates all Wiki links to point to the new https://docs.mume.org/wiki/ URL.

File-Level Changes

Change Details Files
Centralize and correct navbar active-state logic using a reusable helper.
  • Introduce an isActive(path, exact = false) function that normalizes routes and supports exact vs. prefix matching.
  • Use exact matching for the Community root nav item so it only highlights on the homepage.
  • Use non-exact matching for Open Source, Links, and Interviews so their nav items highlight for both their base pages and sub-pages.
docs/.vitepress/theme/Layout.vue
Update all Wiki links to the new absolute docs.mume.org URL. docs/.vitepress/config.js
docs/.vitepress/theme/Layout.vue
docs/index.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Build ready

The build for this PR has been completed successfully. A live preview will be available at: https://docs.mume.org/pr-9/

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The isActive helper currently normalizes to .../ and then uses startsWith, which will also mark routes like /opensource-guides/ as active for /opensource; consider adding a path-segment boundary check (e.g., using new URL or a regex) so only the intended section prefix matches.
  • The Wiki URL is hard-coded in multiple places (Layout.vue, config.js, and index.md); consider centralizing it in a single config or constant to avoid drift if it changes again.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `isActive` helper currently normalizes to `.../` and then uses `startsWith`, which will also mark routes like `/opensource-guides/` as active for `/opensource`; consider adding a path-segment boundary check (e.g., using `new URL` or a regex) so only the intended section prefix matches.
- The Wiki URL is hard-coded in multiple places (`Layout.vue`, `config.js`, and `index.md`); consider centralizing it in a single config or constant to avoid drift if it changes again.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

- Restricted 'Community' nav highlight to the home page only.
- Ensured 'Open Source', 'Links', and 'Interviews' parents highlight when active.
- Updated Wiki link to absolute path 'https://docs.mume.org/wiki/'.
- Added 'target="_self"' and 'rel="external"' to Wiki links to ensure they open in the same tab and prevent VitePress router interference.
@nschimme nschimme merged commit 11ae52a into MUME:master May 3, 2026
2 checks passed
@nschimme nschimme deleted the fix-nav-highlighting-and-wiki-link-2493545194803403115 branch May 5, 2026 14:27
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.

1 participant