Skip to content

Fix extra space when copying a jq command without flags - #402

Merged
owenthereal merged 1 commit into
mainfrom
pipeline/fix-copy-command-extra-space
Dec 6, 2026
Merged

owenthereal merged 1 commit into
mainfrom
pipeline/fix-copy-command-extra-space

Conversation

@owenthereal

Copy link
Copy Markdown
Member

Fixes the extra space after jq when the playground copies a command with no flags. Closes #398.

The Copy button now uses formatJqCommand to join the executable, nonblank flags in selection order, and the quoted query. The query is copied verbatim.

Verification

  • On the original formatting expression from b912f85, four of nine focused tests failed on extra spaces. With no flags, the formatter returned jq '.'. Single and multiple flags kept their existing output. The initial missing-export failure was separate from these assertions.
  • On ed49ff7, npx vitest run src/lib/utils.test.ts passed all nine tests. These cover empty, omitted, and blank options, flag order, and spaces, pipes, and newlines in queries.
  • Fresh local verification on Node 26.14.0 passed npm run lint, npm test (94 tests in seven files), and npm run build. The baseline also emitted the Vitest config warning and OpenAPI diagnostics.
  • In the local standalone production build, Playwright clicked the real Copy button, selected -c, then added -r. A test page recorded the string after each browser clipboard write succeeded. The commands were jq '.', jq -c '.', and jq -c -r '.'.

Risk and review

Low risk. The diff changes clipboard text formatting and its unit tests. The existing clipboard notifications and button controls are unchanged. Revert ed49ff7 to restore the previous formatter.

The task and whole-branch reviews found no issues. Codex implemented and reviewed the branch. The requested GitHub Codex review uses the same vendor. Owen reviews the final head and decides whether to merge.

Rulings I made

  • I reran preflight in the assigned clean worktree to preserve the two untracked screenshots in the main checkout.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-06T02:32:05.192548Z ed49ff7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@owenthereal

Copy link
Copy Markdown
Member Author

Owen, I recommend merging ed49ff759608774ac31c13b45c70605a99d3ddc3 after your review.

GitHub CI passed lint, all 94 tests, and the production build. Codex reviewed this head and reported no findings. There are no unresolved review threads. The change is low risk and limited to formatting the copied command.

For a direct spot-check, enter ., clear the jq options, and click Copy command to clipboard. The pasted text should be jq '.'. Select Compact output and Raw output in that order and copy again. The result should be jq -c -r '.'. Both paths passed in the local production build. The PR is ready for your merge decision. CI results

@owenthereal
owenthereal merged commit 66ff669 into main Dec 6, 2026
1 check passed
@owenthereal
owenthereal deleted the pipeline/fix-copy-command-extra-space branch December 6, 2026 02:37
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.

Copying a jq command to clipboard adds an extra space

1 participant