| 1 | # Browser menus and column auto-fit |
| 2 | |
| 3 | Requested by Paul, 2026-09-16: fix File → New sheet, audit other inert menu |
| 4 | items, and support fitting one or several columns by double-clicking a divider. |
| 5 | |
| 6 | The New sheet form and server route were already wired. Reproduced with actual |
| 7 | server-rendered markup/assets: Chromium submitted it, WebKit did not. WebKit |
| 8 | blurs a menu summary without focusing the clicked button; the focusout handler |
| 9 | closed the menu before click could activate the button. Keep that menu open |
| 10 | when the pointer is activating an item inside it. Keyboard departures, Escape, |
| 11 | and outside clicks continue to close it. |
| 12 | |
| 13 | The audit also found grid keyboard handling swallowing native menu activation, |
| 14 | and menu arrow handling intercepting number-field stepping. Menu keys remain |
| 15 | inside the menu; resize fields retain their native editing/submission behavior. |
| 16 | |
| 17 | Column auto-fit measures displayed content with each cell's rendered font, |
| 18 | letter spacing, padding, and borders. It includes loaded rows below the viewport |
| 19 | and header labels. A double-click on the existing right-edge resize handle fits |
| 20 | that column, or each column in the current selection when it includes that |
| 21 | handle. Format → Auto-fit columns provides the keyboard/menu equivalent. |
| 22 | Widths are bounded by the existing 16–2000px server limits. Truncated sheets |
| 23 | report that auto-fit measures only loaded grid contents. A failed write stops |
| 24 | the remaining columns. Multi-column manual resizing now persists every column, |
| 25 | with ordered requests rather than racing full-size-table responses. |
| 26 | |
| 27 | Validation: |
| 28 | |
| 29 | - `TestBrowserMenuFixture` exports a synthetic server-rendered page and its real |
| 30 | linked assets, without session cookies, for browser component checks. |
| 31 | - `tools/drive/menu-actions.mjs` activates every menu link, form, command and |
| 32 | formatting choice in Chromium and WebKit against mocked transport. It also |
| 33 | checks keyboard submission, resize stepping, Escape and outside clicks. |
| 34 | - `tools/drive/autofit.mjs` exercises fresh-grid double-click, selected headers, |
| 35 | offscreen formatted values, independent widths, persisted widths on reload, |
| 36 | manual group resizing, formula display values, bounds and failed-write retry. |
| 37 | |
| 38 | Source review: GPT-6 Astra, 2026-09-16; no remaining blocking findings after |
| 39 | fixing fresh-grid divider fitting and matching the vendor's resize hit area. |
| 40 | Deployed-canary review remains outstanding; these checks are component tests, |
| 41 | not deployed-server approval. |
| 42 | |