Skip to content

fix(web): image annotation shortcuts ignore extra modifiers and work with CapsLock - #49534

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-image-annotation-shortcut-modifiers
Dec 5, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-image-annotation-shortcut-modifiers

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

When drawing on an image, extra-modifier chords fired shortcuts they should ignore instead of staying no-ops: Ctrl+Alt+Z (Cmd+Option+Z on Mac) and Ctrl+Meta+Z undid the last mark, Ctrl/Alt/Meta+Enter saved and closed the editor, and Meta+E (Ctrl+E on Mac) switched tools. With CapsLock on, the D/E/A/T tool keys did nothing instead of switching tools.

Change

In apps/web/src/components/chat/ImageAnnotationOverlay.tsx, undo now requires only the platform modifier (!otherMod && !event.altKey && !event.shiftKey), Enter and tool shortcuts return early when any modifier is held, and tool keys match in lowercase so CapsLock (shiftKey === false) works while Shift+<key> stays ignored.

Scope

Bug fix for wrong shortcut handling in ImageAnnotationOverlay (small, obvious defect needing no separate issue).

Verification

Setup: Linux x86_64 (Ubuntu 26.04), Light, 1280×800, T3 Browser panel on unseeded dev state (T3CODE_DEV_SEED=0, hostname Test machine).

Steps: Attach demo-sample.png → preview → Draw → Red → add Sample label → d → test Ctrl+Alt+Z, plain Ctrl+Z, Meta+E, CapsLock A, and re-add Sample label + caption click + Ctrl+Enter/Alt+Enter/Meta+Enter.

Before (78a87e091f95) After (0e02a3a4d5ba)
Ctrl+Enter commits and exits annotation mode
Ctrl+Enter commits and exits annotation mode
Ctrl+Enter keeps annotation mode open
Ctrl+Enter keeps annotation mode open
Ctrl+Alt+Z undoes Sample label and disables Undo
Ctrl+Alt+Z undoes Sample label and disables Undo
Ctrl+Alt+Z keeps Sample label and Undo enabled
Ctrl+Alt+Z keeps Sample label and Undo enabled

On 0e02a3a4d5ba, Alt+Enter, Meta+Enter, Ctrl+Meta+Z, Meta+E, and Shift+E stayed ignored, CapsLock A selected Arrow, and plain e/a/t/d, Ctrl+Z, and Enter worked. Tests kept: none.

Links

Not shown

  • macOS/Windows manual runs (isMacPlatform branch checked by reading the code).
CapsLock and opposite-modifier captures, automated checks, and ephemeral test proof
Before (78a87e091f95) After (0e02a3a4d5ba)
CapsLock A leaves Draw active
CapsLock A leaves Draw active
CapsLock A switches the active tool to Arrow
CapsLock A switches the active tool to Arrow
Meta+E switches Draw to Erase
Meta+E switches Draw to Erase
Meta+E leaves Draw active
Meta+E leaves Draw active

A temporary browser test failed on base 78a87e091f95 (1 failed / 2 passed) and passed on the same production diff (3 passed); it was dropped before final commit (Tests kept: none per docs/internals/15_testing.md).

Existing owning browser suite on 0e02a3a4d5ba:

vp env exec --node 26.13.1 -- vp test run apps/web/src/components/chat/ExpandedImageDialog.browser.test.tsx
 ✓ ExpandedImageDialog (2)
   ✓ Enter saves after using the canvas following a toolbar click 431ms
   ✓ picking a color swatch while typing a text label recolors the preview and saved image 400ms
 Test Files  1 passed (1)
      Tests  2 passed (2)

vp env exec --node 26.13.1 -- vp run check:changed 78a87e091f95:

check:changed summary
  pass  format  0.4s
  pass  lint  0.8s
  pass  knip  7.0s
  pass  i18n  16.0s
  pass  typecheck (2 packages)  5.5s
  pass  react compiler (1 files)  1.7s

Generated with Gemini 4 Neon in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Dec 5, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 0e02a3a

Macroscope's review found this PR approvable — Image annotation shortcuts now reject extra modifiers and recognize tool keys with CapsLock enabled. The change is limited to keyboard handling and leaves image saving and product defaults unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The image annotation overlay changes keyboard handling for undo, tool selection, and Done. Undo now requires only the platform’s primary modifier. Tool shortcuts ignore modified key events and are case-insensitive. Enter invokes Done when a button is not focused, even when Shift is held.

Changes: Image annotation keyboard shortcuts

Layer / File(s) Summary
Keyboard shortcut handling
apps/web/src/components/chat/ImageAnnotationOverlay.tsx
Undo requires the platform’s primary modifier without other modifiers. Tool shortcuts are case-insensitive and ignored when any modifier is held. Enter invokes Done unless a button is focused; Shift no longer suppresses it.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: maria-rcks, chenxin-yan

Merge Risk: Minimal · up to 4dcce

Merge Risk: ⚪ Minimal · up to 4dcce

This change narrows the image annotation shortcuts so that chords with extra modifiers are ignored. Tool keys now match case-insensitively. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title uses the conventional commit form and names the main change: image annotation shortcuts now ignore extra modifiers and work with CapsLock. The changeset matches this. The title is specific a…
Description check Passed The description follows the template well. It has a Problem section with the broken chords and CapsLock behavior, a Change section that names the file and the new guard logic, and a Scope section that…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title uses the conventional commit form and names the main change: image annotation shortcuts now ignore extra modifiers and work with CapsLock. The changeset matches this. The title is specific and concise, and it covers both the modifier fix and the CapsLock fix that the PR description and objectives describe.

Full details: Description check

Explanation

The description follows the template well. It has a Problem section with the broken chords and CapsLock behavior, a Change section that names the file and the new guard logic, and a Scope section that calls this a bug fix and explains why no issue is needed. The Verification section gives concrete steps, before/after screenshots, a browser test run, and check results, and it states what was not verified (macOS and Windows). It does not link a maintainer request, which is not required here. The template's agent attribution line is present at the end.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5470207 and 0e02a3a.

Files selected for processing: 1

  • apps/web/src/components/chat/ImageAnnotationOverlay.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 5, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Environment: Real web app, Linux headless Chromium, 1280x800, light theme. scenarios:prove started isolated servers and fresh databases for each commit; t3.project and t3.thread created synthetic data with the Replay (dev) provider. Real app screenshots and browser recordings were visually inspected.

Steps: On both commits: attach the same synthetic sample.png to a replay-seeded thread; open preview and Draw on image; draw a stroke and send Ctrl+Alt+Z; reset and repeat with Ctrl+Meta+Z; verify plain Ctrl+Z; select Draw and send Meta+E; select Erase and send key=A with shiftKey=false; select Draw and send Shift+E; draw a stroke, click the filename caption and send Ctrl+Enter. If annotation remains open, send plain Enter to save. KeyboardEvents were dispatched to the focused real app element with the reported modifier flags; drawing and caption clicks used real browser input.

Scenario: Annotation shortcuts respect modifiers and uppercase CapsLock key values

Proven: the scenario fails on base 54702074a9 and passes on head 4dcceb21da.

Base 54702074a9 Head 4dcceb21da
Result ❌ failed
ASSERTION_FAILED: expected {"ctrlAltKeepsStroke":0,"ctrlMetaKeepsStroke":0,"plainUndoRemovesStroke":0,"metaELeavesDraw":"Erase a stroke (E)","capsASelectsArrow":["Erase a stroke (E)"],"shiftELeavesDraw":["Draw freehand (D)"],"ctrlEnterKeepsAnnotation":false} to equal {"ctrlAltKeepsStroke":1,"ctrlMetaKeepsStroke":1,"plainUndoRemovesStroke":0,"metaELeavesDraw":"Draw freehand (D)","capsASelectsArrow":["Draw an arrow (A)"],"shiftELeavesDraw":["Draw freehand (D)"],"ctrlEnterKeepsAnnotation":true}
✅ passed
ctrl alt z keeps stroke Base 54702074a9: ctrl alt z keeps stroke Head 4dcceb21da: ctrl alt z keeps stroke
ctrl meta z keeps stroke Base 54702074a9: ctrl meta z keeps stroke Head 4dcceb21da: ctrl meta z keeps stroke
meta e keeps draw Base 54702074a9: meta e keeps draw Head 4dcceb21da: meta e keeps draw
capslock a selects arrow Base 54702074a9: capslock a selects arrow Head 4dcceb21da: capslock a selects arrow
ctrl enter keeps annotation Base 54702074a9: ctrl enter keeps annotation Head 4dcceb21da: ctrl enter keeps annotation
plain enter saves Base 54702074a9: plain enter saves Head 4dcceb21da: plain enter saves
failure Base 54702074a9: failure
Recording Before After
Same scripted interaction Before recording After recording

Scenario source

Not shown:

  • macOS Cmd+Z behavior and Windows were not run; captures cover the Linux web client.
  • A real latched CapsLock state was not available in headless Chromium; uppercase A with shiftKey=false exercised the reported CapsLock key-value path. Uppercase D/E/T were not separately exercised.
  • Alt+Enter and Meta+Enter were not separately exercised; the reproduced modified-Enter case was Ctrl+Enter.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 5, 2026
@juliusmarminge
juliusmarminge merged commit 19b56b9 into pingdotgg:main Dec 5, 2026
57 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 5, 2026
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Dec 6, 2026
**v0.1.15-nightly.20261205.5786** · 61 changes from 12 contributors

- **Large file previews.** Load remote files that exceed the automatic preview limit.
- **Project-specific MCP servers.** Import configurations with the same name and command but different credentials or headers.
- **GitHub issue forms.** Use issue templates with numeric or boolean options and empty optional fields.
- **Cursor text generation.** Generate commit messages, branch names, and thread titles with Cursor again.
- **Workflow reasons.** Unsent workflow question reasons now survive an environment reconnect.
- **Shared worktree protection.** Deleting a thread no longer removes a worktree another thread started using during confirmation.

### Plus 53 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(server): stopping Codex during startup no longer loses its accepted turn by @StiensWout in pingdotgg/t3code#49435
* fix(workflows): open invoked runs from older workflows by @UtkarshUsername in pingdotgg/t3code#49437
* fix(web): omit inverted line range on empty file reads by @only21mil in pingdotgg/t3code#49452
* perf(server): t3 --version no longer loads the whole CLI by @juliusmarminge in pingdotgg/t3code#49461
* fix(preview): let users load oversized files by @Yash-Singh1 in pingdotgg/t3code#49470
* fix(mobile): a saved draft waits for a project choice when its project is removed by @StiensWout in pingdotgg/t3code#49455
* fix(client-runtime): file previews refresh when a background command finishes late by @StiensWout in pingdotgg/t3code#49458
* fix(server): fixed-time scheduled tasks interrupted before dispatch no longer skip the slot by @taogezhizun in pingdotgg/t3code#49417
* perf(web): reuse the read-only file preview cache key by @UtkarshUsername in pingdotgg/t3code#49464
* fix(shared): thread find no longer matches across line breaks in user HTML by @only21mil in pingdotgg/t3code#49449
* fix(web): ignore Shift and Alt on prompt stash delete shortcut by @only21mil in pingdotgg/t3code#49473
* fix(server): failed updates no longer lose recent data when the database is symlinked by @StiensWout in pingdotgg/t3code#49459
* fix(shared): relative file links with ../ resolve to the normalized path by @juliusmarminge in pingdotgg/t3code#49479
* fix(test): VcsStatusBroadcaster checkout test no longer flakes when HEAD.lock events arrive apart by @t3dotgg in pingdotgg/t3code#49494
* fix(server): fresh-session task waits while its previous occurrence awaits background work by @juliusmarminge in pingdotgg/t3code#49490
* fix(server): finish force stop when the target run settles by @UtkarshUsername in pingdotgg/t3code#49486
* perf(client-runtime): recording a thread open no longer replaces quiet thread shells by @shivamhwp in pingdotgg/t3code#49475
* perf(server): Read saved previews for live workflow lists by @UtkarshUsername in pingdotgg/t3code#49484
* fix(server): commit on new branch waits for a multi-repository worktree thread by @StiensWout in pingdotgg/t3code#49482
* fix(web): only capture keybindings while recording a SnapShot shortcut by @only21mil in pingdotgg/t3code#49489
* fix(web): ignore extra modifiers on workflow editor save shortcut by @only21mil in pingdotgg/t3code#49506
* fix(server): SSH readiness check retries after an interrupted response by @StiensWout in pingdotgg/t3code#49512
* fix(web): importing an MCP server keeps other projects' configurations available by @StiensWout in pingdotgg/t3code#49516
* fix(web): ignore Shift, Alt, and IME composition on spreadsheet copy by @only21mil in pingdotgg/t3code#49520
* fix(web): Word previews handle malformed links and spaced internal parts by @only21mil in pingdotgg/t3code#49519
* fix(shared): byte sizes just under the next unit no longer read "1024 KB" by @dev-dami in pingdotgg/t3code#49524
* fix(server): connecting during a checkout keeps the current Git status by @StiensWout in pingdotgg/t3code#49526
* fix(server): keep content search highlights and whole-word matches accurate on non-UTF-8 lines by @only21mil in pingdotgg/t3code#49535
* fix(web): image annotation shortcuts ignore extra modifiers and work with CapsLock by @only21mil in pingdotgg/t3code#49534
* fix(web): show the linked workflow run in All runs by @UtkarshUsername in pingdotgg/t3code#49543
* fix(provider-core): surface Codex managed requirements rejections for granular approval policies by @vibecodooor in pingdotgg/t3code#49540
* fix(web,mobile): choosing a question option sets an image-only answer aside by @juliusmarminge in pingdotgg/t3code#49517
* fix(server): MCP PR review comments preserve the old path on renamed files by @only21mil in pingdotgg/t3code#49557
* fix(server): creating a missing workflow helper makes its workflow load by @StiensWout in pingdotgg/t3code#49562
* fix(github): accept YAML scalars and empty keys in issue templates by @only21mil in pingdotgg/t3code#49558
* fix(server): a stalled cancellation cleanup no longer holds up other workflows' timeouts by @StiensWout in pingdotgg/t3code#49561
* fix(mobile): Usage cache savings ratio uses the app language's decimal separator by @tiliakoos in pingdotgg/t3code#49560
* fix(server): restarting after a pool place is given back keeps the requested resume by @StiensWout in pingdotgg/t3code#49567
* fix(server): retrying a failed project action save now saves it by @StiensWout in pingdotgg/t3code#49573
* fix(server): client connections no longer start Xwayland on Linux by @juliusmarminge in pingdotgg/t3code#49596
* fix(mobile-nitro): Android draft screen matches React Native's header, font and composer by @juliusmarminge in pingdotgg/t3code#49441
* fix(workflows): an agent step's turn no longer waits on its issue tracker by @Kamo2323 in pingdotgg/t3code#49582
* fix(mobile-nitro): a list shows its new rows at once when all of them are replaced on Android by @juliusmarminge in pingdotgg/t3code#49454
* fix(mobile-nitro): Android text fields are readable in dark mode by @juliusmarminge in pingdotgg/t3code#49466
* fix(web): unsent workflow reasons survive an environment reconnect by @StiensWout in pingdotgg/t3code#49603
* fix(server): service install after uninstall no longer refuses as a downgrade by @juliusmarminge in pingdotgg/t3code#49611
* fix(web): deleting a thread keeps a worktree another thread started using by @StiensWout in pingdotgg/t3code#49599
* fix(web,mobile): voice model benchmarks use the app language's decimal separator by @tiliakoos in pingdotgg/t3code#49581
* fix(cursor): Cursor text generation uses Composer 2.5 instead of the retired Composer 2 by @juliusmarminge in pingdotgg/t3code#49614
* fix(mobile-nitro): iOS text inputs use the app theme's colors by @juliusmarminge in pingdotgg/t3code#49509
* fix(mobile-nitro): Android survives Activity recreation (blank screen, colour scheme crash) by @juliusmarminge in pingdotgg/t3code#49572
* fix(mobile-nitro): a tap on a markdown link opens it, and thread links open their thread by @juliusmarminge in pingdotgg/t3code#49546
* fix(server): device access error says the setting is in desktop or web settings by @juliusmarminge in pingdotgg/t3code#49616
* fix(server): OpenCode commands no longer stay running after a failed status check by @StiensWout in pingdotgg/t3code#49602
* feat(mobile-nitro): user message links, thread chips and mentions match React Native by @juliusmarminge in pingdotgg/t3code#49569
* fix(mobile-nitro): Android markdown draws chips, mentions and quoted links like iOS by @juliusmarminge in pingdotgg/t3code#49590
* fix(mobile): guide file links open hidden test files by @StiensWout in pingdotgg/t3code#49600
* fix(server): workflows retry an engine that did not start after a reload by @StiensWout in pingdotgg/t3code#49563
* fix(mobile-nitro): choosing another project drops the draft's pull request by @StiensWout in pingdotgg/t3code#49597
* fix(mobile): pull request diffs no longer mix revisions after reconnecting by @StiensWout in pingdotgg/t3code#49607

## New Contributors
* @dev-dami made their first contribution in pingdotgg/t3code#49524
* @vibecodooor made their first contribution in pingdotgg/t3code#49540

**Full Changelog**: pingdotgg/t3code@v0.1.14-nightly.20261205.5772...v0.1.15-nightly.20261205.5786

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.15-nightly.20261205.5786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants