Skip to content

Add monochrome home button#638

Merged
SupertigerDev merged 3 commits intomainfrom
monochrome-logo-home-button
Apr 1, 2026
Merged

Add monochrome home button#638
SupertigerDev merged 3 commits intomainfrom
monochrome-logo-home-button

Conversation

@SupertigerDev
Copy link
Copy Markdown
Member

@SupertigerDev SupertigerDev commented Apr 1, 2026

image image

Summary by CodeRabbit

  • New Features

    • Added a monochrome logo option and a context menu to toggle the home icon between default and legacy variants; right-click now opens this menu in side and mobile navigation.
  • Style

    • Home navigation items receive smooth hover opacity and themed selection highlighting.
    • Theme selection button now uses the active theme's primary color for consistent visuals.
  • Chores

    • Added a persistent setting to remember the chosen home icon.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d9fd9d86-fdd8-4d0b-9315-cc6afb28feab

📥 Commits

Reviewing files that changed from the base of the PR and between 6ecfe97 and 7a5c896.

📒 Files selected for processing (5)
  • src/common/localStorage.ts
  • src/components/side-pane/SideBarHomeContextMenu.tsx
  • src/components/side-pane/SidePane.tsx
  • src/components/ui/MobileBottomPane.module.scss
  • src/components/ui/MobileBottomPane.tsx

📝 Walkthrough

Walkthrough

Replaced hardcoded home icons with a configurable LogoMono SVG, added context-menu support to toggle between "default" and "legacy" home icons (persisted in localStorage), updated mobile and sidebar components/styles to render the selected icon, and passed an explicit primary color to ThemeCard's Apply button.

Changes

Cohort / File(s) Summary
Logo component
src/LogoMono.tsx
Added export const LogoMono — a new stateless React component that returns an inline SVG (viewBox 0 0 1000 1000, fill currentColor) with a single complex <path>.
Sidebar home + context menu
src/components/side-pane/SidePane.tsx, src/components/side-pane/SideBarHomeContextMenu.tsx, src/common/localStorage.ts
HomeItem now supports right-click to open SideBarHomeContextMenu at mouse position; context menu toggles sideHomeIcon stored in localStorage (StorageKeys.HOME_ICON) between "default" and "legacy"; SidePane renders LogoMono for "default" and legacy Icon for "legacy".
Mobile bottom pane updates
src/components/ui/MobileBottomPane.tsx, src/components/ui/MobileBottomPane.module.scss
Mobile HomeItem gained right-click/context-menu handling mirroring sidebar behavior; ItemProps.icon expanded to `string
Sidebar styles
src/components/side-pane/styles.module.scss
Added .homeItem and .homeLogo rules: sizing (42×42), circular shape, background, transition, hover opacity/background-color changes, and .homeLogo.selected variant setting --primary-color.
ThemeCard tweak
src/components/explore/ThemeCard.tsx
Apply button now receives color={theme().colors["primary-color"]} in addition to existing props; no other behavior changed.
Minor formatting
src/components/side-pane/SidePane.tsx, src/components/ui/MobileBottomPane.tsx
Small JSX/prop formatting updates (e.g., NotificationCountBadge props, a notify object) with no semantic changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HomeItem
    participant SignalStore as ContextPosSignal
    participant ContextMenu as SideBarHomeContextMenu
    participant LocalStorage as sideHomeIcon
    participant UI as SidePane/MobileBottomPane

    User->>HomeItem: right-click (onContextMenu) at (x,y)
    HomeItem->>SignalStore: set context position (x,y)
    Note right of SignalStore: triggers menu render
    SignalStore->>ContextMenu: render at (x,y)
    User->>ContextMenu: click "Toggle Icon"
    ContextMenu->>LocalStorage: toggle "default" <-> "legacy"
    LocalStorage-->>UI: stored value changed (reactive)
    UI->>UI: re-render HomeItem icon (LogoMono or legacy Icon)
    User->>ContextMenu: close
    ContextMenu->>SignalStore: clear context position
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped a logo into view,
A squircle badge of primary hue,
Right-click to flip the old and new,
Mobile, sidebar — colors true,
A little rabbit's joyous cue.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description contains only two image placeholders without any written context, missing all required template sections including 'What does this PR do?', testing details, and checklist items. Add written description explaining the changes, testing approach, and complete the provided checklist. Include details about the LogoMono component, styling changes, and any testing performed.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add monochrome home button' accurately and specifically describes the main change: adding a new LogoMono component-based home button with monochrome styling.

✏️ 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 monochrome-logo-home-button

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

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 (2)
src/LogoMono.tsx (1)

3-9: Mark the SVG as decorative to avoid noisy screen-reader output.

Since this is an icon glyph, add decorative semantics on the SVG root (Line 3-9) so it doesn’t get announced as an unnamed graphic in icon-only contexts.

Suggested change
     <svg
       xmlns="http://www.w3.org/2000/svg"
       viewBox="0 0 1000 1000"
       width="100%"
       height="100%"
       fill="currentColor"
+      aria-hidden="true"
+      focusable="false"
     >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/LogoMono.tsx` around lines 3 - 9, The SVG in LogoMono.tsx is currently
announced as an unnamed graphic; mark it decorative by adding aria-hidden="true"
(and ideally focusable="false" for SVGs in IE) on the SVG root element so screen
readers ignore it in icon-only contexts; update the root <svg> attributes in the
LogoMono component to include these accessibility attributes and remove any
empty/unnecessary title attributes if present.
src/components/side-pane/SidePane.tsx (1)

132-132: Remove the commented-out icon line.

Line 132 leaves dead/commented UI code in the hot path; safe to delete now that LogoMono is in place.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/side-pane/SidePane.tsx` at line 132, Remove the dead commented
UI code in SidePane.tsx by deleting the commented-out Icon line ("{/* <Icon
name=\"home\" size={props.size - props.size * 0.6308} /> */}") now that LogoMono
is used; update the SidePane component to remove the obsolete comment so only
the active LogoMono code remains.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/side-pane/SidePane.tsx`:
- Around line 121-130: The Home nav item is now icon-only (uses
SidebarItemContainer, LogoMono, NotificationCountBadge) and needs an accessible
name; update the SidebarItemContainer (or the interactive element it renders) to
include an accessible name by adding an aria-label (e.g., "Home") or a
visually-hidden text node (e.g., a span with screen-reader-only CSS) next to
LogoMono so screen readers can identify the destination, preserving existing
props isSelected() and count().

In `@src/components/side-pane/styles.module.scss`:
- Around line 58-59: The home logo's fixed width/height of 42px causes clipping
when the sidebar is resized to its 40px minimum; update the rule in
styles.module.scss that sets width/height: 42px to use responsive constraints
instead—e.g., replace the hardcoded values with CSS that enforces a min and max
(min-width: 40px; max-width: 42px; width: 100%; height: auto) or use clamp()
(width: clamp(40px, 6vw, 42px); height: clamp(40px, 6vw, 42px)) so the logo
scales with the resizable sidebar and never overflows or becomes clipped.

---

Nitpick comments:
In `@src/components/side-pane/SidePane.tsx`:
- Line 132: Remove the dead commented UI code in SidePane.tsx by deleting the
commented-out Icon line ("{/* <Icon name=\"home\" size={props.size - props.size
* 0.6308} /> */}") now that LogoMono is used; update the SidePane component to
remove the obsolete comment so only the active LogoMono code remains.

In `@src/LogoMono.tsx`:
- Around line 3-9: The SVG in LogoMono.tsx is currently announced as an unnamed
graphic; mark it decorative by adding aria-hidden="true" (and ideally
focusable="false" for SVGs in IE) on the SVG root element so screen readers
ignore it in icon-only contexts; update the root <svg> attributes in the
LogoMono component to include these accessibility attributes and remove any
empty/unnecessary title attributes if present.
🪄 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: f93b3945-f071-4aad-bbdd-a75a238de13b

📥 Commits

Reviewing files that changed from the base of the PR and between c342ce7 and e0efdae.

⛔ Files ignored due to path filters (1)
  • public/assets/logo-monochrome.svg is excluded by !**/*.svg
📒 Files selected for processing (4)
  • src/LogoMono.tsx
  • src/components/explore/ThemeCard.tsx
  • src/components/side-pane/SidePane.tsx
  • src/components/side-pane/styles.module.scss

Comment on lines +121 to +130
<SidebarItemContainer
class={style.homeItem}
selected={isSelected()}
alert={count()}
>
<NotificationCountBadge count={count()} top={10} right={10} />
<Icon name="home" size={props.size - props.size * 0.6308} />

<div class={cn(style.homeLogo, isSelected() && style.selected)}>
<LogoMono />
</div>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add an accessible name to the icon-only Home nav item.

After switching to custom logo markup, this item is icon-only; give the link/container an accessible name so screen-reader users can identify the destination.

Suggested change
-      <A href="/app" style={{ "text-decoration": "none" }}>
+      <A
+        href="/app"
+        aria-label={t("sidePane.home")}
+        style={{ "text-decoration": "none" }}
+      >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/side-pane/SidePane.tsx` around lines 121 - 130, The Home nav
item is now icon-only (uses SidebarItemContainer, LogoMono,
NotificationCountBadge) and needs an accessible name; update the
SidebarItemContainer (or the interactive element it renders) to include an
accessible name by adding an aria-label (e.g., "Home") or a visually-hidden text
node (e.g., a span with screen-reader-only CSS) next to LogoMono so screen
readers can identify the destination, preserving existing props isSelected() and
count().

Comment on lines +58 to +59
width: 42px;
height: 42px;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Make home logo sizing responsive to the resizable sidebar.

Line 58-59 hardcodes 42px, but sidebar minimum width is 40px, so this can clip or crowd at the smallest size.

Suggested change
   .homeLogo {
-    width: 42px;
-    height: 42px;
+    width: clamp(30px, calc(100% - 8px), 42px);
+    height: clamp(30px, calc(100% - 8px), 42px);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/side-pane/styles.module.scss` around lines 58 - 59, The home
logo's fixed width/height of 42px causes clipping when the sidebar is resized to
its 40px minimum; update the rule in styles.module.scss that sets width/height:
42px to use responsive constraints instead—e.g., replace the hardcoded values
with CSS that enforces a min and max (min-width: 40px; max-width: 42px; width:
100%; height: auto) or use clamp() (width: clamp(40px, 6vw, 42px); height:
clamp(40px, 6vw, 42px)) so the logo scales with the resizable sidebar and never
overflows or becomes clipped.

@1enify
Copy link
Copy Markdown
Contributor

1enify commented Apr 1, 2026

Can this be toggleable? I'm not really a fan of this /gen

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
src/components/side-pane/SidePane.tsx (1)

120-125: ⚠️ Potential issue | 🟠 Major

Add an accessible name to the icon-only Home link.

At Line 120, the <A href="/app"> element is icon-only, so screen readers may not get a reliable name. Please add an explicit accessible name.

Suggested fix
-      <A href="/app" style={{ "text-decoration": "none" }}>
+      <A
+        href="/app"
+        aria-label={t("sidePane.home")}
+        style={{ "text-decoration": "none" }}
+      >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/side-pane/SidePane.tsx` around lines 120 - 125, The icon-only
link rendered by the A component wrapping SidebarItemContainer (props
class={style.homeItem}, selected={isSelected()}, alert={count()}) lacks an
accessible name; add an explicit accessible label by supplying an aria-label
(e.g., aria-label="Home") on the A element or include visually-hidden text
inside the link so screen readers can announce it, ensuring the existing
isSelected() and count() logic remains unchanged.
🧹 Nitpick comments (1)
src/components/side-pane/SidePane.tsx (1)

138-138: Remove commented-out legacy icon code.

At Line 138, keeping commented UI code adds noise and can mislead future edits.

Cleanup
-          {/* <Icon name="home" size={props.size - props.size * 0.6308} /> */}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/side-pane/SidePane.tsx` at line 138, Remove the commented-out
legacy icon JSX from the SidePane component to reduce noise: delete the line
containing {/* <Icon name="home" size={props.size - props.size * 0.6308} /> */}
inside the SidePane.tsx render so only active JSX remains; locate the comment in
the SidePane component's return/JSX and remove the entire commented line.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@src/components/side-pane/SidePane.tsx`:
- Around line 120-125: The icon-only link rendered by the A component wrapping
SidebarItemContainer (props class={style.homeItem}, selected={isSelected()},
alert={count()}) lacks an accessible name; add an explicit accessible label by
supplying an aria-label (e.g., aria-label="Home") on the A element or include
visually-hidden text inside the link so screen readers can announce it, ensuring
the existing isSelected() and count() logic remains unchanged.

---

Nitpick comments:
In `@src/components/side-pane/SidePane.tsx`:
- Line 138: Remove the commented-out legacy icon JSX from the SidePane component
to reduce noise: delete the line containing {/* <Icon name="home"
size={props.size - props.size * 0.6308} /> */} inside the SidePane.tsx render so
only active JSX remains; locate the comment in the SidePane component's
return/JSX and remove the entire commented line.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0b936913-df40-49eb-824d-38de2d08eac5

📥 Commits

Reviewing files that changed from the base of the PR and between e0efdae and 6ecfe97.

📒 Files selected for processing (2)
  • src/components/side-pane/SidePane.tsx
  • src/components/side-pane/styles.module.scss
✅ Files skipped from review due to trivial changes (1)
  • src/components/side-pane/styles.module.scss

@SupertigerDev SupertigerDev merged commit baa1af8 into main Apr 1, 2026
1 of 2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Apr 2, 2026
2 tasks
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.

2 participants