Skip to content

feat(ui-feedback): copy the chosen design from the command bar and hide the mockup's data bar - #18041

Merged
kyle-sexton merged 5 commits into
mainfrom
fix/17991-copy-chosen-design
Nov 21, 2026
Merged

kyle-sexton merged 5 commits into
mainfrom
fix/17991-copy-chosen-design

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Summary

The notes command bar's Copy menu gets Copy chosen design, which copies the text the mockup's own copy-out terminator gives. Framed by the host page, a mockup's own data bar now hides, so its data controls show only in the bar's Sample data menu; opened alone from file:// the page keeps its bar.

Fix

  • New frame messages. The ready message carries copyOut: true when the page defines window.uiFeedbackCopyOut, the one function its terminator also calls. The host page asks with {type: "copy-out"}; the frame helper (proto-pin.js) answers {type: "chosen", text} with that function's string, or null when it is missing or throws (logged with the error).
  • Validation. chosenFrom in lib/ui-feedback/frame-channel.mjs keeps the text only when the type is chosen, the text is a non-empty string of at most 8000 code points (kept whole, never cut), with no < before a letter, !, / or ?, and no control character but tab and line breaks. Basis for 8000: twice note.schema.json's text maxLength of 4000, since the terminator carries notes plus test ids (judgment).
  • Host page. #copy-chosen is enabled by copyOut, takes one reply per ask (an unasked chosen message is ignored), sets the text as the copy-out textarea's value, copies it with navigator.clipboard.writeText, and falls back to "select and copy". It is never rendered as markup. The entry is disabled when the frame loads another document.
  • One data bar. assets/variant-switcher.html hides every [data-harness-chrome] element under :root[data-ui-feedback-bar], beside its own pill rule, with !important so a mockup's display rule cannot win. Sample data presses the hidden controls with .click().
  • Docs. SKILL.md "A copy-out terminator" (build the text in window.uiFeedbackCopyOut), reference/data-controls.md "Placement" (mark the bar data-harness-chrome), reference/feedback.md, and the ui-feedback contract's "Copy-out and import".
  • Synced copies regenerated with scripts/sync-shared-copies.sh; fragments for prototype (minor) and planning (patch, synced proto-pin.js).

Verification

  • node --test lib/ui-feedback/*.test.mjs: 278 pass, 0 fail. The new frame-channel.test.mjs cases cover a valid multi-line text kept whole; 8000 code points accepted and 8001 refused; wrong type, non-string, empty and whitespace-only text refused; tags, a comment, a processing instruction and control characters refused. They fail on main, because chosenFrom is not exported there.
  • node --check lib/ui-feedback/host.mjs and proto-pin.js: OK.
  • New notes-copyout-browser.test.sh, run locally on Windows with browser-test-helpers.sh's mkdir -m 700 relaxed for the run only (not committed): 12/12 pass. Framed, the data bar is hidden and Sample data still seeds. Copy chosen design gives the hand-written literal for variant A, equal to uiFeedbackCopyOut(), and for B after the view arrows. Markup text copies nothing, makes no element and runs no handler. An unasked chosen message copies nothing. From file:// the bar shows and the page's own copy-out gives the same literal. Against main's runtime copies it fails: the bar is not hidden and there is no #copy-chosen.
  • controls-browser, switcher-browser and notes-panel-browser all pass locally with the change.

Related

Closes #17991

🤖 Generated with Claude Code

…de the mockup's data bar

The Copy menu gets Copy chosen design. A mockup builds its copy-out
terminator text in window.uiFeedbackCopyOut, which its own terminator
calls; the ready message says whether the page has one (copyOut), the
host page asks with {type: "copy-out"} and the frame helper answers
{type: "chosen", text}. The host keeps one reply per ask, and only when
chosenFrom admits it: a non-empty string of at most 8000 code points
(two note texts, note.schema.json's text maxLength 4000), kept whole,
with no tag, comment or processing instruction and no control character
but tab and line breaks. The text is set as a textarea value and copied,
never rendered.

Framed by the host page, the bundled switcher now hides every element
marked data-harness-chrome, so the mockup's data bar shows only in the
bar's Sample data menu, which still presses the hidden controls; opened
alone from file:// the page keeps its bar. The switcher's own rule takes
!important with it, so a mockup's display rule on its bar cannot win.

Closes #17991

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 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-11-21T20:49:33.653355Z 05de1cd 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.

… test-scope

The suite reads plugins/prototype/.claude-plugin/plugin.json through the
browser test helpers, so a change to it must select the suite
(scripts/affected-tests.sh R8).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs

Run 44948182981, attempt 1

Field Value
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44948182981

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 531d67691456508537757306d8facc1bd76ba122: read 19 of 19 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #18041 (blocking only)

I already reviewed an earlier head of this pull request, so this review reports only CRITICAL and IMPORTANT findings. I read every hunk of the 18 files to read in .claude-lane/pr.diff. plugins/prototype/notes-bridge/proto-pin.js has the same change as plugins/planning/shared/web/proto-pin.js, and its path does not change what the code does. I found no security issues.

What I checked:

  • Host page receiving the chosen text (lib/ui-feedback/host.mjs#L555-L577 and its generated copy):
    • A chosen message is handled only if it passes the unchanged message-listener check fromFrame(e, frame.contentWindow, devOrigin) (L677) and the page has asked for it (wantChosen). A message nobody asked for is ignored.
    • The text is only set as a textarea's .value and written to the clipboard. It is never added as markup, so there is no DOM injection path, even before chosenFrom rejects markup.
    • The button is disabled once the frame loads another document.
  • Validation in chosenFrom (frame-channel.mjs): it only rejects input. It checks the type and string, a limit of 8000 code points, markup, and C0 control characters including ESC. That keeps ANSI escape sequences out of the clipboard text pasted into the terminal.
  • Frame helper in proto-pin.js: it answers copy-out only by posting through the existing post path to the host page. It calls the page's own window.uiFeedbackCopyOut inside a try/catch, and the ready message only gains a boolean. It sends nothing to any new place.
  • variant-switcher.html: a CSS rule hides [data-harness-chrome] when the page is framed. This is presentation only.
  • Docs, SKILL.md and reference files: they add guidance and remove or loosen no rule. The plain-text limit of 8000 characters is still stated.
  • New browser test (notes-copyout-browser.test.sh and -take.js): this test runs locally against a temporary fixture. It reaches no CI trust surface and no credentials.

Trust controls: the diff touches none of them: no trusted-actor list, token request, kill switch, merge hold or .github/actions/ change.

Plugin manifests: no .claude-plugin/plugin.json or marketplace.json changed, so there are no manifest lines.

PR context: it contains no instructions aimed at the review lane.

Settled threads and prior findings: the one settled thread (wrong error message in copyChosen) was fixed and its lines have not changed since. My earlier summary had no findings to repeat.

critical-findings: 0

@github-actions github-actions Bot 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.

claude-review: 1 inline finding(s) on 235acdc5f07f3d2e0643cbb9e1b1388096cfa592; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread lib/ui-feedback/host.mjs Resolved
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 531d67691456508537757306d8facc1bd76ba122: read 19 of 19 changed file(s); 0 finding(s), 0 as inline comments.

Code review: Copy chosen design and one data bar (#18041)

No findings. This review reports blocking findings only. This lane already reviewed two earlier heads of this pull request.

Scope. I read every hunk of all 18 files in .claude-lane/to-read.txt in .claude-lane/pr.diff. plugins/prototype/notes-bridge/proto-pin.js changes exactly as plugins/planning/shared/web/proto-pin.js does, so I read it once. Its path does not change what the content does: both are synced copies of the frame helper.

What changed since the last review. The head 531d6769 is a merge of origin/main into the branch. The pull request's own diff matches what the earlier incremental review checked at 7620b3ab. My one earlier advisory finding, the wrong failure message from copyChosen, is settled: it was fixed in 7620b3ab, and its lines have not changed since.

Closing issue #17991. All three "Done when" items are met:

  • Copy chosen design. The menu entry asks the frame for the text the mockup's own terminator gives, through the same window.uiFeedbackCopyOut function. The host keeps the reply only after chosenFrom in frame-channel.mjs checks it. The host takes one reply per ask, sets the text as the textarea's value, and never renders it as markup. Unit tests in frame-channel.test.mjs cover chosenFrom. The browser take checks that the copied text equals the page's own function output.
  • One data bar. variant-switcher.html hides [data-harness-chrome] under :root[data-ui-feedback-bar], with !important. Opened alone from file://, the page keeps its own bar. The browser take checks both cases.
  • Docs. reference/data-controls.md ("Placement") and SKILL.md, which links to reference/feedback.md#the-copy-out-function, say how a mockup marks its data bar and builds its copy-out text.

The browser suite's 12/12 pass is the author's claim; I did not run it.

Loosened checks. Nothing is loosened: the change only adds tests and a new validator. The prompt had no loosened_check_verdict:, loosened_check_patterns: or loosened_check_decision_record: line. I used the default fail with no consumer entries, and did not check the citation requirement.

  • Loosened checks would be marked: fail (bundled default); patterns: 0

Other checks.

  • No plugin manifest changed. The changelog fragments set prototype to minor (a new feature) and planning to patch (a synced helper only), which fit the change.
  • The PR context, the settled-threads file and the prior-findings file hold no embedded directives.

Verifier dropped 0 of 0 candidates.

kyle-sexton and others added 2 commits November 21, 2026 15:59
When uiFeedbackCopyOut throws, returns no string or is gone, the frame
answers text: null, and the host page said the design was not plain text
of at most 8000 characters, pointing the author at the wrong cause. A
null reply now gets its own message naming the function and the mockup's
console; only a present string chosenFrom refuses gets the length and
markup message.

SKILL.md was 502 lines, over the 500-line cap: the copy-out function
detail moves to reference/feedback.md "The copy-out function", with a
one-line pointer left in the copy-out terminator item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 21, 2026
…-design

# Conflicts:
#	lib/ui-feedback/host.mjs
#	plugins/prototype/notes-bridge/host.mjs
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit be755b3 Nov 21, 2026
55 checks passed
@kyle-sexton
kyle-sexton deleted the fix/17991-copy-chosen-design branch November 21, 2026 21:34
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui-feedback: Copy chosen design and one data bar in the notes command bar

1 participant