Skip to content

fix(chat): keep focus and counts honest in message parts and activity - #146

Open
pratikbuilds wants to merge 1 commit into
corbitsdev:mainfrom
pratikbuilds:claude/i142-message-activity-a51087
Open

pratikbuilds wants to merge 1 commit into
corbitsdev:mainfrom
pratikbuilds:claude/i142-message-activity-a51087

Conversation

@pratikbuilds

Copy link
Copy Markdown
Collaborator

Summary

Focus and count fixes in MessageParts, ToolGroup and ActivityContent (findings 1, 10 and 11).

  • 1, MessageParts: focus leaving for the page or outside the parts now also clears the deferred decision watch, so a later parts update that records the decision no longer pulls focus back to the run's trigger. The window losing focus to another tab or window (!document.hasFocus()) keeps the watch, so a decision recorded meanwhile still hands focus to the run.
  • 10, ToolGroup: the live done count leaves out failed calls, so active, waiting, done and failed no longer overlap in the running and held headers (e.g. "Running 3 at once · 1 done · 1 failed").
  • 11, ActivityContent: when a new step pushes the focused step behind the latest-ten window, focus moves to the "Show N earlier steps" control instead of falling to the page.

Verification

  • bun run check
  • bunx playwright test for the message-parts, tool and activity specs
  • New unit tests in message-parts.test.tsx, tool.test.tsx and activity.test.tsx

Closes #142

Addresses findings 1, 10 and 11 of corbitsdev#142.

- 1, MessageParts: focus leaving for the page or outside now also clears
  the deferred decision watch, so a later `parts` update that records the
  decision no longer pulls focus back to the run's trigger. The window
  losing focus to another tab or window keeps the watch, so a decision
  recorded meanwhile still hands focus to the run.
- 10, ToolGroup: the live "done" count leaves out failed calls, so active,
  waiting, done and failed no longer overlap in the `running` or `held`
  header (e.g. "Running 3 at once · 1 done · 1 failed").
- 11, ActivityContent: when a new step slides the step holding focus
  behind the latest-ten window, focus moves to the "Show N earlier steps"
  control instead of falling to the page.
@corbits-triage

corbits-triage Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

Notes:

  • added code matches a code pattern: src/ui/tool-group.tsx:237 Nested ternary; use if statements or a lookup.

@TheGreatAxios TheGreatAxios left a comment

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.

Review · Approve

Clears the deferred decision focus watch in MessageParts when focus leaves for the page or outside while the document retains focus, excludes failed tool calls from the live done count in ToolGroup, and moves focus to the "Show N earlier steps" control in ActivityContent when streaming steps push the focused step out of the ten-step window.

No findings.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow-ups from the conversation PR review

2 participants