Skip to content

Commit b428ce2

Browse files
committed
revert(chat): put the original wordmark back — the new one breaks in Monaco
The wordmark from #82 shatters into disconnected bars in the editor. Reverted. WHAT I GOT WRONG. I claimed the art "cannot develop seams in any monospace font" because it is drawn entirely from `█`. Half of that reasoning was sound — `▀` above `▄` does leave a full cell of gap, which I verified — but the conclusion did not follow: whether `█` FILLS its cell is a property of the FONT, not of the character. Rendered across seven monospace families, the art is solid in SF Mono, Menlo, Courier New, Andale Mono, Consolas and the generic fallback, and shatters completely in Monaco. My harness ran SF Mono, so it looked perfect everywhere I checked, and none of those checks were the editor. The seam test I was so pleased with tested the right mechanism in the wrong place: one font, in a harness, instead of the font the webview actually resolves. The test guard went with it. It asserted "full blocks only", which encoded the false belief as a rule — it would have blocked the fix and waved through the bug. What survives is what this file can honestly check: the column/line bounds (real, and about layout rather than glyphs) and the accessible name. ASCII art has to be looked at in the target font; a static test cannot do it, so it no longer pretends to. The original 12x41 art is restored byte-for-byte from 8126086^. 33 tests in webviewCss, 34 suites green.
1 parent dd10c19 commit b428ce2

2 files changed

Lines changed: 23 additions & 26 deletions

File tree

extensions/levelcode-ai/media/chat.html

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,17 +1259,18 @@
12591259
<body>
12601260
<div id="log">
12611261
<div id="empty">
1262-
<div class="lc-ascii-wrap"><pre class="lc-ascii" role="img" aria-label="LevelCode AI">██ ███████ ██ ██ ███████ ██
1263-
██ ██ ██ ██ ██ ██
1264-
██ ██████ ██ ██ ██████ ██
1265-
██ ██ ██ ██ ██ ██
1266-
███████ ███████ ███ ███████ ███████
1267-
1268-
███████ ███████ ██████ ███████
1269-
██ ██ ██ ██ ██ ██
1270-
██ ██ ██ ██ ██ ██████
1271-
██ ██ ██ ██ ██ ██
1272-
███████ ███████ ██████ ███████</pre></div>
1262+
<div class="lc-ascii-wrap"><pre class="lc-ascii" role="img" aria-label="LevelCode AI">██╗ ███████╗██╗ ██╗███████╗██╗
1263+
██║ ██╔════╝██║ ██║██╔════╝██║
1264+
██║ █████╗ ██║ ██║█████╗ ██║
1265+
██║ ██╔══╝ ╚██╗ ██╔╝██╔══╝ ██║
1266+
███████╗███████╗ ╚████╔╝ ███████╗███████╗
1267+
╚══════╝╚══════╝ ╚═══╝ ╚══════╝╚══════╝
1268+
██████╗ ██████╗ ██████╗ ███████╗
1269+
██╔════╝██╔═══██╗██╔══██╗██╔════╝
1270+
██║ ██║ ██║██║ ██║█████╗
1271+
██║ ██║ ██║██║ ██║██╔══╝
1272+
╚██████╗╚██████╔╝██████╔╝███████╗
1273+
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝</pre></div>
12731274
<div class="lc-ascii-sub">levelcode.ai</div>
12741275
<div class="empty-copy">Ask about your code, or describe what to build. The open file is sent as context; add a selection with <b>+</b> or ⌥⌘A.</div>
12751276
<div class="starters">

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

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -578,25 +578,21 @@ test('TRANSCRIPT: the user bubble hugs its content, and is capped short of the c
578578
'tint is the secondary cue and still earns its place — side alone would drop on a wrapped log');
579579
});
580580

581-
test('WORDMARK: the empty-state logo is full blocks only, and fits its container', () => {
582-
// Drawn on a 10-row pixel grid with 2px strokes, then packed two pixel rows per text row. Because
583-
// every stroke is an even number of pixels, each pair collapses to a FULL block — no ▀ or ▄ survives.
584-
//
585-
// That is the property worth pinning, and it was learned the hard way. `▀` sits at the top of its
586-
// cell and `▄` at the bottom, so `▀` directly above `▄` leaves a full cell of empty space between
587-
// them: a seam straight through the letterform. A 1px-stroke font produces that constantly and
588-
// shatters. Full blocks tile seamlessly in any monospace font, so this art cannot develop seams no
589-
// matter what the user's editor font is.
581+
test('WORDMARK: the empty-state logo fits its container and has an accessible name', () => {
582+
// NOT asserted here: which characters it is drawn from. A previous version of this test required
583+
// full blocks only, on the theory that `█` tiles seamlessly while `▀`/`▄` can seam. Half of that is
584+
// right — `▀` above `▄` does leave a gap — but the other half is not: whether `█` FILLS its cell is
585+
// a property of the FONT, not of the character. In Monaco it does not, and a wordmark built on that
586+
// assumption shattered into disconnected bars in the editor while looking perfect in a harness
587+
// running SF Mono. The lesson is that this file cannot check the thing that actually matters, so it
588+
// should stop pretending to; ASCII art has to be looked at in the target font.
590589
const m = /<pre class="lc-ascii"[^>]*>([\s\S]*?)<\/pre>/.exec(html);
591590
assert.ok(m, 'the empty-state wordmark is gone');
592591
const art = m[1].replace(/^\n/, '');
593-
const glyphs = new Set(art.replace(/[\n ]/g, ''));
594-
assert.deepStrictEqual([...glyphs], ['█'],
595-
'the wordmark uses partial blocks: ▀ above ▄ leaves a seam through the stroke in most fonts. '
596-
+ 'Found: ' + [...glyphs].join(''));
597592

598-
// It is sized by the container (clamp(5px, 3.6cqi, 13px)) inside #empty, which is capped at 560px.
599-
// Past ~44 columns it stops fitting and the pre grows a horizontal scrollbar under the logo.
593+
// This bound IS checkable and is not about glyphs: the logo is sized from the container
594+
// (clamp(5px, 3.6cqi, 13px)) inside #empty, which is capped at 560px. Past ~44 columns it stops
595+
// fitting and the pre grows a horizontal scrollbar under the logo.
600596
const lines = art.split('\n');
601597
const cols = Math.max(...lines.map((l) => l.length));
602598
assert.ok(cols <= 44, 'the wordmark is ' + cols + ' columns; wider than ~44 overflows #empty (max 560px)');

0 commit comments

Comments
 (0)