Skip to content

feat(chat): copy raw input and output from tool details - #1565

Merged
devswha merged 2 commits into
mainfrom
feat/tool-detail-copy
Oct 21, 2026
Merged

devswha merged 2 commits into
mainfrom
feat/tool-detail-copy

Conversation

@devswha

@devswha devswha commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Change

An opened tool call in Chat (a work row's detail) now labels its Input and Output (or Error). Each label has a quiet copy button at the end of its line, so you can take the call's raw data without selecting text out of a bounded box.

  • Input copies part.input exactly as the agent sent it, whitespace and trailing newline included. It never copies the diff, checklist, question card or command view drawn from it. If the input was omitted for size, the row keeps its "Arguments omitted (too large)" explanation and offers no input copy. An empty input shows a disabled copy.
  • Output copies the loaded whole output if it has loaded, otherwise the output on the page. That includes a todo call's raw answer, which the list view leaves out. The button's words say how much it copies:
    • Copy output: a complete inline output.
    • Copy partial output: a cut output whose rest has not loaded yet, and still after a failed load.
    • Copy whole output: once the rest has loaded through the existing "Show the whole output" button.
  • Opening a row neither loads nor copies anything. The existing load and retry path is unchanged.
  • A refused clipboard shows the existing "Couldn't copy. Select the text and copy it manually." line under the detail and never shows Copied. Copied comes from the same CopyButton feedback the message copies use.
  • On touch, each copy button is a 44px target. With a mouse it stays --chip-h tall and gets the same 24px hit expander the message copies have. The hover plate applies only on hover-capable pointers.
  • The copy labels are 15px on touch and 14px with a mouse. The focus ring is drawn inside the button, so the detail's clipped edge never cuts it. A mouse press shows .icon-button:active's plate at once, as an inset accent edge that moves nothing; a finger's press is the app's usual dim. A disabled copy turns --text-dim (5.29:1 light, 6.12:1 dark) instead of fading below AA.
  • No transcript data, caps, settings, endpoints or wrap options change. New strings have ko/ja/zh entries.

Design: I found no Codex or Claude app precedent for this. It follows the copy that Agent of Empires puts inside its opened tool cards, without its wrap toggle (output here already wraps in a bounded box) and without its silent failure on a refused copy. It keeps the quiet row chrome this app shares with the Codex and Claude apps: no toolbar, and nothing on a folded row. DESIGN.md's Work block section records this. No code was adapted, so THIRD_PARTY_NOTICES.md is unchanged.

Validation

  • bun scripts/tool-copy-demo-regression.ts is new and enrolled in scripts/ci-browser.sh. It runs on the production demo build at 1440 and at 390 with mobile touch, and reads the real browser clipboard back. It covers:

    • raw patch input that keeps its whitespace;
    • complete, error and todo output;
    • "Copy partial output" before a load and during a held load, then "Copy whole output" with the whole text after it;
    • an omitted input that offers no input copy;
    • a disabled copy on an empty input;
    • no loads on expansion;
    • a failed load that keeps the partial copy truthful, then a retry;
    • a rejected clipboard write that shows the failure line, never shows Copied and leaves the clipboard unchanged.

    It passes on its own and under bun run check run --build.

  • bun run check fast passes workflow syntax, generated types and themes, typecheck and build. Of the unit tests, every suite this change touches passes (i18n, conventions, ci-browser, changelog fragments). Under the PC's load (load average 60-130 on 32 cores), server/portal.test.ts, scripts/check.test.ts, server/session-history.test.ts, server/omp.test.ts and scripts/install-star.test.ts timed out. Run alone, install-star.test.ts, omp.test.ts and portal.test.ts pass. The check.test.ts source-identity case and the session-history.test.ts rollback-journal case fail the same way on unchanged main.

  • Screenshots: 390 (iPhone 14 emulation) and 1440, light and dark, plus Korean at 390. They cover rest, hover, focus, pressed, copied, disabled, loading, retry, a failed copy, error, omitted, partial, whole and long-output states. No horizontal page scroll, 44px touch targets, label sizes, an unclipped focus ring and AA contrast (opacity included) were measured.

An opened work row now labels its Input and Output (or Error) and puts a
quiet copy at the end of each label. The input copy takes part.input as the
agent sent it, never the drawn diff, checklist or question card. The output
copy takes the loaded whole output when there is one, else part.output,
including a todo call's raw answer that the list view leaves out. Its name
says the scope: Copy output for a complete output, Copy partial output while
a cut output's rest has not loaded (also after a failed load), Copy whole
output once it has. An omitted input keeps its explanation and gets no copy;
an empty input gets a disabled one. Opening a row loads and copies nothing.
A refused copy shows the existing "Couldn't copy" line and never Copied.
On touch the copies are 44px targets.

Checked with the new scripts/tool-copy-demo-regression.ts (enrolled in the
browser lane) on the production demo build at 1440 and 390: it reads the
real clipboard back for raw input whitespace, partial and whole output,
todo and error output, omitted and empty input, a held and a failed load
with retry, and a refused clipboard. ko/ja/zh entries, a DESIGN.md entry
and a changelog fragment are included.
Draw the copy focus ring inside the button so the detail edge no longer clips it, raise the copy labels to the chat body size on touch and 14px with a mouse, keep a disabled copy at --text-dim instead of an opacity that fell below AA, and give a mouse press the inset accent plate of .icon-button:active.
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2d825717-2c63-4d9a-bf12-7be39dd84be1
📥 Commits

Reviewing files that changed from the base of the PR and between 626204f and 57d767c.

📒 Files selected for processing: 10
  • DESIGN.md
  • changelog.d/tool-detail-copy.md
  • scripts/ci-browser.sh
  • scripts/ci-browser.test.ts
  • scripts/tool-copy-demo-regression.ts
  • src/components/ChatView.css
  • src/components/ChatView.tsx
  • src/lib/i18n.ja.ts
  • src/lib/i18n.ko.ts
  • src/lib/i18n.zh.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

📝 Summary

Summary by CodeRabbit

  • New Features
    • Added copy controls for tool-call input and output in chat details.
    • Output copy actions indicate whether the copied content is complete or only partially loaded.
    • Refused or failed copy attempts now show clear inline feedback.
    • Copying is unavailable for omitted or empty input.
    • Added Japanese, Korean, and Simplified Chinese translations for these controls.
  • Documentation
    • Documented tool-call copy behavior, including partial output and refusal handling.
  • Tests
    • Added browser regression coverage for desktop and mobile copy workflows.

Chat tool details now provide controls to copy raw input and output. Output controls distinguish partial from complete output, and copy failures appear inline. A browser regression test covers copy behavior across desktop and mobile contexts.

Changes: Chat tool detail copying

Layer / File(s) Summary
Input and output copy controls
src/components/ChatView.tsx, src/components/ChatView.css, src/lib/i18n.*.ts, DESIGN.md, changelog.d/tool-detail-copy.md
Opened tool details show labeled input and output copy controls. The controls use raw text, distinguish partial and complete output, disable empty or unavailable input copies, and show failures inline. Styling and translations support the controls.
Browser regression coverage
scripts/tool-copy-demo-regression.ts, scripts/ci-browser.sh, scripts/ci-browser.test.ts
The browser test checks input and output copies, partial and complete output, omitted and empty input, load and clipboard failures, and retry behavior. The browser CI lane runs the test and expects the updated script count.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Suggested reviewers: infowolfe

Merge Risk: ⚪ Minimal · up to 57d76

The copy controls and browser regression coverage appear ready to merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 7 files. (3 skipped: 3… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: adding raw input and output copying to tool details.
Description check Passed The description includes both required sections, explains the resulting behavior in detail, and lists validation results, regression coverage, and known test limitations. It does not include a maintai…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes both required sections, explains the resulting behavior in detail, and lists validation results, regression coverage, and known test limitations. It does not include a maintainer-approved issue link for this feature, but the remaining content is complete and relevant.

Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 7 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devswha
devswha merged commit 0cd899f into main Oct 21, 2026
31 of 41 checks passed
@devswha
devswha deleted the feat/tool-detail-copy branch October 21, 2026 20:42
devswha added a commit that referenced this pull request Oct 21, 2026
#1572)

## Change

Remove two features added after v0.4.12 because the maintainer judged
them unnecessary
during manual QA of main:

- **Next agent needing attention** (#1563): remove Mod+Shift+A, the
command palette
action and aliases, its Settings > Shortcuts binding, action-only
navigation code,
translations in all three translated locales, documentation, and
feature-only tests.
- **Raw tool detail copying** (#1565): remove the raw input/output copy
buttons,
copy-only state and styling, translations, documentation, and
feature-only browser test.
  Restore the pre-#1565 tool detail layout.

Deliberately keep the `agentRoster.ts` extraction and App-owned sidebar
activity state
because the sidebar still uses them. Preserve the roster regression test
as
`agentRoster.test.ts`. Keep the existing Output/Error headings, typed
tool input,
whole-output loading, and message/Markdown copying.

Stored overrides for the removed shortcut are ignored by the existing
shortcut-ID
allowlist. Existing settings tests already cover unknown stored IDs, so
no duplicate
test or storage migration is needed.

Neither `git tag --contains 626204f` nor `git tag --contains 0cd899f`
lists a tag
(both exit 0). Delete both unreleased changelog fragments rather than
adding a
Removed entry. No new UI design is introduced; the tool detail returns
to its existing
pre-#1565 design.

## Validation

- `bun run check fast`: exit 0; 5,810 passed, 0 failed, 8 skipped.
Generated types/themes, workflow syntax, typechecks, build, and unit
tests passed.
- Affected unit files: exit 0.
`bun test src/lib/shortcuts.test.ts src/lib/settings.test.ts
src/lib/agentRoster.test.ts src/lib/sidebarOrder.test.ts
src/lib/sidebarActivity.test.ts scripts/ci-browser.test.ts
scripts/pages-gate.test.ts`
- Browser-lane bookkeeping tests after final cleanup: exit 0.
  `bun test scripts/ci-browser.test.ts scripts/pages-gate.test.ts`
- `bun scripts/sidebar-activity-demo-regression.ts`: exit 0.
- `bun scripts/shortcut-exact-modifiers-demo-regression.ts`: exit 0.
  Both used a fresh shared demo build and isolated fictional fixtures.
- Manual browser QA of the actual built client at desktop and phone
sizes, light
and dark: no tool-detail copy controls; Output/Error and whole-output
loading remain;
removed palette action and shortcut setting are absent; old
saved/default chords do
  not navigate; the existing palette and Settings shortcuts still work.
- `git diff --check`: exit 0.
- Independent Codex final review: **APPROVE**, no concrete blockers. The
reviewer
inspected all 12 desktop/phone, light/dark screenshots. Its only initial
finding
was a dead reference to the removed browser script in the parallel
runner; that
  reference is removed.
The Omo reviewer could not start because this session reached its
nesting limit.

All checks used isolated fixtures, not the maintainer's live herdr
session.
@devswha devswha mentioned this pull request Oct 22, 2026
2 of 14 tasks
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.

1 participant