Skip to content

Keep Canvas completion reminders until the pane is visible - #785

Merged
onevcat merged 8 commits into
mainfrom
fix/canvas-completion-viewport
Sep 8, 2026
Merged

Keep Canvas completion reminders until the pane is visible#785
onevcat merged 8 commits into
mainfrom
fix/canvas-completion-viewport

Conversation

@onevcat

@onevcat onevcat commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

A Canvas pane can keep keyboard focus after panning moves its card completely outside the viewport. Such a pane must retain its unread Done state until it returns to view.

Continue the Canvas acknowledgement implementation from #783, with its original commit preserved. Require the focused terminal's bounds to intersect its AppKit visible rectangle, in addition to the original key/visible-window and actual-responder checks. Partial visibility is sufficient. Keep navigation, broadcast input, and worktree-scoped notification behavior unchanged.

The completion-read prerequisite #781 is merged. This branch includes that implementation, and the combined behavior was tested locally.

Fixes #779.

Validation

  • Reproduced the bug against the original Acknowledge viewed Canvas panes after Agent Island navigation #783 implementation combined with Keep agent completions unread until their pane is viewed #781: moving the focused pane outside the viewport changed Working to Idle instead of Done.
  • Confirmed that visibleRect can be nonempty but outside the terminal bounds; the predicate uses rectangle intersection.
  • Final combined Xcode tests passed (83 test methods), including offscreen/returned panes, partial intersection, 0.5x/1x/2x ancestor scaling, zero area, logical-only focus, inactive windows, Blocked state, normal-mode viewing, Active Agents, and Island.
  • make check passed, including 146 script tests.
  • make build-app passed.
  • git diff --check passed.
  • Native AppKit tests use actual first-responder transitions and view geometry; no live-agent GUI session was manually exercised.

Original contribution

Thanks to @SunChJ (SamsonCJ) for the Canvas implementation in #780, resubmitted as #783. Original commit 3635ff56d1f001e70fc7422ab8666da8523b6883 is retained unchanged as an ancestor of this branch. This follow-up adds viewport coverage and combined behavior tests. Thanks to @onevtail for reporting the offscreen case.

Use a merge commit to retain the original contribution in repository history.

@onevcat
onevcat merged commit 23998e3 into main Sep 8, 2026
1 check passed
@onevcat
onevcat deleted the fix/canvas-completion-viewport branch September 8, 2026 12:18
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.

Canvas: Agent Island Done reminder remains after clicking and viewing the target pane

3 participants