Repository navigation
refactor(screens): extract focusedInputDialog priority cascade (audit 1.1.1) - #179
Merged
Merged
Conversation
…ocusedDialogSelector (audit 1.1.1)
The 92-line getFocusedInputDialog() priority cascade (20-literal return
union, 18 conditional returns, 23 deps incl. feature("ULTRAPLAN") x2 +
isInternalBuild() x2) was inlined in REPL.tsx:2450-2541 and untestable.
Extracted into src/utils/focusedDialogSelector.ts as a pure function
(aggregate-input pattern: 23-field FocusedDialogInput -> FocusedDialogKind
| undefined). feature("ULTRAPLAN") + isInternalBuild() are runtime checks
(non-React), safe to call from a pure helper; feature() string-literal
args are cross-file DCE-safe (precedent: src/utils/slowOperations.ts,
src/services/compact.ts). Byte-identical: body is the original expression
verbatim, REPL passes all bindings eagerly, downstream reads the same
const name.
REPL.tsx 6691 -> 6628 (-63). Cumulative off 7096: -468 LOC.
36 new tests cover all 18 reachable return arms + exit/typing/sandbox
gates + toolJSX animation gate + ant-only branches + priority ordering.
ultraplan-choice/launch arms are compile-time dead under feature-off
(test build) and cannot be unit-tested (Rule 9) -- documented.
Gates: typecheck 0 / 830 tests / lint net-zero new-files-clean / build:dev 3766.
Co-Authored-By: Claude Fable 5 <[email protected]>
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.
Eighth surgical extraction in the §1.1.1 god-module split (continues PRs #168/#171/#172/#174/#175/#177/#178).
What
The 92-line
getFocusedInputDialog()priority cascade (20-literal return union, 18 conditional returns, 23 deps incl.feature("ULTRAPLAN")x2 +isInternalBuild()x2) was inlined in REPL.tsx:2450-2541 and untestable.Extracted into
src/utils/focusedDialogSelector.tsas a pure function (aggregate-input pattern: 23-fieldFocusedDialogInput→FocusedDialogKind | undefined).Why
Dialog priority cascade is high-value pure logic (no React, no JSX) but inline → zero unit coverage. Lowest semantic risk despite 23 deps: body is the original expression verbatim, REPL passes all bindings eagerly, downstream reads the same const name → byte-identical.
feature("ULTRAPLAN")+isInternalBuild()are runtime checks (non-React), safe to call from a pure helper.feature()string-literal args are cross-file DCE-safe (precedent:src/utils/slowOperations.ts,src/services/compact.ts).LOC
REPL.tsx 6691 → 6628 (−63). Cumulative off 7096: −468 LOC (#168 −285, #171 −70, #172 −9, #174 −17, #175 −6, #177 −5, #178 −13, this −63).
Tests
36 new tests cover all 18 reachable return arms + exit/typing/sandbox gates + toolJSX animation gate + ant-only branches + priority ordering.
ultraplan-choice/ultraplan-launcharms are compile-time dead under feature-off (test build) and cannot be unit-tested (Rule 9) — documented.Gates
typecheck 0 / 830 tests (+36) / lint net-zero new-files-clean / build:dev 3766.
Co-Authored-By: Claude Fable 5 [email protected]