Repository navigation
Focus the reader on reader-first chapters, and test the map-first half - #520
Conversation
A map-card, search or breadcrumb arrival at a desktop shelf or context chapter opened the reader but focused the first map card, because mapRequested still read ui$scopeOverview. On desktop it now reads ui$coarseOverview, so focus goes to the reading heading; phones keep ui$scopeOverview. Topic-card pages keep map focus. A chapter over 120 nodes with no local links drew no cards but still set ui$coarseOverview, so it opened map-first on an empty map with the reader collapsed. The oversized clause now also needs a drawn card. Tests: the map-card arrival focuses the reading heading at the hub and shelf chapters; a Node case checks the desktop and phone halves of the focus rule; a 121-statement linked chapter keeps the overview class, the collapsed reader and the 0.9 floor; the flat 1,000-statement chapter opens with a reader at least 340 px wide; a Node case checks that only a coarse overview stops zoom-out at 0.9; and the phone Back test also checks that the two maps draw no shared card on screen.
# Conflicts: # autoform_cli/assets/blueprint-explorer.min.js
|
Review at ba1c880: nothing blocks; ready to merge. This is the authoring session's review. A separate agent that did not write the change reviewed the commit's first version, 9d64e81, before this PR opened, and its fixes are in. It found one blocker: the CHANGELOG said every reader-first arrival focuses the heading, but pages made only of topic cards keep map focus, as Posted by PR swarm: 320-329 Reviewer |
Follow-up to #507. It covers the review notes there that are fixes or missing tests (review): notes 2, 3, 5 and 6. Notes 1 and 4, whether navigation-only pages should open map-first, are left for Jack.
Problem
mapRequestedinapplyRoutestill readsui$scopeOverview, which is true for shelves and context cards. Fix phone Back after a closed reader, and open desktop chapters with the reader #507 moved the reader default toui$coarseOverview, but not this line.structuralScopeProjectiondraws no cards, only the "Not on the map" shelves. TheoriginalNodes > MAX_MAP_NODESclause still setsui$coarseOverview, so the chapter text sits behind the 48 px handle.Change
mapRequestedreadsui$coarseOverviewon desktop andui$scopeOverviewon phones, the same split as the reader default insetSheet. Pages made only of topic cards keep map focus, as before.ui$coarseOverviewalso needs a drawn card (overview.nodes.length).geometry(),fit(),sceneFrameand the layout are untouched.Tests
tests/test_integrated_reader_first_browser.py(WebKit, 1440×900):.bp-reading-body h1(the test waits up to 10 s, since focus follows the reader's math pass);tests/test_dag_viewer_browser.py: the flat 1,000-statement chapter opens without the overview class and with a reader at least 340 px wide. Its old check,to_contain_text, passed while the reader was collapsed.tests/test_integrated_reader_focus.py: a Node case for both halves of the focus rule. On a shelf scope withmapFirst, the desktop reader opens and takes focus, and the phone keeps the reader closed and focuses the map.tests/test_scoped_overview_controls.py: a Node case where an authored-area overview stops zoom-out at 0.9 and, with the areas removed, the shelf overview does not.tests/test_integrated_phone_back_browser.py: before Back, the test also reads the cards each map draws on screen and asserts that they share none. Cards are drawn only near the viewport, so this complements the index check rather than replacing it.ui$scopeOverview: both WebKit focus cases fail (run 41165282694), and so does the desktop half of the Node case; usingui$coarseOverviewon phones too fails its phone half (both Node checks run locally);Landing
Posted by PR swarm: 320-329 Reviewer