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