Skip to content

fix (desktop): new workspace cmd + n#706

Merged
AviPeltz merged 1 commit intomainfrom
cmdn-broke
Jan 10, 2026
Merged

fix (desktop): new workspace cmd + n#706
AviPeltz merged 1 commit intomainfrom
cmdn-broke

Conversation

@AviPeltz
Copy link
Copy Markdown
Collaborator

@AviPeltz AviPeltz commented Jan 10, 2026

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

  • New Features
    • Added keyboard shortcut support to open the New Workspace modal

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 10, 2026

📝 Walkthrough

Walkthrough

This PR wires a keyboard shortcut in the main desktop screen to trigger the New Workspace modal. It imports the useOpenNewWorkspaceModal hook, creates a handler function, and binds it to the NEW_WORKSPACE hotkey in the hotkeys dependency configuration.

Changes

Cohort / File(s) Change Summary
Hotkey Binding for New Workspace
apps/desktop/src/renderer/screens/main/index.tsx
Added import of useOpenNewWorkspaceModal hook, created local handler function, and bound it to the NEW_WORKSPACE hotkey with handler included in dependency array.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

Suggested reviewers

  • CharlieHelps

Poem

🐰✨ A rabbit hops with glee,

NEW_WORKSPACE hotkey set free,

Bind the handler, wire it tight,

Opening modals at keyboard's might! 🚀

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description uses the correct template structure but lacks implementation details. Only the 'Bug fix' checkbox is marked; Description, Related Issues, Testing, and other sections remain empty. Fill in the Description field to explain what the bug fix does. Add Related Issues if applicable. Provide Testing details to describe verification steps for the Cmd+N keyboard shortcut functionality.
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 clearly describes the main change: adding a keyboard shortcut (Cmd+N) to open a new workspace modal in the desktop application.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

🧹 Nitpick comments (1)
apps/desktop/src/renderer/screens/main/index.tsx (1)

169-171: LGTM!

The hotkey binding correctly wires the NEW_WORKSPACE hotkey to open the modal, with proper dependency tracking. The implementation follows existing patterns in this file.

♻️ Optional: Simplify callback

The arrow function wrapper is unnecessary since openNewWorkspaceModal can be passed directly:

-useAppHotkey("NEW_WORKSPACE", () => openNewWorkspaceModal(), undefined, [
+useAppHotkey("NEW_WORKSPACE", openNewWorkspaceModal, undefined, [
   openNewWorkspaceModal,
 ]);

This is purely stylistic—the current implementation works correctly.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 09b1687 and ea84e63.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/screens/main/index.tsx
🧰 Additional context used
📓 Path-based instructions (6)
apps/desktop/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)

apps/desktop/**/*.{ts,tsx}: For Electron interprocess communication, ALWAYS use tRPC as defined in src/lib/trpc
Use alias as defined in tsconfig.json when possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary.
For tRPC subscriptions with trpc-electron, ALWAYS use the observable pattern from @trpc/server/observable instead of async generators, as the library explicitly checks isObservable(result) and throws an error otherwise

Files:

  • apps/desktop/src/renderer/screens/main/index.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use object parameters for functions with 2+ parameters instead of positional arguments
Functions with 2+ parameters should accept a single params object with named properties for self-documentation and extensibility
Use prefixed console logging with context pattern: [domain/operation] message
Extract magic numbers and hardcoded values to named constants at module top
Use lookup objects/maps instead of repeated if (type === ...) conditionals
Avoid using any type - maintain type safety in TypeScript code
Never swallow errors silently - at minimum log them with context
Import from concrete files directly when possible - avoid barrel file abuse that creates circular dependencies
Avoid deep nesting (4+ levels) - use early returns, extract functions, and invert conditions
Use named properties in options objects instead of boolean parameters to avoid boolean blindness

Files:

  • apps/desktop/src/renderer/screens/main/index.tsx
apps/desktop/src/renderer/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never import Node.js modules (fs, path, os, net) in renderer process or shared code - they are externalized for browser compatibility

Files:

  • apps/desktop/src/renderer/screens/main/index.tsx
**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

One component per file - do not create multi-component files

Files:

  • apps/desktop/src/renderer/screens/main/index.tsx
apps/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Drizzle ORM for all database operations - never use raw SQL

Files:

  • apps/desktop/src/renderer/screens/main/index.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Biome for formatting and linting - run at root level with bun run lint:fix or biome check --write

Files:

  • apps/desktop/src/renderer/screens/main/index.tsx
🧬 Code graph analysis (1)
apps/desktop/src/renderer/screens/main/index.tsx (2)
apps/desktop/src/renderer/stores/new-workspace-modal.ts (1)
  • useOpenNewWorkspaceModal (32-33)
apps/desktop/src/renderer/stores/hotkeys/store.ts (1)
  • useAppHotkey (316-348)
⏰ 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). (1)
  • GitHub Check: Build
🔇 Additional comments (2)
apps/desktop/src/renderer/screens/main/index.tsx (2)

16-16: LGTM!

The import correctly brings in the Zustand store hook for opening the New Workspace modal, following the project's state management patterns.


84-84: LGTM!

The hook invocation correctly extracts the modal open function from the Zustand store, consistent with other hook usage patterns in this component.

@AviPeltz AviPeltz merged commit ab27be9 into main Jan 10, 2026
5 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app

Thank you for your contribution! 🎉

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