Skip to content

feat(zoom): add zoom control commands to command menu#3135

Open
MattPua wants to merge 1 commit into
mainfrom
posthog-code/add-zoom-controls-to-search-command-bar
Open

feat(zoom): add zoom control commands to command menu#3135
MattPua wants to merge 1 commit into
mainfrom
posthog-code/add-zoom-controls-to-search-command-bar

Conversation

@MattPua

@MattPua MattPua commented Jul 3, 2026

Copy link
Copy Markdown
Member

Problem

Zoom in/out/reset only existed in the native View menu, not in the command palette.

Changes

CleanShot 2026-07-03 at 16 00 18@2x
  • New "View" section in the command palette with Zoom In (⌘+), Zoom Out (⌘-), Reset Zoom (⌘0)
  • Reuses the existing applyZoom from menu.ts, exposed via IMainWindow + os tRPC router

How did you test this?

Typecheck and lint on all touched packages.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

@trunk-io

trunk-io Bot commented Jul 3, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit fc93d85.

@MattPua MattPua marked this pull request as ready for review July 3, 2026 20:02
@MattPua MattPua requested a review from a team July 3, 2026 20:02
@greptile-apps

greptile-apps Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(zoom): add zoom control commands to..." | Re-trigger Greptile

Comment on lines +329 to +366
const view: Command[] = [
{
id: "zoom-in",
label: "Zoom in",
keywords: "zoom increase larger",
icon: <ZoomInIcon className="h-3 w-3 text-gray-11" />,
action: "zoom-in",
shortcut: SHORTCUTS.ZOOM_IN,
onRun: () =>
void resolveService<HostTrpcClient>(
HOST_TRPC_CLIENT,
).os.zoomIn.mutate(),
},
{
id: "zoom-out",
label: "Zoom out",
keywords: "zoom decrease smaller",
icon: <ZoomOutIcon className="h-3 w-3 text-gray-11" />,
action: "zoom-out",
shortcut: SHORTCUTS.ZOOM_OUT,
onRun: () =>
void resolveService<HostTrpcClient>(
HOST_TRPC_CLIENT,
).os.zoomOut.mutate(),
},
{
id: "zoom-reset",
label: "Reset zoom",
keywords: "zoom actual size default",
icon: <MagnifyingGlassIcon className="h-3 w-3 text-gray-11" />,
action: "zoom-reset",
shortcut: SHORTCUTS.RESET_ZOOM,
onRun: () =>
void resolveService<HostTrpcClient>(
HOST_TRPC_CLIENT,
).os.resetZoom.mutate(),
},
];

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.

P2 view shadows the outer useAppView() result

The local const view: Command[] declared inside the commandSections useMemo uses the same name as the component-level const view = useAppView() at line 137. There is no actual bug today (the outer view is consumed before the useMemo via reviewTaskId), but any future edit inside this closure that mistakenly writes view.type instead of reviewTaskId will silently read the Command[] array rather than the router view. A distinct name like viewCommands avoids 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!

Comment on lines +29 to +31
ZOOM_IN: "mod+=",
ZOOM_OUT: "mod+-",
RESET_ZOOM: "mod+0",

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.

P2 Zoom shortcuts not added to KEYBOARD_SHORTCUTS reference array

ZOOM_IN, ZOOM_OUT, and RESET_ZOOM are registered in SHORTCUTS and will display correctly in the command palette, but none of them are added to the KEYBOARD_SHORTCUTS array (line 45 onwards). That array drives the "Show keyboard shortcuts" sheet (mod+/), so users consulting that reference will have no indication the zoom shortcuts exist.

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