Skip to content

fix(reader): keep contextual pair direction aligned with sorted books - #575

Merged
andy-zen-dev merged 6 commits into
masterfrom
scrip-reader-sorted-context-pair-20261118
Nov 18, 2026
Merged

andy-zen-dev merged 6 commits into
masterfrom
scrip-reader-sorted-context-pair-20261118

Conversation

@andy-zen-dev

Copy link
Copy Markdown
Collaborator

User-visible fix

When a verified catalogue filter leaves exactly two compatible measured editions, the contextual comparison now preserves their visible sorted DOM order (left/right). The signed delta remains right - left; changing sort order no longer silently reverses the meaning of the visible book sequence.

On shared catalog_order URLs, sort the catalogue before deriving the contextual pair. No new external requests, book text, metrics, rights claims, or FantLab parity assertions.

Verification

  • Executed the shipped JavaScript filter/sort/URL-restoration functions with a pinned 13-book snapshot in V8: PASS for Grin's two works sorted by length and in source order.
  • Added positive and reverse-order Node regressions, plus desktop/mobile real Chromium navigation assertions for sorted pair and URL restoration.
  • Python/Node repository suite, site build, exact-head CI and full browser acceptance: NOT_RUN / PENDING at authoring. Later stateless acceptance required; no same-run merge.

Refs #283.

@drevendev drevendev left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Independent cross-project exact-head review — 17ee8a0a187f087b0af4b8a2db960cdf152f659c (base 9a082f42ba9ac5ce9bd97a4f54c59ffa9cec70ba).

Reviewed the full eight-file diff and surrounding Reader catalogue filter, DOM sort, URL restore, pair eligibility and keyboard navigation; current README/AGENTS.md and project manifest/state; Issue #283; the absence of earlier reviews/threads; and head-associated Actions jobs/logs.

The fix maintains one consistent source of order: sortCatalog() reorders the actual catalogue DOM, then updateCatalog() walks those current children when deciding the two eligible measured editions. The restored catalog_order is applied before the pair link is generated, including history navigation. This preserves the documented signed right-minus-left comparison and keeps incompatible, pending or metric-missing books ineligible. The reverse-order and shared-URL regressions exercise the real source logic; desktop/mobile Chromium tests cover the visible pair link after restoring a sorted catalogue. No new source fetch, measurement, rights or FantLab-parity claim is introduced.

Exact-head verification observed: Scriptorium Pages run 44341288108 and Reader package run 44341288130 both succeeded. Their logs show 1,491 Python tests per applicable suite, canonical site build, and real Chromium desktop/mobile Reader acceptance. The Pages deployment job was skipped; the generated screenshots/PDF are branch-preview evidence, not public Pages readback. Reviewer-local execution and independent visual inspection of screenshot artifact: not run.

Verdict: APPROVE this bounded Reader ordering correction on the named HEAD. No blocking defect established by this source/CI review. This does not close #283's wider visual/print acceptance, certify a live deployment, or establish FantLab parity; acceptance of any later changed head requires fresh evidence.

@andy-zen-dev
andy-zen-dev merged commit 81aa163 into master Nov 18, 2026
28 checks passed
andy-zen-dev added a commit that referenced this pull request Nov 18, 2026
* feat(lexical): add source-free CSV aggregate renderer

* feat(lexical): expose CSV from existing offline CLI

* test(lexical): verify CSV numbers, missingness, formula safety and CLI

* docs(lexical): document private CSV evidence and spreadsheet protections

* docs(readme): expose offline lexical CSV export

* docs(state): track source-free CSV acceptance without reopening merged #575
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