Skip to content

Conversation

@ComputelessComputer
Copy link
Collaborator

Description

  • Updated Kbd component styles and markup
  • Migrated Kbd component to a centralized implementation

@netlify
Copy link

netlify bot commented Dec 22, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit 223406c
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/694980da580c950008cf8aa6
😎 Deploy Preview https://deploy-preview-2475--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.

@netlify
Copy link

netlify bot commented Dec 22, 2025

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit 223406c
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/694980dab870b20008fd7947
😎 Deploy Preview https://deploy-preview-2475--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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 22, 2025

📝 Walkthrough

Walkthrough

Six files across desktop and web applications are refactored to replace native <kbd> HTML elements and KbdGroup components with a unified Kbd component for consistent keyboard shortcut rendering. Import statements are updated accordingly, and display logic simplifies to render shortcuts as single combined strings rather than separate nested elements.

Changes

Cohort / File(s) Change Summary
Desktop body components — keyboard shortcut migration
apps/desktop/src/components/main/body/empty/index.tsx, apps/desktop/src/components/main/body/search.tsx, apps/desktop/src/components/main/body/shared.tsx
Replace native <kbd> elements with Kbd component; update imports to remove KbdGroup; simplify shortcut rendering to single joined string inside Kbd instead of mapped spans with inline styling.
Desktop note-input type annotation
apps/desktop/src/components/main/body/sessions/note-input/raw.tsx
Add type annotation (JSONContent) to callback inner some() call in non-empty text check; control flow and logic remain unchanged.
Desktop sidebar profile badges
apps/desktop/src/components/main/sidebar/profile/index.tsx
Import Kbd component; replace raw <kbd> elements with Kbd component for menu item badges; simplify styling class to focus on transitions and hover/active effects.
Web search component keyboard indicator
apps/web/src/components/search.tsx
Replace inline <kbd> markup with Kbd component across SearchTrigger UI paths (sidebar, header, default button); update content from separate spans to single Kbd displaying "⌘ K"; remove explicit border/bg/shadow styling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Changes follow a consistent, repetitive refactoring pattern (native <kbd>Kbd component)
  • No complex logic or control flow modifications except one type annotation addition
  • Six affected files with homogeneous edits reduce reasoning overhead
  • Import updates are straightforward

Possibly related PRs

  • #1635: Modifies apps/desktop/src/components/main/body/search.tsx with overlapping Kbd/KbdGroup import and rendering changes.
  • #2418: Updates apps/web/src/components/search.tsx keyboard badge styling and hover/active interactions related to the same search trigger component.
  • #2419: Modifies apps/desktop/src/components/main/sidebar/profile/index.tsx to add keyboard shortcut badges with complementary styling adjustments.

Suggested reviewers

  • yujonglee

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
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.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Migrated Kbd component to a centralized implementation' directly and clearly summarizes the main change across all modified files.
Description check ✅ Passed The description is directly related to the changeset, mentioning updated Kbd component styles/markup and migration to centralized implementation.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/kbd-component-styles

📜 Recent 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 3f5ee31 and 223406c.

⛔ Files ignored due to path filters (1)
  • packages/ui/src/components/ui/kbd.tsx is excluded by !packages/ui/src/components/ui/**
📒 Files selected for processing (6)
  • apps/desktop/src/components/main/body/empty/index.tsx
  • apps/desktop/src/components/main/body/search.tsx
  • apps/desktop/src/components/main/body/sessions/note-input/raw.tsx
  • apps/desktop/src/components/main/body/shared.tsx
  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/web/src/components/search.tsx
🧰 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/body/sessions/note-input/raw.tsx
  • apps/desktop/src/components/main/body/search.tsx
  • apps/desktop/src/components/main/body/empty/index.tsx
  • apps/web/src/components/search.tsx
  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/desktop/src/components/main/body/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/body/sessions/note-input/raw.tsx
  • apps/desktop/src/components/main/body/search.tsx
  • apps/desktop/src/components/main/body/empty/index.tsx
  • apps/web/src/components/search.tsx
  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/desktop/src/components/main/body/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/body/sessions/note-input/raw.tsx
  • apps/desktop/src/components/main/body/search.tsx
  • apps/desktop/src/components/main/body/empty/index.tsx
  • apps/web/src/components/search.tsx
  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/desktop/src/components/main/body/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/body/sessions/note-input/raw.tsx
  • apps/desktop/src/components/main/body/search.tsx
  • apps/desktop/src/components/main/body/empty/index.tsx
  • apps/web/src/components/search.tsx
  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/desktop/src/components/main/body/shared.tsx
🧠 Learnings (3)
📚 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} : Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props. Just inline them.

Applied to files:

  • apps/desktop/src/components/main/body/sessions/note-input/raw.tsx
📚 Learning: 2025-12-16T07:24:36.000Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-16T07:24:36.000Z
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/index.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/index.tsx
🧬 Code graph analysis (6)
apps/desktop/src/components/main/body/sessions/note-input/raw.tsx (1)
packages/tiptap/src/editor/index.tsx (1)
  • JSONContent (30-30)
apps/desktop/src/components/main/body/search.tsx (1)
extensions/shared/types/hypr-extension.d.ts (1)
  • Kbd (337-337)
apps/desktop/src/components/main/body/empty/index.tsx (2)
extensions/shared/types/hypr-extension.d.ts (1)
  • Kbd (337-337)
packages/utils/src/cn.ts (1)
  • cn (20-22)
apps/web/src/components/search.tsx (2)
extensions/shared/types/hypr-extension.d.ts (1)
  • Kbd (337-337)
packages/utils/src/cn.ts (1)
  • cn (20-22)
apps/desktop/src/components/main/sidebar/profile/index.tsx (1)
extensions/shared/types/hypr-extension.d.ts (1)
  • Kbd (337-337)
apps/desktop/src/components/main/body/shared.tsx (1)
extensions/shared/types/hypr-extension.d.ts (1)
  • Kbd (337-337)
⏰ 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). (7)
  • GitHub Check: desktop_ci (linux, depot-ubuntu-22.04-8)
  • GitHub Check: desktop_ci (linux, depot-ubuntu-24.04-8)
  • GitHub Check: ci
  • GitHub Check: fmt
  • GitHub Check: Redirect rules - hyprnote
  • GitHub Check: Header rules - hyprnote
  • GitHub Check: Pages changed - hyprnote
🔇 Additional comments (6)
apps/desktop/src/components/main/body/sessions/note-input/raw.tsx (1)

69-69: Type annotation appears unrelated to PR objectives.

This type annotation change doesn't align with the stated PR objectives of migrating the Kbd component to a centralized implementation. While the annotation itself is correct and may improve type safety, it seems to be an unrelated change that should ideally be in a separate commit or PR.

apps/desktop/src/components/main/body/search.tsx (1)

5-5: LGTM! Clean migration to centralized Kbd component.

The change successfully migrates from KbdGroup with separate Kbd elements to a single Kbd component displaying the combined shortcut. This aligns perfectly with the PR objectives and simplifies the rendering logic.

Also applies to: 174-174

apps/desktop/src/components/main/body/empty/index.tsx (1)

4-4: LGTM! Effective simplification of keyboard shortcut rendering.

The migration replaces the previous pattern of mapping over shortcut arrays with a single Kbd component that renders the joined string. The hover and active state animations are preserved through the className prop, and the logic is cleaner and more maintainable.

Also applies to: 134-142

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

14-14: LGTM! Successful migration with simplified styling.

The migration to the centralized Kbd component is well-executed. The kbdClass has been appropriately simplified to retain only the transition and interactive effects (hover/active shadows), while the base keyboard styling is now handled by the Kbd component itself. This promotes consistency and reduces duplication.

Also applies to: 131-167

apps/desktop/src/components/main/body/shared.tsx (1)

4-4: LGTM! Clean consolidation of keyboard shortcut rendering.

The change successfully removes the KbdGroup wrapper and consolidates the shortcut display into a single Kbd component with an interpolated string. This aligns with the PR's centralization objectives and simplifies the component structure.

Also applies to: 152-152

apps/web/src/components/search.tsx (1)

21-21: LGTM! Excellent simplification across all search variants.

The migration successfully replaces native <kbd> elements and their associated styling complexity with the centralized Kbd component across all three search trigger variants (sidebar, header, and default). This significantly reduces code duplication and ensures consistent keyboard shortcut rendering throughout the web application.

Also applies to: 115-124, 160-169, 189-189


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
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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/desktop/src/components/main/body/sessions/note-input/raw.tsx (1)

118-118: Inconsistent: Native <kbd> element not migrated to centralized Kbd component.

This file still uses a native <kbd> element on Line 118, which is inconsistent with the PR's stated objective of migrating to a centralized Kbd component implementation. All other files in this PR have replaced native <kbd> elements with the Kbd component from @hypr/ui/components/ui/kbd.

🔎 Suggested fix to align with PR objectives

Add the import at the top of the file:

+import { Kbd } from "@hypr/ui/components/ui/kbd";

Then update the placeholder:

     return (
       <p className="text-[#e5e5e5]">
-        Take notes or press <kbd>/</kbd> for commands.
+        Take notes or press <Kbd>/</Kbd> for commands.
       </p>
     );
📜 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 3f5ee31 and 223406c.

⛔ Files ignored due to path filters (1)
  • packages/ui/src/components/ui/kbd.tsx is excluded by !packages/ui/src/components/ui/**
📒 Files selected for processing (6)
  • apps/desktop/src/components/main/body/empty/index.tsx
  • apps/desktop/src/components/main/body/search.tsx
  • apps/desktop/src/components/main/body/sessions/note-input/raw.tsx
  • apps/desktop/src/components/main/body/shared.tsx
  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/web/src/components/search.tsx
🧰 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/body/sessions/note-input/raw.tsx
  • apps/desktop/src/components/main/body/search.tsx
  • apps/desktop/src/components/main/body/empty/index.tsx
  • apps/web/src/components/search.tsx
  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/desktop/src/components/main/body/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/body/sessions/note-input/raw.tsx
  • apps/desktop/src/components/main/body/search.tsx
  • apps/desktop/src/components/main/body/empty/index.tsx
  • apps/web/src/components/search.tsx
  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/desktop/src/components/main/body/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/body/sessions/note-input/raw.tsx
  • apps/desktop/src/components/main/body/search.tsx
  • apps/desktop/src/components/main/body/empty/index.tsx
  • apps/web/src/components/search.tsx
  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/desktop/src/components/main/body/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/body/sessions/note-input/raw.tsx
  • apps/desktop/src/components/main/body/search.tsx
  • apps/desktop/src/components/main/body/empty/index.tsx
  • apps/web/src/components/search.tsx
  • apps/desktop/src/components/main/sidebar/profile/index.tsx
  • apps/desktop/src/components/main/body/shared.tsx
🧠 Learnings (3)
📚 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} : Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props. Just inline them.

Applied to files:

  • apps/desktop/src/components/main/body/sessions/note-input/raw.tsx
📚 Learning: 2025-12-16T07:24:36.000Z
Learnt from: CR
Repo: fastrepl/hyprnote PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-16T07:24:36.000Z
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/index.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/index.tsx
🧬 Code graph analysis (6)
apps/desktop/src/components/main/body/sessions/note-input/raw.tsx (1)
packages/tiptap/src/editor/index.tsx (1)
  • JSONContent (30-30)
apps/desktop/src/components/main/body/search.tsx (1)
extensions/shared/types/hypr-extension.d.ts (1)
  • Kbd (337-337)
apps/desktop/src/components/main/body/empty/index.tsx (2)
extensions/shared/types/hypr-extension.d.ts (1)
  • Kbd (337-337)
packages/utils/src/cn.ts (1)
  • cn (20-22)
apps/web/src/components/search.tsx (2)
extensions/shared/types/hypr-extension.d.ts (1)
  • Kbd (337-337)
packages/utils/src/cn.ts (1)
  • cn (20-22)
apps/desktop/src/components/main/sidebar/profile/index.tsx (1)
extensions/shared/types/hypr-extension.d.ts (1)
  • Kbd (337-337)
apps/desktop/src/components/main/body/shared.tsx (1)
extensions/shared/types/hypr-extension.d.ts (1)
  • Kbd (337-337)
⏰ 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). (7)
  • GitHub Check: desktop_ci (linux, depot-ubuntu-22.04-8)
  • GitHub Check: desktop_ci (linux, depot-ubuntu-24.04-8)
  • GitHub Check: ci
  • GitHub Check: fmt
  • GitHub Check: Redirect rules - hyprnote
  • GitHub Check: Header rules - hyprnote
  • GitHub Check: Pages changed - hyprnote
🔇 Additional comments (6)
apps/desktop/src/components/main/body/sessions/note-input/raw.tsx (1)

69-69: Type annotation appears unrelated to PR objectives.

This type annotation change doesn't align with the stated PR objectives of migrating the Kbd component to a centralized implementation. While the annotation itself is correct and may improve type safety, it seems to be an unrelated change that should ideally be in a separate commit or PR.

apps/desktop/src/components/main/body/search.tsx (1)

5-5: LGTM! Clean migration to centralized Kbd component.

The change successfully migrates from KbdGroup with separate Kbd elements to a single Kbd component displaying the combined shortcut. This aligns perfectly with the PR objectives and simplifies the rendering logic.

Also applies to: 174-174

apps/desktop/src/components/main/body/empty/index.tsx (1)

4-4: LGTM! Effective simplification of keyboard shortcut rendering.

The migration replaces the previous pattern of mapping over shortcut arrays with a single Kbd component that renders the joined string. The hover and active state animations are preserved through the className prop, and the logic is cleaner and more maintainable.

Also applies to: 134-142

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

14-14: LGTM! Successful migration with simplified styling.

The migration to the centralized Kbd component is well-executed. The kbdClass has been appropriately simplified to retain only the transition and interactive effects (hover/active shadows), while the base keyboard styling is now handled by the Kbd component itself. This promotes consistency and reduces duplication.

Also applies to: 131-167

apps/desktop/src/components/main/body/shared.tsx (1)

4-4: LGTM! Clean consolidation of keyboard shortcut rendering.

The change successfully removes the KbdGroup wrapper and consolidates the shortcut display into a single Kbd component with an interpolated string. This aligns with the PR's centralization objectives and simplifies the component structure.

Also applies to: 152-152

apps/web/src/components/search.tsx (1)

21-21: LGTM! Excellent simplification across all search variants.

The migration successfully replaces native <kbd> elements and their associated styling complexity with the centralized Kbd component across all three search trigger variants (sidebar, header, and default). This significantly reduces code duplication and ensures consistent keyboard shortcut rendering throughout the web application.

Also applies to: 115-124, 160-169, 189-189

@yujonglee yujonglee self-requested a review December 23, 2025 02:40
Copy link
Contributor

yujonglee commented Dec 23, 2025

Merge activity

  • Dec 23, 2:40 AM UTC: The merge label 'merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 23, 2:40 AM UTC: yujonglee added this pull request to the Graphite merge queue.
  • Dec 23, 2:41 AM UTC: CI is running for this pull request on a draft pull request (#2477) due to your merge queue CI optimization settings.
  • Dec 23, 2:41 AM UTC: Merged by the Graphite merge queue via draft PR: #2477.

graphite-app bot pushed a commit that referenced this pull request Dec 23, 2025
## Description

- Updated Kbd component styles and markup
- Migrated Kbd component to a centralized implementation
@graphite-app graphite-app bot closed this Dec 23, 2025
@graphite-app graphite-app bot removed the merge label Dec 23, 2025
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.

3 participants