Draft
Conversation
Owner
simonw
commented
Dec 29, 2025
Add a <copy-button> WebComponent that copies content to clipboard: - Uses data-content attribute for markdown content (stored at render time) - Uses data-content-from attribute with CSS selector for JSON/text content - Button shows "Copied!" for 2 seconds after successful copy - Different button labels: "Copy Markdown", "Copy JSON", "Copy text" Copy buttons added to: - Messages in page-X.html (left of timestamp) - Index items in index.html (left of timestamp) - Index commits in index.html (left of timestamp) - Search results in search modal Includes CSS styling, WebComponent JavaScript, and test coverage.
Add comprehensive Playwright tests that verify: - Copy buttons are visible in messages and index items - Clicking copy button changes text to "Copied!" for 2 seconds - Copy button actually copies content to clipboard - Search modal exists and search box is hidden on file:// protocol - Timestamps are formatted by JavaScript Tests are automatically skipped if Playwright browsers are not installed, making CI/local development seamless without requiring browser setup. Added pytest-playwright to dev dependencies in pyproject.toml.
Owner
Author
|
Extract the CSS and JavaScript code from __init__.py into proper template files: - templates/styles.css: All CSS styles - templates/scripts.js: Copy button WebComponent and other JS Add get_css() and get_js() functions to load and render these templates, replacing the CSS and JS Python string constants. This improves code organization by keeping frontend assets in separate files that can be edited independently.
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.