Repository navigation
Copy chat answers and show them as raw text - #416
Merged
Merged
Conversation
Each answer gets „Antwort kopieren“ (copies the Markdown as written) and a „Als Rohtext anzeigen“ switch that shows the unformatted text. The main window may now write to the clipboard (clipboard-sanitized-write); reading it stays denied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012XEC1k66v7QL5XagMjdKr9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two small buttons now sit under every finished chat answer:
aria-pressed) switches that one answer between the formatted view and its unformatted text, shown in a selectable<pre>.Why the permission change
The Electron session handler denied every permission except the microphone, so
navigator.clipboard.writeTextwas rejected withNotAllowedError: Write permission denied(I confirmed this with a probe in the E2E app).permissions.tsnow also grantsclipboard-sanitized-write, under the same conditions as the microphone: main window only, Archivist's own origin. Reading the clipboard (clipboard-read,deprecated-sync-clipboard-read) stays denied. Pasting with Ctrl+V needs no permission.Docs
docs/reference/funktionen.md: chat section describes copying and the raw-text switch.docs/reference/aktionsstufen.md: the Electron section now lists two permission exceptions instead of one.Tests
tests/unit/desktop-permissions.test.ts): clipboard writes are allowed only for the main window's own pages, and reads are never allowed. This covers both the request handler and the check handler.tests/e2e/chat-copy.spec.ts, via the chat page object): the copy button puts the exact Markdown on the system clipboard (read back through Electron'sclipboard), and the raw-text switch shows the unformatted text and toggles back.Local gates: typecheck, format:check, lint, depcruise, knip, test:coverage (3140 tests), the full Playwright suite (181 passed) and prek all pass. gitleaks and zizmor could not run here because there was no network access for their downloads.
🤖 Generated with Claude Code
https://claude.ai/code/session_012XEC1k66v7QL5XagMjdKr9