This repository was archived by the owner on Aug 17, 2026. It is now read-only.
Repository navigation
Commit a924001
committed
fix(grunt/tui): hivemind sidebar — text wrapping for peer summaries + inbox (no more right-edge truncation) (#18)
Refs hivemind anomalyco#229. Nik caught visible truncation in screenshot — peer rows showing 'nik-t...' instead of 'nik-tab-2', summary lines clipped at card edge, inbox subject/body chopped to 'ack:' / 'CLAIM' fragments.
## Root cause
Sidebar interior width is ~38 cols (Sidebar is 42 wide, paddingLeft=2 + paddingRight=2). Opentui's <text> renderable clips horizontally by default — no auto-wrap on inline rows. Previous implementation crammed peer-id + summary on a single inline row which overflowed and got clipped at the right edge.
## Fix
Each peer / inbox row is now TWO explicit lines:
- **Peers**: line 1 = '· <peer-id> <relative-time>'. Line 2 = summary (wrapMode='word', truncated to 90 chars).
- **Inbox**: line 1 = '<sender>'. Line 2 = subject-or-body (wrapMode='word', truncated to 110 chars).
- **You section**: summary line gets wrapMode='word'; peer-id truncated to (SIDEBAR_INNER_COLS - 6) on overflow.
Plus a small truncate(s, max) helper that adds an ellipsis (…) so the eye sees that content was cut, not just disappeared.
Constants: SIDEBAR_INNER_COLS=38. Reflects the sidebar.tsx width=42 minus paddingLeft=2 + paddingRight=2.
## Verified
bun typecheck clean. Local install reports 1.15.10-grunt.7+local.0d4a394a8.dirty.1 parent c58c9a8 commit a924001
1 file changed
Lines changed: 46 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
| 15 | + | |
| 16 | + | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
| |||
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
21 | 33 | | |
22 | 34 | | |
23 | 35 | | |
| |||
44 | 56 | | |
45 | 57 | | |
46 | 58 | | |
47 | | - | |
48 | | - | |
| 59 | + | |
| 60 | + | |
49 | 61 | | |
50 | 62 | | |
51 | 63 | | |
52 | 64 | | |
53 | | - | |
| 65 | + | |
54 | 66 | | |
55 | 67 | | |
56 | | - | |
| 68 | + | |
57 | 69 | | |
58 | 70 | | |
59 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
60 | 74 | | |
61 | 75 | | |
62 | | - | |
| 76 | + | |
63 | 77 | | |
64 | | - | |
| 78 | + | |
65 | 79 | | |
66 | 80 | | |
67 | 81 | | |
68 | 82 | | |
69 | 83 | | |
70 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
71 | 87 | | |
72 | | - | |
| 88 | + | |
73 | 89 | | |
74 | 90 | | |
75 | 91 | | |
76 | 92 | | |
77 | 93 | | |
78 | | - | |
79 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
80 | 99 | | |
81 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
82 | 104 | | |
83 | | - | |
| 105 | + | |
84 | 106 | | |
85 | 107 | | |
86 | 108 | | |
87 | 109 | | |
88 | 110 | | |
89 | | - | |
| 111 | + | |
90 | 112 | | |
91 | | - | |
| 113 | + | |
92 | 114 | | |
93 | 115 | | |
94 | 116 | | |
95 | 117 | | |
96 | 118 | | |
97 | 119 | | |
98 | | - | |
99 | | - | |
100 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
101 | 129 | | |
102 | 130 | | |
103 | 131 | | |
| |||
0 commit comments