Skip to content

Sheets: on a phone the grid starts on the first screen: the description folds to two lines, and one Download button - #3

Merged
jamescalam merged 3 commits into
mainfrom
sheets-206
Nov 15, 2026
Merged

jamescalam merged 3 commits into
mainfrom
sheets-206

Conversation

@jamescalam

@jamescalam jamescalam commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

At 390 px the title, about six lines of description, two rows of buttons and the status line came before the grid. The grid started 438–460 px down an 844 px screen.

What changed (phone width only; wider screens draw the header exactly as before)

  • The description folds to two lines. "more" at the end of the second line, or a tap on the description, opens the rest, and "less" folds it again. "more" shows only when there is more. That is checked after each draw, on resize, on font load, and when a push changes the description (ss:live).
  • One Download button holds "CSV (this tab)" and ".xlsx (all tabs)". From the keyboard it opens onto the first choice. Esc, a choice, or a tap outside closes it. It's a disclosure (aria-expanded, aria-controls), not an ARIA menu.
  • Enter on a focused button presses it. The grid's key handler sent Enter to the formula bar from anywhere but a field, so Enter on "Show formulas" did nothing. This is a fix to existing behaviour.
  • Open states are a class and attributes that the sheet's data never changes. A save that morphs the page in place keeps them when it has the page before, and closes both cleanly when it doesn't.

Results, two saved sheets rebuilt from this template, 390 × 844

Grid's top Rows whole on screen
Job tracker, before → after 460 → 321 px 7 → 10
Sales pipeline, before → after 438 → 321 px 8 → 10

Every control is still at least 44 px tall, day and night. At 1440 the header is pixel-identical to before, day and night.

Testing

  • node tests/run.js: 72 passed. npx spacesheep skills lint: well-formed, hash 5d58f966d8ef.
  • In Chromium (Playwright), on both sheets: tapping "more" opens all lines and "less" folds them back; a tap on the description opens it. Download opens two 44 px choices; tapping CSV downloads the tab's .csv and closes the menu; a tap outside closes it. Enter opens Download onto its first choice, and Esc returns focus to Download. Enter on Show formulas presses it (before: focus went to the formula bar). No page errors.
  • With the platform's own morph code: a description arriving in the first push gets "more". Both open states survive a save that has the page before, and close with aria-expanded="false" when it doesn't. A description that fits shows no "more". The existing 38 morph, reload and typing checks all pass.

Worth a close look

  • The .lede element stays exactly as sheet.js writes it (its regex replaces <p class="lede" data-ss-id="lede">…</p>). The wrapper and button sit around it, not in it.
  • .dl and .dl-menu are display: contents above 600 px, so the two download buttons sit in the bar as before.

This PR is on top of the chart change (#1), which is on the budget fix (#2).

jamescalam and others added 3 commits November 15, 2026 11:35
… reads a cell

=SUMPRODUCT(A1:T10000, ...) with 16 ranges of 200,000 cells read each
range before SUMPRODUCT ran. The budget charged each read, so it ended
in #CALC! only at the 16th range, after 3 million cell reads: about
2 s on a laptop, and over 3 s on CI's runners, where the hostile test
timed out. A person's sheet with such a formula froze for as long.

Now, before a formula is worked out, the engine adds up the cells of
every range it is sure to read (all of them, except the parts of IF,
IFERROR, IFNA and IFS past the first, which may never be worked out).
Each of those reads would be charged its cells anyway, so a total past
the budget ends in #CALC! at once, with no cell read. A highlight's test
gets the same check. refRange's span moves into refSpan, which both use.

Co-authored-by: Pointman <noreply@pointman.ai>
Co-authored-by: Claude <noreply@anthropic.com>
…ay 12 px on a phone

The chart was a 760-unit drawing scaled to its box, so at 390 px its text
drew at about 6 px and the month labels ran together; at 1280 it scaled
up and "May 2026" touched "Jun 2026".

Now the drawing is as wide as its box (at most 860 px) and is drawn
again when that width changes. Its axes come from the engine's new
chartAxes, which the tests call:
- value steps are round (£0, £500, £1,000, £1,500), not quarters of the
  biggest bar;
- month labels drop the year when the title names their one year;
- labels sit in a row while they fit; months and dates then thin to every
  2nd, 3rd... one, and names are cut to 12 characters and angled, thinned
  only when even angled ones can't all fit;
- one series has no key when the title names it.

Co-authored-by: Pointman <noreply@pointman.ai>
Co-authored-by: Claude <noreply@anthropic.com>
…on folds to two lines, and one Download button

At 390 px the title, six lines of description, two rows of buttons and
the status came before the grid, which started at 438-460 px. Now, at
phone width only:

- The description shows two lines. "more" at the end of the second line,
  or a tap on the description, opens the rest; "less" folds it again.
  "more" shows only when there is more: checked after each draw, on
  resize, and when a push changes the description.
- "Download CSV (this tab)" and "Download .xlsx (all tabs)" sit under
  one Download button, as "CSV (this tab)" and ".xlsx (all tabs)". It
  opens from the keyboard onto the first choice; Esc, a choice, or a tap
  outside closes it.

The grid now starts at 321 px on both test sheets, with 10 rows whole on
an 844 px screen (was 7-8). Every control stays at least 44 px. Wider
screens draw the header exactly as before.

The open states are a class and attributes the page never writes, so a
save that morphs the page in place keeps them when it has the page
before, and closes both cleanly when it doesn't.

Also: Enter on a focused button now presses it. The grid's key handler
took Enter to the formula bar from anywhere but a field, so Enter on
"Show formulas" (or Download) did nothing.

Co-authored-by: Pointman <noreply@pointman.ai>
Co-authored-by: Claude <noreply@anthropic.com>
@jamescalam
jamescalam changed the base branch from sheets-222 to sheets-216 November 15, 2026 03:51
@jamescalam jamescalam mentioned this pull request Nov 15, 2026
@jamescalam
jamescalam changed the base branch from sheets-216 to main November 15, 2026 04:35
@jamescalam
jamescalam merged commit 564db7d into main Nov 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant