Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.

Implement hamburger navigation mobile-friendly sidebar and topbar - #186

Merged
IanRohrbacher merged 10 commits into
developmentfrom
mobile-friendly
Apr 13, 2026
Merged

Implement hamburger navigation mobile-friendly sidebar and topbar #186
IanRohrbacher merged 10 commits into
developmentfrom
mobile-friendly

Conversation

@moonshadow2

@moonshadow2 moonshadow2 commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Mobile hamburger toggle to open/close the sidebar
    • Off-canvas sidebar with semi-transparent backdrop and smooth animations
  • Bug Fixes

    • Sidebar now reliably closes when navigating between content
  • Style

    • Updated mobile layout and component styles for improved spacing, rounded panels, and stacking order
    • Adjusted view/card/list spacing and section layout for consistent presentation

@coderabbitai

coderabbitai Bot commented Apr 8, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Adds a mobile-responsive off-canvas sidebar: new sidebarOpen Svelte store, Topbar hamburger toggles the store, Sidebar listens to the store and shows/hides with a backdrop; supporting CSS updates and a Vite config tweak.

Changes

Cohort / File(s) Summary
Store
rocky-interface/src/lib/stores/sidebarStore.ts
New exported sidebarOpen writable store (boolean, initialized false).
UI Components
rocky-interface/src/lib/components/Sidebar.svelte, rocky-interface/src/lib/components/Topbar.svelte
Topbar: adds hamburger button that inverts sidebarOpen. Sidebar: subscribes to sidebarOpen, binds class:open={$sidebarOpen}, adds backdrop that closes sidebar on click; navigation actions now set sidebarOpen.set(false).
Styles
rocky-interface/src/lib/styles/components/components.css, rocky-interface/src/lib/styles/layout/layout.css
Added mobile-only .hamburger and .hamburger-line styles, .sidebar.open state, .sidebar-backdrop, updates to .widget-panel, .view-menu-backdrop, .view-switcher, and layout breakpoints to support off-canvas sidebar and mobile layout changes.
Build Config
rocky-interface/vite.config.ts
Added Vite config change: excludes @azure/msal-browser from optimizeDeps.pre-bundling.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Topbar as Topbar Component
    participant Store as sidebarOpen Store
    participant Sidebar as Sidebar Component
    participant CSS as Styles

    User->>Topbar: click hamburger
    Topbar->>Store: sidebarOpen = !sidebarOpen
    Store-->>Sidebar: state updated ($sidebarOpen)
    Sidebar->>CSS: apply/remove .open class
    CSS-->>Sidebar: slide in/out + backdrop shown/hidden
    Sidebar-->>User: visible/hidden sidebar
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • code rabbit test #122 — introduces or modifies the shared sidebarOpen store and updates Sidebar/Topbar components and styles touching the same code paths.

Poem

🐰
A tap, a toggle, a gentle slide,
The sidebar hops out from the side,
Store holds the key, the hamburger gleams,
Mobile and tidy — the rabbit beams! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: implementing a hamburger navigation menu for mobile-friendly sidebar and topbar components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mobile-friendly

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
rocky-interface/src/lib/components/Sidebar.svelte (1)

153-163: Redundant sidebarOpen.set(false) call.

Line 157 calls sidebarOpen.set(false), but handleFrameChange('courses') on line 155 already sets this to false at line 112. This is harmless but redundant.

♻️ Suggested simplification
 async function openCourse(courseId: number) {
   selectedCourseId.set(courseId);
   await handleFrameChange('courses');
   courseMenuOpen = false;
-  sidebarOpen.set(false);
   requestAnimationFrame(() => {
     requestAnimationFrame(() => {
       scrollToTopOfApp();
     });
   });
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rocky-interface/src/lib/components/Sidebar.svelte` around lines 153 - 163,
The openCourse function contains a redundant sidebarOpen.set(false) call because
handleFrameChange('courses') already clears the sidebar (see handleFrameChange
implementation); remove the extra sidebarOpen.set(false) line from openCourse
and keep selectedCourseId.set(courseId), await handleFrameChange('courses'),
courseMenuOpen = false, and the nested requestAnimationFrame(...) call that
triggers scrollToTopOfApp() so behavior remains identical but without
duplication.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@rocky-interface/src/lib/components/Topbar.svelte`:
- Around line 12-16: The hamburger spans in Topbar.svelte use
class="hamburger-line" but the stylesheet defines .hamburger-span, so the lines
are unstyled; fix by making the class names consistent—either change the three
<span> elements in Topbar.svelte to use class="hamburger-span" or update the CSS
selector in components.css from .hamburger-span to .hamburger-line so that the
styles apply to the spans rendered by the Topbar component.

In `@rocky-interface/src/lib/styles/components/components.css`:
- Around line 117-125: The .sidebar CSS rule uses an invalid var() syntax:
replace the incorrect token in the top property (currently "top:
--var(--size-topbar-height)") with the proper CSS var() call so it reads top:
var(--size-topbar-height); update the .sidebar rule in components.css (the rule
that sets position, top, left, height, transform, transition, z-index) to use
var(--size-topbar-height) so the mobile sidebar positions correctly below the
topbar.

---

Nitpick comments:
In `@rocky-interface/src/lib/components/Sidebar.svelte`:
- Around line 153-163: The openCourse function contains a redundant
sidebarOpen.set(false) call because handleFrameChange('courses') already clears
the sidebar (see handleFrameChange implementation); remove the extra
sidebarOpen.set(false) line from openCourse and keep
selectedCourseId.set(courseId), await handleFrameChange('courses'),
courseMenuOpen = false, and the nested requestAnimationFrame(...) call that
triggers scrollToTopOfApp() so behavior remains identical but without
duplication.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b1b0ce17-64e5-425e-9b17-5ffefb6fbbf1

📥 Commits

Reviewing files that changed from the base of the PR and between be635d7 and 8babf0d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • rocky-interface/src/lib/components/Sidebar.svelte
  • rocky-interface/src/lib/components/Topbar.svelte
  • rocky-interface/src/lib/stores/sidebarStore.ts
  • rocky-interface/src/lib/styles/components/components.css

Comment on lines +12 to +16
<button class="hamburger" aria-label="Toggle menu" onclick={() => sidebarOpen.update(open => !open)}>
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
</button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Class name mismatch: hamburger lines won't be styled.

The spans use class="hamburger-line" but the CSS in components.css (lines 61-67) defines .hamburger-span. This mismatch will cause the hamburger icon bars to be invisible/unstyled.

🐛 Fix: Use consistent class name

Either update the HTML to match the CSS:

 <button class="hamburger" aria-label="Toggle menu" onclick={() => sidebarOpen.update(open => !open)}>
-  <span class="hamburger-line"></span>
-  <span class="hamburger-line"></span>
-  <span class="hamburger-line"></span>
+  <span class="hamburger-span"></span>
+  <span class="hamburger-span"></span>
+  <span class="hamburger-span"></span>
 </button>

Or update the CSS in components.css to use .hamburger-line instead of .hamburger-span.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<button class="hamburger" aria-label="Toggle menu" onclick={() => sidebarOpen.update(open => !open)}>
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
</button>
<button class="hamburger" aria-label="Toggle menu" onclick={() => sidebarOpen.update(open => !open)}>
<span class="hamburger-span"></span>
<span class="hamburger-span"></span>
<span class="hamburger-span"></span>
</button>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rocky-interface/src/lib/components/Topbar.svelte` around lines 12 - 16, The
hamburger spans in Topbar.svelte use class="hamburger-line" but the stylesheet
defines .hamburger-span, so the lines are unstyled; fix by making the class
names consistent—either change the three <span> elements in Topbar.svelte to use
class="hamburger-span" or update the CSS selector in components.css from
.hamburger-span to .hamburger-line so that the styles apply to the spans
rendered by the Topbar component.

Comment thread rocky-interface/src/lib/styles/components/components.css
@IanRohrbacher
IanRohrbacher merged commit 57d0517 into development Apr 13, 2026
8 of 9 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants