Skip to content

test(desktop): add tool stall state preview harness#8471

Draft
eulicesl wants to merge 3 commits into
BasedHardware:mainfrom
eulicesl:draft/stall-ui-harness
Draft

test(desktop): add tool stall state preview harness#8471
eulicesl wants to merge 3 commits into
BasedHardware:mainfrom
eulicesl:draft/stall-ui-harness

Conversation

@eulicesl

@eulicesl eulicesl commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a DEBUG-only SwiftUI preview for desktop chat tool-call states.
  • Forces representative .running, .slow, .stalled, .failed, and .completed tool rows without requiring a live bridge.
  • Includes a stalled group with the Cancel banner wired to a no-op preview action.

Why draft

This is the first visual harness step from PR #7555 follow-up work. It is intentionally draft because the stronger follow-up is still a fake-bridge/dev runtime path that can drive the full chat surface end-to-end.

Verification

  • xcrun swift build -c debug --package-path desktop/macos/Desktop -> build complete
  • python3 .github/scripts/check-desktop-changelog.py --base upstream/main --head HEAD -> Desktop changelog fragment found
  • git diff --check -> clean

Not included yet

  • No fake bridge.
  • No automated screenshot capture.
  • No runtime path for forcing stall states outside SwiftUI previews.

Review in cubic

Copilot AI 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.

Pull request overview

Adds a DEBUG-only SwiftUI preview harness to visually exercise desktop chat tool-call row states (running/slow/stalled/failed/completed) without requiring a live agent bridge, plus an unreleased desktop changelog fragment.

Changes:

  • Added a #Preview("Tool call stall states") block in ChatPage.swift that renders representative ToolCallsGroup configurations.
  • Added an unreleased desktop changelog fragment describing the preview harness.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
desktop/macos/Desktop/Sources/MainWindow/Pages/ChatPage.swift Adds a DEBUG-only SwiftUI preview to render tool-call UI states in a stable, offline harness.
desktop/macos/changelog/unreleased/tool-stall-preview-harness.json Adds an unreleased changelog entry describing the change (currently framed as developer-only).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread desktop/macos/changelog/unreleased/tool-stall-preview-harness.json Outdated
@Git-on-my-level

Copy link
Copy Markdown
Collaborator

Nice foundation for the stall-state preview harness. The #Preview is well-constructed — it exercises all five ToolCallStatus cases through the real ToolCallsGroup/ChatContentBlock.toolCall path, the types line up with ChatProvider, and the #if DEBUG gating keeps it out of release builds. Changelog fragment is in place and passes the desktop changelog check. Good follow-up to the merged stall-detection work in #7555.

Since this is intentionally draft, no action needed from review yet — mark it ready when the runtime/fake-bridge follow-up lands or you're happy with this as a standalone step.

@eulicesl eulicesl added the no-changelog-needed Skip desktop changelog enforcement for internal-only changes label Jun 28, 2026
@Git-on-my-level

Copy link
Copy Markdown
Collaborator

Nice preview harness — this is a clean, well-scoped #if DEBUG addition that exercises the real ToolCallsGroup/ToolCallCard across all five ToolCallStatus states (running, slow, stalled, failed, completed) without touching any production path. I checked the type contracts against ChatProvider (ChatContentBlock.toolCall, ToolCallInput, ToolCallStatus) and everything resolves against main, so this should compile cleanly.

One small note: using onCancel: {} (non-nil) for the stalled group is the right call here — it keeps the banner visible in the preview while staying a safe no-op.

Makes sense as a draft while the fake-bridge / dev-runtime follow-up (#7555 thread) comes together. Nothing blocking on the harness itself — happy to review the stronger follow-up when it lands. Thanks @eulicesl!

@eulicesl

Copy link
Copy Markdown
Collaborator Author

Follow-up check: the Copilot changelog thread is addressed. The DEBUG-only preview harness changelog fragment was removed, no-changelog-needed is applied, lint is green, and there are no unresolved review threads. Keeping this draft for the stronger fake-bridge/runtime harness decision.

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

Labels

no-changelog-needed Skip desktop changelog enforcement for internal-only changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants