Repository navigation
[M11] Hero live console: memtable towers and WAL tail (M11.4) - #93
Conversation
Story M11.4. The console reads one snapshot after every call and draws it: one tower per key in key order, as many blocks tall as the level the skip list gave that node, with tombstones greyed and labelled; the last six log records with offset, kind, key, byte length and checksum; and a tile per table on disk with its record count and key range. The compact control appears only when the engine's own plan has a tier ready. The controls are a form, so Enter in either field writes the record and the whole flow runs from the keyboard. An empty key is refused with a message tied to the field by aria-describedby, and a long key is clipped on screen while the full key stays in the page and in the engine. Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QWNkuNh5Bysnfo2KrxL9Sp
Reviewing the console at 390 wide showed the four column row squeezing the key to three characters while the checksum kept 150px. A container query on the fragment, rather than on the viewport, drops the byte count and the checksum to a second line once the console is under 460px, so the key keeps its width. A Playwright assertion at 390 holds it there. Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QWNkuNh5Bysnfo2KrxL9Sp
|
Screenshot review, and the one change it caused. CI was green on the first head (
As on #92: the Generated by Claude Code |
Turns the hero console into the live instrument section 6 describes: the memtable drawn as skip list towers, the log tail, SSTable tiles, and a compact control that appears only when the engine has a merge to run.
What changed
Tower.tsx: the motif at true size. One block per level, bottoms on one line, heights straight from the snapshot. Decorative in the accessibility tree, because the level is already announced in the text beside it.Console.tsx: the three panels now draw the snapshot rather than list it.<form>, so Enter in either field is the put. An empty key is refused before the engine is called, with the reason in a message tied to the input byaria-describedbyandaria-invalid, and focus returned to the field. Long keys are clipped withtext-overflowand carried whole intitleanddata-key.snapshot.compaction.needs_compactionis true, so the page cannot offer a mergecompactOncewould decline.console.spec.ts: ten specs, all reading the page rather than the worker.Acceptance criteria
compactOnce.aria-describedby; long keys are truncated visually, never in the data.What ran, and what passed
All of it, locally in this sandbox:
pytest: 1244 passed.ruff check src testsandruff format --check src tests: clean. No Python changed in this story.web/:npm ci,npm run lint,npm run typecheck,npm run build: clean.npx playwright test: 46 passed across both projects (default andchromium-reduced-motion). Playwright ran locally, not only in CI.The tower height assertion is not a restatement of the attribute it reads: the test takes each tower's
data-level(rendered straight from the snapshot), then measures the drawn stack and checks both the block count and the pixel height againstlevel * --block + (level - 1) * --block-gap. The compact test drives four real flushes until the engine's default policy (four comparable tables to a tier) makes a tier ready, then merges and watches four tiles become one.The M11.3 house-rules audit is reused here rather than duplicated: it is run again with the empty-key error on screen, since that message is running text the resting page never shows, and again at 390 wide with towers, a log tail and a tile populated, since the house rules at 390 are otherwise only checked on an empty console. Both pass with no violations and no horizontal overflow.
I also drove the console by hand at 1440 (three puts, a flush, two more puts, a delete) and looked at the result: towers with real levels and a greyed tombstone, six log rows with rising offsets and real checksums, and a tile reading 3 records over the right key range.
Decisions taken without asking
--muted, not maroon. Section 3 reserves the maroon family for the stage, the primary button, the active segment, the heading tile and the cta field. A tombstone drops to--surface-3, which is the tone step section 6 asks for, and the word "deleted" under it carries the same meaning without colour.resetcontrol stays, though this story does not list it: it arrived with M11.2, it is how a visitor starts over, and removing it would take away working behaviour.No motion was added. The tower build, the flush move and the rest of section 8 are story M11.9.
Closes #82
Generated by Claude Code