Repository navigation
feat(ui-feedback): copy the chosen design from the command bar and hide the mockup's data bar - #18041
Conversation
…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>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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>
Lane run report
Run 44948182981, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
|
claude-security-review reviewed 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 What I checked:
Trust controls: the diff touches none of them: no trusted-actor list, token request, kill switch, merge hold or Plugin manifests: no PR context: it contains no instructions aimed at the review lane. Settled threads and prior findings: the one settled thread (wrong error message in critical-findings: 0 |
|
claude-review reviewed 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 What changed since the last review. The head Closing issue #17991. All three "Done when" items are met:
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
Other checks.
Verifier dropped 0 of 0 candidates. |
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>
…-design # Conflicts: # lib/ui-feedback/host.mjs # plugins/prototype/notes-bridge/host.mjs
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
copyOut: truewhen the page defineswindow.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, ornullwhen it is missing or throws (logged with the error).chosenFrominlib/ui-feedback/frame-channel.mjskeeps the text only when the type ischosen, 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 textmaxLengthof 4000, since the terminator carries notes plus test ids (judgment).#copy-chosenis enabled bycopyOut, takes one reply per ask (an unaskedchosenmessage is ignored), sets the text as the copy-out textarea'svalue, copies it withnavigator.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.assets/variant-switcher.htmlhides every[data-harness-chrome]element under:root[data-ui-feedback-bar], beside its own pill rule, with!importantso a mockup'sdisplayrule cannot win. Sample data presses the hidden controls with.click().window.uiFeedbackCopyOut),reference/data-controls.md"Placement" (mark the bardata-harness-chrome),reference/feedback.md, and the ui-feedback contract's "Copy-out and import".scripts/sync-shared-copies.sh; fragments for prototype (minor) and planning (patch, syncedproto-pin.js).Verification
node --test lib/ui-feedback/*.test.mjs: 278 pass, 0 fail. The newframe-channel.test.mjscases 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, becausechosenFromis not exported there.node --check lib/ui-feedback/host.mjsandproto-pin.js: OK.notes-copyout-browser.test.sh, run locally on Windows withbrowser-test-helpers.sh'smkdir -m 700relaxed 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 touiFeedbackCopyOut(), and for B after the view arrows. Markup text copies nothing, makes no element and runs no handler. An unaskedchosenmessage copies nothing. Fromfile://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-browserandnotes-panel-browserall pass locally with the change.Related
Closes #17991
🤖 Generated with Claude Code