…ry.swift
Behavior-preserving relocation: move the text-entry concern out of the (formerly 1805-line)
RunnerTests+Interaction.swift — the repo's most-changed file — into a new
RunnerTests+TextEntry.swift. Interaction.swift drops to 1068 lines (-737).
Moved verbatim (no logic changes):
- value types: TextTypingRepairMode, TextEntryTiming, TextEntryResult, TextEntryTarget
- the focus -> type -> verify -> repair pipeline (typeTextReliably + focus orchestration +
readiness polling + dropped-char/repair heuristics)
- clearTextInput and the text-entry leaf helpers (editableTextValue, isPlaceholderValue,
isGenericTextInputLabel, normalizedElementText, moveCaretToEnd, estimatedDeleteCount,
keyboardBecameVisible, keyboardElementExists)
The whole cluster is text-entry-exclusive (its only callers are within the moved code or the
already-internal command entry points), so every symbol keeps its original visibility — no
access widened. Shared helpers used by gestures/snapshot/get-text (isKeyboardVisible,
visibleKeyboardFrame, textInputAt, textInputCandidatesAt, readableText, ...) stay in
Interaction. The new file is auto-included via the project's file-system-synchronized group.
This is the safe, cosmetic half of the "TextEntry engine" architecture candidate. A deeper
extraction behind a real seam/type is intentionally deferred: it carries the #245 revert risk
and wants stronger text-entry e2e coverage first.
Verified: xcodebuild build-for-testing -> TEST BUILD SUCCEEDED. Pure relocation, no behavior change.
What
Behavior-preserving file split: move the text-entry concern out of
RunnerTests+Interaction.swift(the repo's most-changed file, formerly 1805 lines) into a newRunnerTests+TextEntry.swift. Interaction.swift drops to 1068 lines (−737).Moved verbatim — no logic changes:
TextTypingRepairMode,TextEntryTiming,TextEntryResult,TextEntryTarget)typeTextReliably+ focus orchestration + readiness polling + dropped-char/repair heuristics)clearTextInputand the text-entry leaf helpers (editableTextValue,isPlaceholderValue,isGenericTextInputLabel,normalizedElementText,moveCaretToEnd,estimatedDeleteCount,keyboardBecameVisible,keyboardElementExists)Why
Interaction.swiftmixed five unrelated concerns; text entry alone was >half of it. Splitting it out is the biggest single navigability/token win in the file, with no behavioral surface.Safety
internalcommand entry points (typeTextReliably,focusTextInputForTextEntry,resolveTextEntryMode,isTextEntryElement,waitForTextEntryReadinessAfterTap). The file-local leaf helpers stayprivate.Interaction.swift(used by gestures/snapshot/get-text):isKeyboardVisible,visibleKeyboardFrame,textInputAt,textInputCandidatesAt,readableText,prefersExpandedTextRead,findScopeElement.pbxprojedit).xcodebuild build-for-testing→TEST BUILD SUCCEEDED. Behavior is unchanged by construction (pure move); text entry is exercised by the existing04-text-input-keyboard.adsmoke replay.Scope
This is the safe, cosmetic half of the "TextEntry engine" architecture candidate. A deeper extraction (a real
TextEntrytype behind a seam, making the pipeline unit-testable) is intentionally deferred — it carries the #245 interaction-handler-revert risk and wants stronger text-entry e2e coverage first.