Skip to content

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

Description

@SunChJ

Problem

In Canvas mode, clicking an Agent Island Done attention card correctly navigates to and focuses the target pane, but the completion reminder does not disappear after the user views that pane in the active, visible Prowl window.

This is a Canvas follow-up to #777 and the read-state guards in #778 (currently open). The analysis below is based on the #778 implementation, not a claim that those guards have already shipped on main. The behavior was reported by the user; this issue's scope was refined through static code inspection, without a separate manual GUI reproduction.

Code path

  1. AgentIslandView sends .island(.entryTapped(id)); the app brings Prowl forward.
  2. RepositoriesFeature.reduceCore requests Canvas navigation to the entry's tab and calls terminalClient.focusSurface for the target surface.
  3. Canvas resolves the navigation request, selects the primary card, and moves the viewport/focus to it.
  4. With Keep agent completions unread until their pane is viewed #778, both detection-time read resolution and markAgentSeen require isViewedSurface(surfaceID).
  5. WorktreeTerminalState.isViewingWorktree() unconditionally returns false for isCanvasManaged, so Canvas can never satisfy that predicate, even after successful navigation and foreground viewing.
  6. The pane remains idle + seen == false, which projects as Done. islandAttentionEntries continues to include it.

Canvas is intentionally excluded from the normal viewing predicate because normal-mode window observers are torn down there and their cached flags may be stale. Simply removing the Canvas guard would risk reintroducing background auto-read behavior.

Expected behavior

After clicking a Done reminder, once the target pane is actually viewed in Canvas, acknowledge its completion and remove the Done attention card.

  • Require the Canvas window to be key and visible.
  • Require the target to be the focused pane of the primary card and visible in the Canvas viewport.
  • Keep reminders unread while the window is inactive/hidden/minimized, or while the target is not actually viewed.
  • Do not acknowledge other cards merely because they are visible, multi-selected, or receive broadcast input.
  • Clicking Blocked is not a dismissal: its reminder should remain until the agent leaves the blocked state.

Suggested direction

Provide Canvas-owned window activity and viewed-surface context to the terminal viewing predicate, keeping a single read policy for detection and focus acknowledgment. Avoid reusing normal-mode syncFocus directly: it also applies single-selected-tab surface activity, which does not match Canvas rendering.

Acceptance / regression coverage

  • Click Done from Canvas: the correct card/split is focused and brought into view; Done clears once viewed.
  • Perform navigation while the Canvas window remains inactive: Done stays unread.
  • Background, non-primary, off-viewport, and non-focused split completions remain unread.
  • Multi-selection and broadcast input do not clear unrelated reminders.
  • Blocked remains visible after clicking until its underlying state changes.
  • Entering/exiting Canvas and closing cards do not leave stale viewing context.
  • Normal-mode behavior from Keep agent completions unread until their pane is viewed #778 remains intact.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions