Summary#
- Injects a copy button into .prose pre.chroma code blocks via client-side DOM injection in base.html
- Scoped to .prose so blob view source code (which has its own UX) is unaffected
- Handles HTMX-swapped content (dynamic comment loading) via htmx:afterSettle listener
Test plan#
- go test ./appview/pages/markup/... passes (no regressions)
- Verify button appears on hover over code blocks in rendered markdown
- Verify clicking copies code and shows check icon briefly
- Verify dark mode styling
- Verify blob view code blocks do NOT get copy buttons
works brilliantly! one nit: the copy button seems to add an extra newline for each line on my browser. do you notice the same behavior on your end?
will do a more thorough code review shortly!