0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-16 18:57:19 +00:00
Commit graph

14 commits

Author SHA1 Message Date
José Gurruchaga
9e1a11158b
Render Mermaid diagrams in chat replies (#760)
* Render Mermaid diagrams in chat replies

Assistant replies now draw ```mermaid fences as diagrams with the file
preview's engine, fence frame, source toggle, Copy action and lightbox.
Inline images in chat keep their text rendering.

Streaming never renders a fence that may still be growing: only blocks a
later row of the same reply follows, or blocks of a completed reply,
request a diagram, so per-token commits start no render work. Until a
diagram is ready the fence shows its source, and a failed render keeps
the source with the engine's diagnostic in a header marker.

Rows request their fences while laying out, so only painted diagrams
are rendered, one at a time off the UI thread; requests whose rows
scrolled away are dropped. Results are retained under a byte budget,
least recently painted first out. A swap remeasures only the rows
painting it and uses the existing layout signals, so the bottom pin
follows and the own-turn runway absorbs the change without moving the
sent prompt.

* Account prepared SVGs at their current raster, not the largest possible

decode_image reserved the largest preview any view could request (900x480
at 4x density) for every SVG and Mermaid diagram, so a 177x348 class
diagram counted 7.6 MiB against the 64 MiB media budgets. The file
preview stopped drawing diagrams after about eight per document, the chat
cache retained about eight, and the lightbox had little room left to
enlarge.

Media now counts its source plus the CPU and GPU copies of the raster it
holds. Since admission no longer reserves headroom, the file preview and
the chat diagram cache re-check their budget before a larger re-raster
(MediaImage::preview_within); a variant that does not fit keeps the
current raster.

* Draw Mermaid diagrams in Zeron's style

Render diagrams on a transparent canvas so they sit on the fence body,
with rounded hairline cards for nodes, muted labels and connectors, and a
soft accent tint on default decisions, sequence notes and activations.
Gantt bars take their hues from the accent and gridlines use the theme
border. Explicit style and classDef colors are kept. Tighter spacing keeps
labels larger once a diagram is scaled to the reading column, and the
lightbox draws diagrams on a plate in the fence body color.

* Gate Linux-only Mermaid cache test helpers

ready_count and ready_media serve the transcript tests, which only compile
on Linux, so they were dead code (with a warning) on macOS and Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Wing <contact@winglee.io>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 22:55:54 -07:00
José Gurruchaga
a9de0352a9
Open transcript web links in Browser with destination tooltips and truncation (#355)
* refactor(ui): model transcript link targets and activation

* feat(ui): open transcript web links in session browser tabs

* feat(ui): add transcript link actions and keyboard access

* feat(ui): show full web destinations on hover and focus

* feat(ui): truncate long transcript links without losing content

* test(ui): cover transcript browser links end to end

Add native transcript link fixtures, preserve focus when action menus mount, and document interaction, Linux runtime requirements, and platform validation limits.

Fixes #351

* feat(ui): open Markdown preview links in session browser tabs

* fix(ui): make link destination tooltips compact

* fix(ui): suppress link tooltips while context menus are open

* feat(ui): add default link destination toggle

* fix(ui): use shared context menu rows for links
2026-09-14 00:43:01 -07:00
José Gurruchaga
f8766271f5
feat(ui): add workspace image previews with pinch and wheel zoom (#333)
* refactor(ui): share bounded image preview resources

* feat(files): preview workspace images safely

* feat(ui): add image pinch and ctrl-wheel zoom

* feat(ui): enable image zoom in the shared lightbox

* test(files): cover remote image previews and zoom lifecycle

* fix(ui): remove image zoom toolbar

* fix(files): keep image previews in the file panel

* fix(ui): protect image preview lifecycle and scope zoom redraws
2026-09-12 16:17:02 -07:00
José Gurruchaga
176208bedc
Fix Markdown review width and align controls with content (#334)
* Fix Markdown review width and align controls with content

* Fix Markdown review removal test click position
2026-09-12 16:08:31 -07:00
José Gurruchaga
a45e7c5392 fix(markdown): match chat code fence interactions in preview 2026-09-08 22:14:23 -03:00
José Gurruchaga
a91be100b8 feat(files): open Markdown documents in preview by default 2026-09-08 20:22:43 -03:00
José Gurruchaga
e0ec0f5733 fix(markdown): scale large SVG previews within raster memory budgets 2026-09-08 20:18:32 -03:00
José Gurruchaga
8d2a421dd1 feat(markdown): add inline review comments with shared diff controls 2026-09-08 20:03:35 -03:00
José Gurruchaga
246d1a007e feat(markdown): edit task lists with interactive preview checkboxes 2026-09-08 19:47:18 -03:00
José Gurruchaga
b06267903f fix(markdown): preserve SVG labels with bundled and fallback fonts 2026-09-08 19:30:40 -03:00
José Gurruchaga
1c3f014ef2 fix(markdown): reuse code fence chrome for Mermaid 2026-09-08 19:09:23 -03:00
José Gurruchaga
d47b8e744e fix(files): constrain Markdown preview width 2026-09-08 18:36:46 -03:00
José Gurruchaga
a18307a430 fix(files): bound Markdown preview work and preserve navigation state 2026-09-08 18:17:11 -03:00
José Gurruchaga
3fedad58d7 feat(markdown): add a native Mermaid rendering backend 2026-09-08 17:45:22 -03:00