Code blocks: copy button + line-wrap toggle (verify upstream first, don't break rendering) #131

Closed
opened 2026-09-17 16:10:05 -04:00 by jared · 1 comment
Owner

Verify what upstream Cinny 4.12.x already renders for <pre><code> (react-custom-html-parser code branch + ReactPrism): there may be a copy affordance already.

Scope

  • Hover/focus-visible Copy icon button in the top-right of a code block (copies the raw text, not highlighted HTML); "Copied" state for 1.5 s.
  • Wrap toggle next to it for long lines (default: no wrap, horizontal scroll — current behaviour). Remember the wrap choice per session only.
  • Must not change the existing markdown/HTML output, message layout widths, or the Lotus Terminal syntax theme; snapshot the current rendering before/after (headless screenshot).
Verify what upstream Cinny 4.12.x already renders for `<pre><code>` (react-custom-html-parser code branch + ReactPrism): there may be a copy affordance already. ### Scope - Hover/focus-visible **Copy** icon button in the top-right of a code block (copies the raw text, not highlighted HTML); "Copied" state for 1.5 s. - **Wrap** toggle next to it for long lines (default: no wrap, horizontal scroll — current behaviour). Remember the wrap choice per session only. - Must not change the existing markdown/HTML output, message layout widths, or the Lotus Terminal syntax theme; snapshot the current rendering before/after (headless screenshot).
jared added this to the Features 2026-Q4 milestone 2026-09-17 16:10:05 -04:00
jared added the enhancementpriority: lowuxarea: messaging labels 2026-09-17 16:10:05 -04:00
jared self-assigned this 2026-09-17 16:10:05 -04:00
Author
Owner

Verified upstream first: every code block already has the Copy chip with a 'Copied' state. Added the missing half in 2a0c4091: a Wrap chip that switches long lines to pre-wrap (default stays no-wrap + horizontal scroll), remembered for the session only. Output, widths and the syntax theme untouched. Verified headless: scrollWidth 1016 → 612 px with wrapping on.

Verified upstream first: every code block already has the **Copy** chip with a 'Copied' state. Added the missing half in `2a0c4091`: a **Wrap** chip that switches long lines to `pre-wrap` (default stays no-wrap + horizontal scroll), remembered for the session only. Output, widths and the syntax theme untouched. Verified headless: scrollWidth 1016 → 612 px with wrapping on.
jared closed this issue 2026-09-19 23:19:59 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#131