Print, word count, and a shortcuts sheet that cannot go stale
Three of the gaps Paul named, and the last two fill the Tools menu that has been sitting there greyed out since the menu bar landed. PRINT is window.print() plus a stylesheet, deliberately not a second PDF exporter — it is the browser printing the page you are looking at, and the PDF export is a different thing with its own File item. @page carries the geometry, matching pdf.go's own page size and margin, so [docs-page] gives up its padding rather than insetting the text twice. Widows, orphans and break-after on headings are the one typographic courtesy print gives away free. WORD COUNT segments with Intl.Segmenter rather than splitting on whitespace. Whitespace finds no word boundary at all in Japanese or Chinese — it would report 1 for a whole sentence — and this app declares twelve base locales. A count is exactly the kind of number people quote to each other, so being quietly wrong in eight of them is worse than being slightly slower in all twelve. The selection row hides rather than showing 0, because a zero cannot be told apart from an absence. THE SHORTCUTS SHEET IS READ OUT OF THE MENU BAR'S OWN DOM. A shortcuts screen is the most drift-prone thing in an application: every binding is stated twice, and the second copy is wrong within a month. The bar already renders every command's label and key, from the catalog, in the reader's locale — so that is the source, and a shortcut that stops being offered stops being documented automatically. The only rows written by hand are the four bindings no menu item carries, and they are the four a person most needs told: Tab and Shift+Tab are repurposed inside the document, Backspace undoes an autoformat, Shift+Enter breaks a line. Both dialogs are native <dialog> — modality, Escape, focus trapping and the backdrop are all easy to get subtly wrong by hand and none of them is the interesting part of either feature. Both are empty until opened and carry no strings of their own; the bundle fills in numbers and rows. Word count left the View menu, where it was listed twice.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
11 files changed,
+604
−18
.amadan/ci.d/10-gate+8 −0fixtures/editor-entry.js+29 −0fixtures/shortcuts.mjs+85 −0fixtures/wordcount.mjs+118 −0fixtures/wordcount.test.mjs+92 −0internal/docs/handlers.go+57 −0internal/docs/menu.go+2 −4internal/docs/render.go+29 −0internal/docs/static/editor.2c000feef616911e.js+0 −14internal/docs/static/editor.32d42be3a13c49bf.js+14 −0internal/docs/views/show.html+170 −0
.amadan/ci.d/10-gateLoading diff…
fixtures/editor-entry.jsLoading diff…
fixtures/shortcuts.mjsLoading diff…
fixtures/wordcount.mjsLoading diff…
fixtures/wordcount.test.mjsLoading diff…
internal/docs/handlers.goLoading diff…
internal/docs/menu.goLoading diff…
internal/docs/render.goLoading diff…
internal/docs/static/editor.2c000feef616911e.jsLoading diff…
internal/docs/static/editor.32d42be3a13c49bf.jsLoading diff…
internal/docs/views/show.htmlLoading diff…