-
Notifications
You must be signed in to change notification settings - Fork 50
feat(zoom): add zoom control commands to command menu #3135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,9 @@ export const SHORTCUTS = { | |
| SUBMIT_BLUR: "mod+enter", | ||
| SWITCH_MESSAGING_MODE: "mod+s", | ||
| RELOAD_WINDOW: "mod+shift+r", | ||
| ZOOM_IN: "mod+=", | ||
| ZOOM_OUT: "mod+-", | ||
| RESET_ZOOM: "mod+0", | ||
|
Comment on lines
+29
to
+31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } as const; | ||
|
|
||
| export type ShortcutCategory = "general" | "navigation" | "panels" | "editor"; | ||
|
|
@@ -256,6 +259,8 @@ function formatKey(key: string): string { | |
| if (k === ",") return ","; | ||
| if (k === "[") return "["; | ||
| if (k === "]") return "]"; | ||
| if (k === "=") return "+"; | ||
| if (k === "-") return "-"; | ||
| if (k === "tab") return "Tab"; | ||
| return k.toUpperCase(); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
viewshadows the outeruseAppView()resultThe local
const view: Command[]declared inside thecommandSectionsuseMemo uses the same name as the component-levelconst view = useAppView()at line 137. There is no actual bug today (the outerviewis consumed before the useMemo viareviewTaskId), but any future edit inside this closure that mistakenly writesview.typeinstead ofreviewTaskIdwill silently read theCommand[]array rather than the router view. A distinct name likeviewCommandsavoids the trap entirely.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!