Skip to content

Address every page-map item - #126

Merged
max-sixty merged 3 commits into
mainfrom
codex/page-map-item-addresses
Aug 30, 2026
Merged

max-sixty merged 3 commits into
mainfrom
codex/page-map-item-addresses

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The Page map counted every right-margin location while g m numbered only visible informational markers. That shifted numeric addresses on the shipped review page and left action-only Cut and Edit locations unreachable.

This change makes one page-ordered target collection authoritative for Page-map counts, marker positions, sheet order, and g m addresses. Informational arrivals keep their preview behavior on desktop and use the Page-map sheet on compact screens; action-only arrivals focus their first available action without invoking it.

Verification:

  • uv run pytest tests (728 passed, 1 skipped)
  • uv run pre-commit run --all-files
  • bin/leaf version check .tmp/preview --render
  • matched ship-review browser comparison plus wide/compact address coverage

This was written by Codex on behalf of @max-sixty

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two findings, both checked by running the changed test on this checkout.

The Page-map/marker/g m unification itself reads right: one page-ordered collection feeding the count, the marker labels, the sheet order and the address list is the shape the address table already claims for g h and g f (the whole document, not what is on screen), and dropping the visible-only filter is what makes the announced "n of m" and the address agree.

Comment thread tests/test_render_margin.py Resolved
@max-sixty
max-sixty merged commit b314c1a into main Aug 30, 2026
7 checks passed
@max-sixty
max-sixty deleted the codex/page-map-item-addresses branch August 30, 2026 16:07
max-sixty pushed a commit that referenced this pull request Aug 30, 2026
## Problem

[Run
33320898593](https://github.com/max-sixty/leaf/actions/runs/33320898593)
failed with 68 tests red on 07373f4. Sixty of those were already red on
the commit before it and are what #127 is about; thirteen were new, and
eleven of those have since been fixed or renamed away by #125, #126, or
#127's branch — I ran each of the thirteen at `main` and on #127's
branch to sort them. What is left, failing on `main` and on #127's
branch alike, is `test_the_chrome_a_key_opens_has_no_serious_violations`
at both `[420-light]` and `[420-dark]`: axe reports a serious
`target-size` violation on the panel's page-reaction trigger, standing
on the comment list.

The trigger is 29.5×21.5px, which passes `target-size` on spacing alone
— until something else to press moves next to it. Over a covering panel
the key line and the toast are lifted above the sheet's foot, and [that
lift was measured off the general composer's
height](https://github.com/max-sixty/leaf/blob/6794ddcc1286aa1d776060417aaf5dd145524da6/skills/leaf/assets/runtime/chrome-layout.js#L132-L135).
Once a page offers reactions the foot is two rows, not one:
`paintPageStrip` inserts the page's own reaction strip above the
composer, and the line was drawn straight over it. Measured at 420×900
with the panel covering, the line spanned y 767.7–827 and the strip's
trigger y 811.2–832.7. 07373f4 then widened the line to two rows, which
brought its `? more` button — the one part of the line that takes a
pointer — down to x 25–88.7, on top of the trigger at x 14–43.5. axe
measured 8.8px of safe clickable space between them. A reader aiming at
the reaction got the keyboard reference.

## Solution

The panel gets one foot box holding the strip and the composer, and the
lift is measured off that box. The strip is as fixed as the composer is,
so a lift that clears one has to clear both; the `ResizeObserver`
watches the foot too, so the strip appearing is the same kind of event
as the composer growing under a draft.

Lifting further puts the line back over the panel's scrolling thread
list, which is the third scroll region the line can stand over and the
only one that was not reserving room for it — the document reserves it
on `chromeRoot`, the trays' lists through `reserveListClearance`. The
list now spends the same measurement the same two ways (padding for a
wheel to the end, scroll-padding for a walk's scroll-into-view) while
the panel covers, and returns to the stylesheet's inset when the panel
steps back beside the page and the line is capped clear of it.

Same page and window after the change: foot 797.2–900, line 723.7–783,
trigger untouched at 811.2–832.7, list reserving 79px at its end.

## Testing

`test_a_covering_sheet_lifts_the_key_line_over_all_of_its_foot` is new.
It asserts the foot is genuinely taller than its composer first, so a
page with no strip cannot green it, then that the line clears the foot
and the trigger, that the list reserves at least as much of its own end
as the line stands on, and that the reservation is returned beside a
wide panel. Reverting either half of the fix in turn fails it on the
matching assertion.

<details><summary>Runs</summary>

- `uv run pytest tests` — 723 passed, 6 skipped.
- `uv run pytest --run-nightly tests/test_render_controls.py` — the two
`[420-*]` cases now pass. Nine failures remain; the same nine fail on
`main` in the same file, and all nine are in run 33320898593's list.
- `uv run pytest --run-nightly` over `test_render_conversations.py`,
`test_render_navigation.py`, `test_render_margin.py`,
`test_render_pages.py`, `test_render_outbox.py`, `test_render_gate.py` —
20 failures, every one of them already in run 33320898593's list. No new
failure in any file.
- `pre-commit` on the four touched files: trailing-whitespace,
end-of-file-fixer, mixed-line-ending, ruff check, ruff format, prettier,
eslint, typos all pass.

`test_dynamic_chrome_offsets_keep_the_safe_area_in_their_arithmetic`
measured its expected key-line and toast bottoms from `.lf-general`,
which is now the wrong box wherever a strip stands; it reads
`.lf-panel-foot`. It is red on `main` for an unrelated reason — the
panel is drawn at `left: -15` on a window with a scrollbar gutter, which
is #121's subject — and stays red here.

</details>

---
Automated fix for [failed
run](https://github.com/max-sixty/leaf/actions/runs/33320898593)

Co-authored-by: leaf-agent <[email protected]>
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.

2 participants