fix(platform-scripture): Select-All excludes not-in-reference books#2463
Draft
lyonsil wants to merge 1 commit into
Draft
fix(platform-scripture): Select-All excludes not-in-reference books#2463lyonsil wants to merge 1 commit into
lyonsil wants to merge 1 commit into
Conversation
Found by the quality-sweep run (qs-2026-06-26).
In Manage Books > Create > Based on template, "Select all" added books not
present in the reference project (the ones the grid disables), inflating the
selection count and tripping the missing-model preflight for books the
orchestrator would only filter out at submit time anyway.
The set that Select-All, the header tri-state checkbox, the count, and the
"{n} of {m} selected" announcement all derive from (selectableVisibleBooks) now
excludes not-in-reference books, sharing one predicate (isBookNotInCreateReference)
with the grid's pill-disabling logic so the two notions of "selectable" can no
longer drift. The grid's disabled condition is rewired through the same predicate
(behavior-preserving) to keep a single source of truth.
Extracted computeSelectableVisibleBooks + isBookNotInCreateReference as pure,
unit-tested helpers, matching the file's existing pure-helper pattern
(deleteConfirmVariant / computeCompareState).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lyonsil
added a commit
that referenced
this pull request
Jun 26, 2026
lyonsil
added a commit
that referenced
this pull request
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Manage Books → Create → Based on template: "Select all" was selecting books that are not present in the reference project — the books the grid renders as disabled. This inflated the selection count and tripped the missing-model preflight prompt for books the orchestrator would only filter out at submit time anyway.
The set that Select-All, the header tri-state checkbox, the selection count, and the "{n} of {m} selected" announcement all derive from (
selectableVisibleBooks) now excludes not-in-reference books. It shares a single predicate (isBookNotInCreateReference) with the grid's pill-disabling logic so the grid's "disabled" and the selection logic's "selectable" can no longer drift — the drift that caused this bug.Root cause
selectableVisibleBooksincluded disabled (not-in-reference) books, andtoggleAllVisible(Select-All) added all of them. The grid disabled those pills and an existing prune effect removed them on reference change, but Select-All re-added them.extensions/src/platform-scripture/src/manage-books-dialog/manage-books-dialog.component.tsx.Fix
manage-books-dialog.utils.ts(matching the existingdeleteConfirmVariant/computeCompareStatepure-helper pattern):isBookNotInCreateReference(book, …)— single source of truth for "not creatable from the reference project".computeSelectableVisibleBooks(…)— the genuinely-selectable set, excluding not-in-reference books.selectableVisibleBooksand the grid'sdisabledcondition to both use the shared predicate. The grid change is behavior-preserving (verified equivalent below).Minimal diff: 3 files, changes confined to one dialog. No opportunistic refactors.
Reproduction & regression evidence (RED → GREEN)
Backend/logic defect — reproduced with a failing unit test, then fixed.
Before (RED):
After (GREEN):
An independent reviewer ran the Revert Test: removing the fix's
.filter(…)fails exactly the regression test and nothing else.Self-review
Three adversarial reviews (architecture/correctness, scope/clarity, tests):
disabledcondition is provably equivalent to the original (verified by truth table including undefined reference state and empty present-set); noselectableVisibleBooksconsumer regresses; the header tri-state now correctly reaches "all selected"; complements (does not conflict with) the existing prune effect; no null/undefined hazards.A pre-existing, out-of-scope finding (the per-group
toggleAllInGroupheader does not filter disabled books — cosmetic, and after this fix it no longer affects the count or preflight) was recorded for follow-up rather than expanded into this PR.Impact & confidence
Provenance
Found by the automated quality-sweep run
qs-2026-06-26(cold-scan fallback; the Jira seed was unavailable this run, so the run degraded to backlog + cold scan). Scan dedup key:scan:platform-scripture:selectall-selects-disabled-books.AI-assisted — generated by Claude Opus 4.8 via the quality-sweep harness.
This change is