Skip to content

fix: Copy code over plain HTTP machine URLs - #3832

Merged
leaf-agent merged 2 commits into
mainfrom
fix/issue-3827
Oct 24, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/issue-3827

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

On plain HTTP machine-name pages, Chromium omits navigator.clipboard, so Web Awesome's copy button reports an error even for an ordinary code block. Leaf's shared copy control now uses a selected textarea and execCommand("copy") during the press in that context, while retaining its normal success and error feedback. Embedded samples keep their clipboard restriction.

The new browser regression fails against the old code and passes for both the block's button and Enter route. A second browser check confirms a sandboxed sample cannot change the parent clipboard. The focused browser checks and pnpm run check pass; the committed kernel was rebuilt.

Closes #3827 — automated triage

Use the selection copy command for top-level insecure pages where the Clipboard API is absent. Keep sandboxed samples on their refused clipboard path, and preserve the copy control's feedback.

Closes #3827
@leaf-agent
leaf-agent merged commit 74359b8 into main Oct 24, 2026
4 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-3827 branch October 24, 2026 22:02
max-sixty added a commit that referenced this pull request Oct 25, 2026
…ling

test_code_copy_on_plain_http_machine_name serves its page at the machine's
name and routes each request back to 127.0.0.1. Chromium lower-cases a URL's
host, so `request.url.replace(gethostname(), ...)` found nothing to replace
on a mixed-case name and fetched the machine name itself. That passes where
the name resolves to 127.0.0.1, as on a developer Mac, and fails on CI's
macOS runner, whose name resolves to ::1 and the LAN address only: the
fetch is refused and page.goto waits out its deadline. The test (added in
#3832) now lower-cases the name once and uses it for the URL, the route and
the rewrite. No product behavior changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Nov 4, 2026
…weep (#5291)

A sweep on 2026-11-03 found 39 capabilities implemented more than once
in Leaf. Tend's review had approved all 10 of the introducing pull
requests checked, and 15 nightly surveys that carried the instruction to
look for "several implementations of one capability" reported none. This
changes the instructions behind both, and adds a weekly sweep for what
review still misses.

- **Review loads `/developing-leaf`.** running-tend's Review threshold
named that skill's "Weigh what a change adds" without saying to load it,
and none of 11 production reviews on 2026-11-03 did. The section now
opens "Load `/developing-leaf`"; 16 of 16 replayed reviews then loaded
it.
- **"What it repeats"** joins "Weigh what a change adds": search for the
question each new helper, constant, selector, style rule or inline check
answers rather than its name, count a copy whose comment names its
source as a copy, and export, move or generate the owner rather than
copy it. "Regular maintenance" points its "Several implementations of
one capability" bullet at it, since the nightly survey reads one file at
a time.
- **Weekly: duplicate implementations** sweeps one area a week, chosen
by ISO week number modulo 4, searching the whole tree by question. Each
copy's introducing pull request goes in the sweep's description, so the
copies added since the area's last sweep show what review let through.

Replaying four pull requests that each introduced a copy (#3832, #5196,
#2345, #3137), reviewers caught the copy 2 of 9 times with the old text,
3 of 8 when told to load the skill, and 5 of 8 with "What it repeats",
whose wording was revised after the replay. That difference is within
noise at this size, and no arm caught a one-line copy inside a new
helper; the weekly sweep is there for those.

This changes agent instructions, so it lands with the control-plane
owner's approval (running-tend, "Landing").

> _This was written by Claude Code on behalf of max-sixty_
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.

Block copy buttons fail on a page served over plain http to a machine name

1 participant