Public: anyone can read this; the crew can change it.

A test proves hotkey hints never shift a page, and design-lint refuses an inline keyhint outside menus and tooltips #16741

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Most of this was already on main. I added two tests in test/hotkey-hints.test.ts, and the first only partly meets the "every box the same size and place" item, because nothing in the sandbox can measure a layout.

Notes

opened this

Most of this was already on main. I added two tests in test/hotkey-hints.test.ts, and the first only partly meets the "every box the same size and place" item, because nothing in the sandbox can measure a layout. test/hotkey-hints.test.ts passes (18 tests), and bun scripts/gate.ts --fix, bun x tsc --noEmit and bun scripts/design-lint.ts came back clean.

Already on main (#8930)

  • design-lint already has a keyhint rule in quiet(). It flags an inline keyHint( or <kbd class="keyhint"> outside a menu item or palette row, and the keyhint count in docs/design/quiet-debt.json is 0.
  • Existing tests already cover the CSS source of the hint chip and the rule that refuses a stray hint.

Added

  • Shown vs hidden: the first page response has no data-hints on <html>, so the markup is identical either way. Every stylesheet rule that applies only while hints are shown (html[data-hints] …) may set paint properties only, such as opacity, and never a box property. A rule that tried to size something while hints show would fail this test. This is a source check, not a measured layout.
  • Lint output: a stray keyHint( yields rule keyhint at the right line number (checked with line 2 of a two-line sample) and points to hintAttr.

Left out

  • Measured boxes: no browser or layout engine is available in the sandbox, only happy-dom, which does no layout. The pull's preview is the place for a real measured before/after.
  • Before and after looks: none attached. Nothing visible changed, since this adds tests only.
  • src/web/ui.ts: untouched.

To try

  • bun test test/hotkey-hints.test.ts
  • bun scripts/design-lint.ts

No new function was written, so there was nothing to reuse.

🤖 Generated with Claude Code

Closes #9014

commented

Most of this was already on main. I added two tests in test/hotkey-hints.test.ts, and the first only partly meets the "every box the same size and place" item, because nothing in the sandbox can measure a layout. test/hotkey-hints.test.ts passes (18 tests), and bun scripts/gate.ts --fix, bun x tsc --noEmit and bun scripts/design-lint.ts came back clean.

Already on main (#8930)

  • design-lint already has a keyhint rule in quiet(). It flags an inline keyHint( or <kbd class="keyhint"> outside a menu item or palette row, and the keyhint count in docs/design/quiet-debt.json is 0.
  • Existing tests already cover the CSS source of the hint chip and the rule that refuses a stray hint.

Added

  • Shown vs hidden: the first page response has no data-hints on <html>, so the markup is identical either way. Every stylesheet rule that applies only while hints are shown (html[data-hints] …) may set paint properties only, such as opacity, and never a box property. A rule that tried to size something while hints show would fail this test. This is a source check, not a measured layout.
  • Lint output: a stray keyHint( yields rule keyhint at the right line number (checked with line 2 of a two-line sample) and points to hintAttr.

Left out

  • Measured boxes: no browser or layout engine is available in the sandbox, only happy-dom, which does no layout. The pull's preview is the place for a real measured before/after.
  • Before and after looks: none attached. Nothing visible changed, since this adds tests only.
  • src/web/ui.ts: untouched.

To try

  • bun test test/hotkey-hints.test.ts
  • bun scripts/design-lint.ts

No new function was written, so there was nothing to reuse.

🤖 Generated with Claude Code

commented

Left #9014 open: 2 unticked items remain (A test renders a page with hints shown and hidden and finds every box the same size and place.; Before and after looks on the pull.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs