fix: gandalf navbar placement and mobile behavior#8
Merged
nschimme merged 5 commits intoMUME:masterfrom May 2, 2026
Merged
Conversation
- Updated Gandalf logo desktop position to 32px for consistency with mume.org. - Wrapped Gandalf logo in an anchor tag linking to https://mume.org/. - Refactored mobile menu to use v-model for state management, eliminating double-toggle issues. - Optimized z-index values (Gandalf: 120, Toggle: 110) to ensure mobile menu clickability. - Refined scroll-hide logic to ensure navbar visibility at page top (scrollY < 10). - Ensured package-lock.json is preserved for reproducible builds.
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts Gandalf navbar positioning and behavior, fixes mobile menu state handling using v-model, and tweaks z-index and scroll logic to ensure correct visibility and clickability on both desktop and mobile. Sequence diagram for mobile menu toggle with v-modelsequenceDiagram
actor User
participant Browser
participant LayoutVue
participant ToggleInput
participant isMenuOpen
participant NavMenu
User->>Browser: Tap label.toggle
Browser->>ToggleInput: Toggle checkbox checked state
ToggleInput-->>LayoutVue: v-model update event
LayoutVue->>isMenuOpen: Set isMenuOpen to checkbox.checked
isMenuOpen-->>LayoutVue: New value (true/false)
LayoutVue->>NavMenu: Re-render with isMenuOpen
alt isMenuOpen is true
NavMenu-->>User: Menu visible and clickable
else isMenuOpen is false
NavMenu-->>User: Menu hidden
end
Flow diagram for updated navbar scroll-hide logicflowchart TD
A[Scroll event] --> B[Read window.scrollY as currentScrollPos]
B --> C[Read window.innerWidth as width]
C --> D[Get navbarRef and gandalfRef]
D --> E{prevScrollpos > currentScrollPos
OR currentScrollPos < 10
OR width <= 650}
E -- Yes --> F[Set navbar.style.top = 0]
F --> G{width <= 650}
G -- Yes --> H[Set gandalf.style.top = 10px]
G -- No --> I[Set gandalf.style.top = 32px]
E -- No --> J[Set navbar.style.top = -70px]
J --> K[Set gandalf.style.top = -86px]
H --> L[Set prevScrollpos = currentScrollPos]
I --> L
K --> L
L --> M[Scroll handler ends]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Build readyThe build for this PR has been completed successfully. A live preview will be available at: https://docs.mume.org/pr-8/ |
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Now that the Gandalf image is a link, consider updating the
alttext or adding anaria-labelon the anchor so the destination (mume.org) is clear to screen reader users rather than just describing the character.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Now that the Gandalf image is a link, consider updating the `alt` text or adding an `aria-label` on the anchor so the destination (mume.org) is clear to screen reader users rather than just describing the character.
## Individual Comments
### Comment 1
<location path="docs/.vitepress/theme/Layout.vue" line_range="111-113" />
<code_context>
</nav>
- <img id="gandalf" ref="gandalfRef" :src="gandalfImg" alt="Gandalf" width="45" height="45">
+ <a id="gandalf" ref="gandalfRef" href="https://mume.org/">
+ <img :src="gandalfImg" alt="Gandalf" width="45" height="45">
+ </a>
</code_context>
<issue_to_address>
**suggestion:** Improve accessibility semantics for the Gandalf link by clarifying the purpose of the navigation target.
Since this image is now a link, `alt="Gandalf"` doesn’t convey the link’s purpose to screen readers. Please use alt text that describes the destination (e.g. `alt="MUME homepage"`) or add an `aria-label` on the `<a>` to indicate where the link goes.
```suggestion
<a id="gandalf" ref="gandalfRef" href="https://mume.org/">
<img :src="gandalfImg" alt="MUME homepage" width="45" height="45">
</a>
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
…d Docker support - Replace gandalf_200.jpg with gandalf_90.gif + gandalf_90@2x.gif (transparent GIF with srcset, downloaded from mume.org) so the ring blends with the dark navbar - Place id="gandalf" directly on the <img> element (matching mume.org's structure) to avoid Safari baseline-gap rendering issues from an <a> wrapper - Add explicit width/height in CSS to prevent VitePress's height:auto reset from resizing the image in Safari - Revert top to 22px (original mume.org value, correct for 90px image) - Fix scroll condition: currentScrollPos < 10 (was prevScrollpos) - Add Dockerfile + docker-compose.yml (multi-stage nginx build, port 4174) - Add .nvmrc pinning Node 22 to keep local/CI/Docker in sync - Update package-lock.json (regenerated to fix cross-platform npm ci failure) - Document Docker usage in README.md and AGENTS.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
macOS-generated lock files omit Linux optional deps (@emnapi/core, @emnapi/runtime) that Vite 8 requires on Linux. Regenerated inside node:22 (Debian) container to match the ubuntu-latest CI environment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6e7d952 to
5a64a21
Compare
Add `docker compose up dev` for live-reload development and update all documentation to recommend Docker over local npm install. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 by Sourcery
Adjust navbar scroll behavior and Gandalf logo placement/linking for better desktop and mobile usability.
New Features:
Bug Fixes:
Enhancements: