Skip to content

Commit c718821

Browse files
committed
style(transcript): the chevron trails what it discloses
"Ran 2 commands ⌄", not "⌄ Ran 2 commands" — matching the reference. Flipped in BOTH headers, not just the group. A trailing chevron on the group summary and a leading one on a command card would be two disclosure controls disagreeing inside the same transcript, which is a worse inconsistency than the one being fixed. It hugs the label rather than right-aligning to the card edge. A disclosure control belongs beside the thing it opens; a chevron alone at the far right of a wide row reads as unrelated chrome. Change counts (+42 -8) stay trailing after it — they are status, not a control. Moved in the MARKUP rather than with CSS `order`, so tab order and visual order stay the same thing. The guard pins that too: reordering with `order` would satisfy a looks-right-on-screen check while leaving a keyboard user tabbing through a line backwards. Bypass-verified by flipping it back. 21 tests in groupReducer, 38 suites green.
1 parent a1173fd commit c718821

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

extensions/levelcode-ai/media/chat.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,11 @@
528528
.tl-group.gok .tl-node .ci, .tl-group.gfailed .tl-node .ci { width: 18px; height: 18px; }
529529
@keyframes nodepulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
530530
.tl-cmd .cmdhead { display: flex; align-items: center; gap: 7px; min-width: 0; cursor: pointer; user-select: none; padding: 2px 0; }
531-
.tl-cmd .cmdchev { flex: 0 0 auto; display: inline-flex; color: var(--muted); }
531+
/* The chevron TRAILS what it discloses, matching the reference: "Ran 2 commands ⌄", not
532+
"⌄ Ran 2 commands". It hugs the label rather than right-aligning to the card edge — a
533+
disclosure control belongs next to the thing it opens, and a chevron alone at the far right of
534+
a wide row reads as unrelated chrome. */
535+
.tl-cmd .cmdchev { flex: 0 0 auto; display: inline-flex; color: var(--muted); margin-left: 1px; }
532536
.tl-cmd .cmdchev .ci { width: 11px; height: 11px; transition: transform .15s ease; }
533537
.tl-cmd.collapsed .cmdchev .ci { transform: rotate(-90deg); }
534538
.tl-cmd .cmdverb { flex: 0 0 auto; font-size: 12.5px; color: var(--vscode-foreground); }
@@ -2167,9 +2171,9 @@
21672171
'<div class="tl-rail"><span class="tl-node">' + codicon('sync') + '</span></div>'
21682172
+ '<div class="tl-body">'
21692173
+ '<div class="grouphead cmdhead" title="Expand / collapse">'
2170-
+ '<span class="cmdchev">' + codicon('chevron-down') + '</span>'
21712174
+ '<span class="groupmark"></span>'
21722175
+ '<span class="grouplabel"></span>'
2176+
+ '<span class="cmdchev">' + codicon('chevron-down') + '</span>'
21732177
+ '<span class="groupcounts"></span>'
21742178
+ '<button class="groupstop" hidden title="Stop the running command">' + codicon('stop-circle') + '</button>'
21752179
+ '<span class="cmdstate groupstate running">' + LC_DOTS + '</span>'
@@ -2574,8 +2578,8 @@
25742578
'<div class="tl-rail"><span class="tl-node">' + codicon('terminal') + '</span></div>'
25752579
+ '<div class="tl-body">'
25762580
+ '<div class="cmdhead" title="Collapse / expand">'
2577-
+ '<span class="cmdchev">' + codicon('chevron-down') + '</span>'
25782581
+ '<span class="cmdverb">' + (m.background ? 'Running in background' : 'Running') + '</span>'
2582+
+ '<span class="cmdchev">' + codicon('chevron-down') + '</span>'
25792583
+ '<span class="cmdchips">' + chips + '</span>'
25802584
+ '<span class="cmdstate running">' + LC_DOTS + '</span>'
25812585
+ '</div>'

extensions/levelcode-ai/test/groupReducer.test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,4 +374,26 @@ test('FALLBACK: an unrecognised step is named, not counted', () => {
374374
'name the first and count the rest, sentence-cased like every other path: ' + out);
375375
});
376376

377+
378+
test('CHEVRON: the disclosure control TRAILS what it discloses', () => {
379+
// "Ran 2 commands ⌄", not "⌄ Ran 2 commands" — matching the reference. Pinned on DOM order, not
380+
// on CSS `order`, so the tab order and the visual order stay the same thing.
381+
const html = fs.readFileSync(path.join(__dirname, '..', 'media', 'chat.html'), 'utf8');
382+
383+
const head = html.slice(html.indexOf("'<div class=\"grouphead cmdhead\""), html.indexOf("'<div class=\"groupbody\""));
384+
assert.ok(head.indexOf('grouplabel') < head.indexOf('cmdchev'),
385+
'the group chevron must come AFTER the label');
386+
assert.ok(head.indexOf('groupmark') < head.indexOf('grouplabel'),
387+
'the outcome glyph still leads the line');
388+
assert.ok(head.indexOf('cmdchev') < head.indexOf('groupcounts'),
389+
'the chevron hugs the label; counts stay trailing chrome');
390+
391+
const cmd = html.slice(html.indexOf("'<div class=\"cmdhead\" title=\"Collapse / expand\""), html.indexOf("'<div class=\"cmdbox\""));
392+
assert.ok(cmd.indexOf('cmdverb') < cmd.indexOf('cmdchev'),
393+
'a command card must flip too, or the two disclosure controls disagree');
394+
395+
assert.ok(!/\.cmdchev[^{]*\{[^}]*order:/.test(html),
396+
'do not reorder with CSS `order` — it desynchronises tab order from what is on screen');
397+
});
398+
377399
console.log('groupReducer: ' + n + ' tests passed');

0 commit comments

Comments
 (0)