Skip to content

fix: report tool-card clipboard failures and stale copy feedback - #73

Merged
johnnyhuy merged 1 commit into
mainfrom
agent/issue-72-tool-copy-feedback
Nov 14, 2026
Merged

johnnyhuy merged 1 commit into
mainfrom
agent/issue-72-tool-copy-feedback

Conversation

@johnnyhuy

@johnnyhuy johnnyhuy commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Tool-card input and output Copy buttons now report pending operations and clipboard failures, with a retry message that stays visible when the section is closed. New streamed text clears previous feedback, and delayed responses from superseded copy attempts cannot overwrite feedback for the current text.

Part of #2.
Closes #72.

Verification

  • bun install --frozen-lockfile passed.
  • mise exec -- bun run lint passed.
  • mise exec -- bun run typecheck passed.
  • mise exec -- bun run test:unit passed, 94 tests across 10 files.
  • mise exec -- bun run test:integration passed, 99 tests across 13 files.
  • mise run build passed, including the production bundle.
  • git diff --check passed.

Proof

$ mise exec -- bun run test:unit
 Test Files  10 passed (10)
      Tests  94 passed (94)

$ mise exec -- bun run test:integration
 Test Files  13 passed (13)
      Tests  99 passed (99)

$ mise exec -- bun run test:e2e
 Error: Library not loaded: @rpath/Electron Framework.framework/Electron Framework
 Error: Electron failed to install correctly
 Test Files  7 failed (7)
      Tests  59 skipped (59)

Local app launch and screenshot capture are blocked by the incomplete Electron runtime installation. Hosted macOS Playwright capture succeeded on commit fcbcff2, with every Electron test passing.

$ mise run test:e2e  # hosted macOS
 tests/e2e/tool-preview.test.ts (5 tests) passed
 Test Files  7 passed (7)
      Tests  59 passed (59)

The artefact contains four new PNGs under Users/runner/work/pidex/pidex/test-results/tool-preview/.

  • tool-copy-input-failed.png shows the input retry message below a closed Input section at the native desktop size.
  • tool-copy-output-failed.png shows the output retry message with both sections closed.
  • tool-copy-input-failed-narrow.png and tool-copy-output-failed-narrow.png show those messages at the native 900 by 600 minimum window size.

All four screenshots were downloaded, visually reviewed and copied to local .tmp/proof/. The messages and Copy buttons remain readable at both window sizes. No scratch captures are committed. Inline image upload is blocked because the browser access host is unavailable; the screenshots are uploaded through the existing CI artefact workflow and linked above.

New component coverage

  • reports a failed %s copy while collapsed and allows retrying the complete text, for input and output, including diff input and long output.
  • explains a missing clipboard API and keeps input feedback independent of output.
  • announces pending copying and prevents repeated writes until it settles.
  • ignores a superseded clipboard %s after streamed output changes, for success and rejection.
  • clears previous feedback on text changes and cancels the previous success timeout.

The new Electron cases deny input and output clipboard writes, activate Copy using the keyboard, capture desktop and native minimum-window failure states, then restore the real clipboard and verify the exact complete text on retry. A failed clipboard write is simulated only inside the test, without a production flag or API change.

Copy feedback is transient and resets when a transcript row is recycled. A pending clipboard write cannot be cancelled, so changing output invalidates its feedback rather than claiming the newer text was copied. This slice leaves the parent open for remaining tool-card work.

@johnnyhuy
johnnyhuy marked this pull request as ready for review November 14, 2026 11:37
@johnnyhuy
johnnyhuy merged commit 6da2714 into main Nov 14, 2026
15 checks passed
@johnnyhuy
johnnyhuy deleted the agent/issue-72-tool-copy-feedback branch November 14, 2026 11:38
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.

Report tool-card clipboard failures and clear stale copy feedback

1 participant