Skip to content

Copy the show command from Command details - #1187

Merged
JacobStephens2 merged 4 commits into
mainfrom
issue-1112
Oct 23, 2026
Merged

JacobStephens2 merged 4 commits into
mainfrom
issue-1112

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Command details has a Copy CLI button beside its thirdshift show '<command>' --json line. It sits in the Peek on the Inbox, history, Security, Logs and Waterfall pages.

 <section aria-label="Command details">
   …
-  <code>thirdshift show '…' --json</code>
+  <p class="peek-cli"><code>thirdshift show '…' --json</code> <button data-copy-cli>Copy CLI</button> <span role="status"></span></p>
click Copy CLI
  clipboard.writeText(line)      → "CLI copied."
  refused / insecure origin      → select the line → "Selected; copy it with your keyboard."
live refresh of Command details (loadPeek)
  keepCopy: carry the status and the line's selection into the new pane

Seams under test: the Console page in a browser (Playwright, console/tests/inbox.test.cjs).

Evidence

  • Before: node --test --test-name-pattern "Command details" tests/inbox.test.cjs: 2 failing (waiting for getByRole('button', { name: 'Copy CLI' }) timed out).
    After: 3/3 pass:
    • Copy CLI puts exactly thirdshift show '<selector>' --json on the clipboard.
    • A refused clipboard selects that line.
    • On a live Command, the selection survives a refresh of the pane.
  • Before (review finding): Command details keeps its fallback selection across a live refresh failed, actual: ''.
    After: passes in 3/3 runs. The test now requires the refresh to happen.
  • npm test in console/: 67/67 pass on the final head. cargo test --test console: 72 passed.
  • scripts/affected-tests origin/main selected the full Rust suite:
    • Run with cargo test --no-fail-fast on f561ecf: 2421 passed, 0 failed.
    • This needed tag.gpgsign=false set in the environment. The machine's global tag.gpgsign=true makes three worktree::synchronization_tests fail with no tag message?, which is unrelated to this change.
    • The later commit changes only JS, the README and the browser test.

Merge Danger

Door: two-way

Blast Radius: Peek

The change is client-side only, with no new server action (ADR-0016). Live refresh of Command details now also restores the copy line's status and selection.

Review coverage

  • Both reviewers used origin/main (2b4f35e) as the fixed point, because the local main ref was stale.
  • Both read every changed file: console/tests/inbox.test.cjs, src/console/assets/console.js, src/console/peek.html and console/README.md (lines 224–230).
  • The review ran on f561ecf. Its fixes are in 773c19a, which was not re-reviewed.
  • No changed file was left unread.

Unaddressed findings

Standards

  • 1. Duplicated Code: two Copy CLI handlers with different fallbacks.
  • 3. Divergent Change: console.js owns a widget's clipboard behaviour.
    • console.js already owns #peek-content loading (loadPeek).
    • The fix for the live-refresh finding (keepCopy) has to run inside loadPeek, around its replaceChildren.
  • 4. data-copy-cli duplicates the <code> text. It is the hook Standards finding 2 asked the handler to key on, and it mirrors spans.js:239.
  • 5. Repeated setup in the two new tests. This matches the inline style of the surrounding tests in console/tests/inbox.test.cjs, as the reviewer noted.

Spec

None.

Security

None.

Closes #1112

Built with claude · claude-opus-5-5 · high

Security review outcome

No unaddressed introduced findings.

Command details now has a Copy CLI button beside its thirdshift show
command. When the clipboard is refused, the command is selected so it
can be copied with the keyboard.
A live Command refreshes Command details on each change, which cleared
the by-hand selection a refused clipboard leaves. The refresh now keeps
the copy status and selection. The copy handler keys on data-copy-cli.
@JacobStephens2
JacobStephens2 merged commit bc3ed5e into main Oct 23, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1112 branch October 23, 2026 22:31
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 23, 2026
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.

add copy button near command in command details pane in console web ui for easy copying to share with an agent or to run on cli

1 participant