copy() tried /api/copy, then navigator.clipboard.writeText, then the copy
command, and when all three failed it put the bare text in the footer
with no word that nothing was copied. Now that magpie refuses a copy it
can't read back (the commit before), that last case is reachable in the
app on Linux, so it reads "Couldn't copy. Select it here and copy it
yourself: <text>" as an error (role=alert, 8s) and the button isn't
flashed as copied. Translated in zh, zh-TW, ja and de. The order of the
tries and the success path are unchanged, on macOS and Windows too.
docs/subsystems/gui-shell.md: the host's copy row says how a Linux copy
is made and checked, and where the page takes over.
Run:
- tests/copy-fallback.test.cjs (new): /api/copy 204 (no page copy),
501 + clipboard API, 501 + API refused + copy command, all refused;
en, zh, zh-TW, ja, de; Chromium and WebKit: 40 pass. With the failure
line put back to status(text), the 10 "nothing copies" cases go red.
- copy-command, key-copy, model-copy-id, library-mcp-copy-config,
i18n-keys: pass.
- go test -tags nogui ./internal/gui: pass.
Not tried: WebKitGTK's own clipboard API and copy command inside the real
Linux app window when /api/copy refuses (the container run drove the
host's copy directly).