Skip to content

Add keyboard shortcut badges to sidebar menu items#2419

Merged
ComputelessComputer merged 2 commits intomainfrom
feat/add-keyboard-shortcut-badges
Dec 19, 2025
Merged

Add keyboard shortcut badges to sidebar menu items#2419
ComputelessComputer merged 2 commits intomainfrom
feat/add-keyboard-shortcut-badges

Conversation

@ComputelessComputer
Copy link
Collaborator

No description provided.

@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit 7c289de
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6944e2f06dd4570007cb9357
😎 Deploy Preview https://deploy-preview-2419--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 19, 2025

Warning

Rate limit exceeded

@ComputelessComputer has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 41 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 35c361e and 7c289de.

📒 Files selected for processing (2)
  • apps/desktop/src/components/main/sidebar/profile/index.tsx (1 hunks)
  • apps/desktop/src/components/main/sidebar/profile/shared.tsx (1 hunks)
📝 Walkthrough

Walkthrough

The changes enhance the desktop sidebar profile menu component by introducing keyboard shortcut badges to menu items. A new optional badge property is added to the MenuItem component API, enabling custom badge content rendering. Menu items now display keyboard shortcuts via styled badge elements.

Changes

Cohort / File(s) Summary
Sidebar profile menu enhancement
apps/desktop/src/components/main/sidebar/profile/index.tsx, apps/desktop/src/components/main/sidebar/profile/shared.tsx
Added optional badge property to MenuItem for displaying keyboard shortcut badges. Updated index.tsx to include badges on Folders, Contacts, Calendar, AI, My Profile, and Settings menu items using a new kbdClass style constant. Replaced KbdGroup/Kbd imports with inline <kbd> elements. In shared.tsx, added "group" CSS class to MenuItem button className for styling adjustments.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify the MenuItem type definition properly includes the optional badge: React.ReactNode property
  • Confirm all six menu items (Folders, Contacts, Calendar, AI, My Profile, Settings) correctly implement and render their respective badges
  • Check that kbdClass styling is properly defined and applied consistently across all badge elements
  • Validate that removal of KbdGroup/Kbd imports doesn't break other components

Possibly related PRs

Suggested reviewers

  • yujonglee

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a pull request description explaining the changes, their purpose, and any relevant context or testing performed.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add keyboard shortcut badges to sidebar menu items' accurately summarizes the main change, which is adding keyboard shortcut badges to menu items in the sidebar.

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.

@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit 7c289de
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/6944e2f0ca01dc00086c5006
😎 Deploy Preview https://deploy-preview-2419--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ComputelessComputer ComputelessComputer force-pushed the feat/add-keyboard-shortcut-badges branch from 35c361e to 17bf9a9 Compare December 19, 2025 05:25
Copy link
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: 1

🧹 Nitpick comments (1)
apps/desktop/src/components/main/sidebar/profile/index.tsx (1)

154-221: Consider extracting badge creation logic.

The badge rendering is duplicated across all menu items. You could optionally extract this into a helper function to reduce repetition.

🔎 Example refactor
+ const createKbdBadge = (keys: string[]) => (
+   <kbd className={kbdClass}>
+     {keys.map((key, i) => 
+       key === "⌘" || key === "⇧" ? (
+         <span key={i} className="text-xs">{key}</span>
+       ) : (
+         <span key={i}>{key}</span>
+       )
+     )}
+   </kbd>
+ );
+
  const menuItems = [
    {
      icon: FolderOpenIcon,
      label: "Folders",
      onClick: handleClickFolders,
-     badge: (
-       <kbd className={kbdClass}>
-         <span className="text-xs">⌘</span>
-         <span className="text-xs">⇧</span>D
-       </kbd>
-     ),
+     badge: createKbdBadge(["⌘", "⇧", "D"]),
    },
    // ... repeat for other items
  ];
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8225f86 and 35c361e.

📒 Files selected for processing (2)
  • apps/desktop/src/components/main/sidebar/profile/index.tsx (1 hunks)
  • apps/desktop/src/components/main/sidebar/profile/shared.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*

📄 CodeRabbit inference engine (AGENTS.md)

Format using dprint fmt from the root. Do not use cargo fmt.

Files:

  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/desktop/src/components/main/sidebar/profile/shared.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props. Just inline them.
Never do manual state management for form/mutation. Use useForm from tanstack-form and useQuery/useMutation from tanstack-query for 99% cases.

Files:

  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/desktop/src/components/main/sidebar/profile/shared.tsx
**/*.{ts,tsx,rs,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

By default, avoid writing comments at all. If you write one, it should be about 'Why', not 'What'.

Files:

  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/desktop/src/components/main/sidebar/profile/shared.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: If there are many classNames with conditional logic, use cn (import from @hypr/utils). Always pass an array and split by logical grouping.
Use motion/react instead of framer-motion.

Files:

  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/desktop/src/components/main/sidebar/profile/shared.tsx
🧠 Learnings (2)
📚 Learning: 2025-12-16T07:24:35.987Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-16T07:24:35.987Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : If there are many classNames with conditional logic, use `cn` (import from `hypr/utils`). Always pass an array and split by logical grouping.

Applied to files:

  • apps/desktop/src/components/main/sidebar/profile/shared.tsx
📚 Learning: 2025-11-24T16:32:19.706Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:32:19.706Z
Learning: Applies to **/*.{ts,tsx} : If there are many classNames with conditional logic, use `cn` (import from `hypr/utils`), similar to `clsx`. Always pass an array and split by logical grouping.

Applied to files:

  • apps/desktop/src/components/main/sidebar/profile/shared.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Redirect rules - hyprnote-storybook
  • GitHub Check: Header rules - hyprnote-storybook
  • GitHub Check: Pages changed - hyprnote-storybook
  • GitHub Check: Redirect rules - hyprnote
  • GitHub Check: Header rules - hyprnote
  • GitHub Check: Pages changed - hyprnote
  • GitHub Check: desktop_ci (linux, depot-ubuntu-22.04-8)
  • GitHub Check: desktop_ci (macos, depot-macos-14)
  • GitHub Check: desktop_ci (linux, depot-ubuntu-24.04-8)
  • GitHub Check: fmt
🔇 Additional comments (1)
apps/desktop/src/components/main/sidebar/profile/shared.tsx (1)

20-20: LGTM! Enables hover effects for badge animations.

The "group" class addition enables the keyboard shortcut badges to animate on hover and active states via group-based pseudo-classes.

@ComputelessComputer ComputelessComputer merged commit 7df768e into main Dec 19, 2025
16 checks passed
@ComputelessComputer ComputelessComputer deleted the feat/add-keyboard-shortcut-badges branch December 19, 2025 05:39
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