aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-24 10:42:23 +0200
committerDanilo M. <danix@danix.xyz>2026-08-24 10:42:23 +0200
commitd2459356d648825932137e9c7c5c018233c565a1 (patch)
treec3f791750c3840e99192d812da6c3d1ccf26bcba /README.md
parent9d3ce9ca53cb3b660323903a1db1ea6a31c1a03e (diff)
downloadllamachat-d2459356d648825932137e9c7c5c018233c565a1.tar.gz
llamachat-d2459356d648825932137e9c7c5c018233c565a1.zip
docs: document code block wrapping and the copy button
Records why the block style carries white-space:pre-wrap and why the padding is margins plus a spacer line: Qt's markdown stylesheet does not cover pre, and Qt ignores padding and vertical margins on it. Also describes the copy button and the constraints behind its shape, since neither a widget nor :hover is available in Qt rich text.
Diffstat (limited to 'README.md')
-rw-r--r--README.md22
1 files changed, 20 insertions, 2 deletions
diff --git a/README.md b/README.md
index f53d167..24a5d7f 100644
--- a/README.md
+++ b/README.md
@@ -22,8 +22,10 @@ persistent process and toggles like a scratchpad from a Hyprland keybind.
words of the question the entry was created with.
- **Streaming replies** rendered token by token, formatted as markdown:
headings, bold and italic, bullet and numbered lists, tables, inline code
- and tinted fenced code blocks. What you type is shown exactly as typed, so
- the contents of an attached file are never reflowed.
+ and tinted fenced code blocks. Long lines wrap rather than scrolling the
+ transcript sideways, and each code block carries a copy button. What you
+ type is shown exactly as typed, so the contents of an attached file are
+ never reflowed.
- **Collapsed reasoning.** Presets with a reasoning budget return the model's
thinking separately from its answer. It shows as a one-line `▸ thinking`
summary above the reply, and clicking that expands it. Each reply collapses
@@ -563,6 +565,22 @@ handed to the desktop opener.
Qt renders a fenced block as one `<pre>` element per line with no background
of its own, so llamachat adds the tint that makes a code block read as one.
+Qt also ignores `padding` and vertical margins on `<pre>`, so the inset comes
+from left and right margins and the room above and below from a tinted spacer
+line. Without an explicit `white-space:pre-wrap` a long line would widen the
+whole transcript: Qt's own markdown stylesheet wraps `p` and `li` but not
+`pre`, and that stylesheet is dropped when only the body fragment is kept.
+
+Each code block gets a copy button below it, on the right. Qt rich text has
+no widgets and no `:hover`, so the button is an anchor in the same internal
+scheme dispatch the thinking and search toggles use, and hovering is a
+re-render driven by `QTextBrowser.highlighted()`. It sits below the block
+because Qt cannot float it over the tint. The button is grey at rest, takes
+the highlight colour under the pointer, and becomes a green tick for a moment
+once used; the tick reverts on its own rather than standing indefinitely and
+implying the clipboard still holds that block. The text is copied from the
+source markdown, not the rendered HTML, which per-line `<pre>` elements would
+make unrecoverable.
## Notes and limits