This repository was archived by the owner on Aug 17, 2026. It is now read-only.
Repository navigation
Commit 0d4a394
authored
fix(grunt/tui): TicketHoverCard text-rendering — clean preview lines, no character bleed (#17)
Refs hivemind anomalyco#233. Closes Nik feedback after PR #16: 'there is some
gibberish being added in to text' with a screenshot showing the title
rendered as '##nNikrdirective...' (jumbled) and the scope as
'clicktto,open inrhivemind-ui closed the session before' (with extra
letters and the footer-line text bleeding into the scope).
## Root cause
Three compounding issues in the card body:
1. **Multi-line scope text with wrapMode='word'** — opentui's text renderable
joins adjacent <text> siblings when wrap-word is enabled, producing
character bleed across line boundaries. The actual title was correct
in the api response; the renderer was conflating it with the scope's
first line plus the footer ('click to open in hivemind-ui') text.
2. **Markdown chars in scope** — full scope text contains markdown
('## Nik directive 2026-05-26T23:01Z (recovered from ses_...)') which
the plain-text renderable was passing through verbatim, then word-wrap
ate the spaces around '#' and '##'.
3. **<>Fragment</> wrapping the inner content** — Fragments don't
establish a layout box; the renderable was free to flow children in
weird ways. The position-absolute outer box wasn't enough to constrain
line breaks per-text.
## Fix
- Wrap inner content in <box flexDirection='column'> so each <text> is
one explicit line.
- Drop wrapMode='word' from the body; let opentui's natural per-text
layout handle line bounds.
- Pre-flatten the scope: strip code fences, headings, emphasis markers,
and collapse whitespace to single spaces. This makes the preview a
proper one-paragraph blurb instead of attempting to render markdown
inside a 60-col tooltip.
- Compute title / meta / scope-preview as plain strings before render.
- Drop the <b> wrapper around title (use attributes={1} on <text> instead,
matching the pattern in routes/session/sidebar.tsx).
## Verified
bun typecheck clean. Local install reports
1.15.10-grunt.7+local.f9cad9dea.dirty.1 parent f9cad9d commit 0d4a394
1 file changed
Lines changed: 38 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
19 | 35 | | |
20 | 36 | | |
21 | 37 | | |
| |||
25 | 41 | | |
26 | 42 | | |
27 | 43 | | |
28 | | - | |
| 44 | + | |
29 | 45 | | |
30 | 46 | | |
31 | 47 | | |
| |||
35 | 51 | | |
36 | 52 | | |
37 | 53 | | |
38 | | - | |
39 | 54 | | |
40 | 55 | | |
41 | 56 | | |
| |||
47 | 62 | | |
48 | 63 | | |
49 | 64 | | |
| 65 | + | |
50 | 66 | | |
51 | 67 | | |
52 | 68 | | |
| |||
55 | 71 | | |
56 | 72 | | |
57 | 73 | | |
58 | | - | |
| 74 | + | |
59 | 75 | | |
60 | 76 | | |
61 | 77 | | |
| |||
68 | 84 | | |
69 | 85 | | |
70 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
71 | 97 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
77 | 101 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
96 | 105 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 106 | + | |
| 107 | + | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
| |||
0 commit comments