Repository navigation
refactor(mobile): the host-scoping rewrite moves out of the terminal's HTML - #22172
Conversation
…s HTML `scopeDocumentStyleToHost` and `scopeStyleToHost` are one rewrite of a flat stylesheet, and two page mounts read it: the terminal's and the rich Markdown editor's. The module lived under `terminal/terminal-webview-html/`, so the editor reached across the terminal's directory for it. It moves to `src/style-scoping/`, named for what it does rather than for its first caller, and both mounts import it from there. No re-export shim: the old path is gone. Its test does not follow it whole. Four of its five cases read the terminal's own sheets (`TERMINAL_DOCUMENT_*`, `XTERM_ENGINE_CSS`) and the first asserts `document-style.ts`'s split identity, which is not about the rewrite at all -- so that file stays in the terminal directory as `document-style.test.ts`, beside the module it is about. What moves is the part that names no caller: which selectors read as the document's own, and the sheet shapes both exports refuse. The page-closure pin names the module by path and is updated in the same commit. The closure is otherwise unmoved: 4,363 modules and 1,021 local before and after, one path swapped for another. The five generated artifacts are byte-identical -- none of them bundles this module. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe style-scoping helpers and related imports now use Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This change centralizes style-scoping helpers for terminal and rich Markdown mounts while preserving behavior and expanding contract coverage. It is mergeable with normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the implementation, rationale, affected files, and verification results. However, it omits most required template sections, including ELI5, Why, Linked Issue with an issue number, Visual Proof or an explicit N/A statement, AI Disclosure, Review, boundary confirmation, Notes, and the checklist. Resolution Add the missing required template sections. Provide a linked issue after
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Module move:
document-style-scoping.tsmoves byte-identically (R100) frommobile/src/terminal/terminal-webview-html/to a domain-neutralmobile/src/style-scoping/, with no re-export shim. Both page mounts and both tests import the new path. - Test split: the terminal test is renamed to
document-style.test.ts(R070) and keeps the four terminal-sheet cases; the newstyle-scoping/document-style-scoping.test.tsholds the caller-free contract (selector reader and the refused sheet shapes through both exports) plus one added no-selector case. - Pin update:
mobile-web-app-session-terminal-closure.test.mjsre-pins the module path inGAINED_OUTSIDE_THE_DOCUMENTand its docstring; everything else is a filename-only reference that stays valid.
All references to the old path are gone, the new directory is inside mobile's **/*.ts include, the top-level-only consumer census is unaffected, and the split preserves the caller-specific coverage. Verified the moved source exports all four symbols the tests import.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Summary
scopeDocumentStyleToHostmoves frommobile/src/terminal/terminal-webview-html/document-style-scoping.tstomobile/src/style-scoping/document-style-scoping.ts. The rewrite is domain-neutral: the terminal's web document mount and the rich Markdown editor's mount (C2) both read it, and the terminal directory was only its first caller. Pure move (git R100, byte-identical), no re-export shim; both mounts and the page-stylesheet test import from the new home.The old test file stays in the terminal directory, renamed
document-style.test.ts: four of its five cases read the terminal's own sheets (TERMINAL_DOCUMENT_ROOT_STYLE,TERMINAL_DOCUMENT_ELEMENT_STYLE,XTERM_ENGINE_CSS) and the first assertsdocument-style.ts's split identity, so moving it would have put an import of the generated terminal CSS into a domain-neutral directory, the shape the consumer census exists to forbid. A newstyle-scoping/document-style-scoping.test.tsholds the caller-free part (the document-level selector reader and the sheet shapes both exports refuse), plus one added case: a declaration block with no selector.What it touches
config/scripts/mobile-web-app-session-terminal-closure.test.mjs): the pinned path inGAINED_OUTSIDE_THE_DOCUMENTand its docstring. Closure measured with the five generators run first: 4,363 modules / 1,021 local before and after; the diff is one path swapped for another.Verification
Lane: mobile tsc 0, ratchet 0 (811 files, 126 grandfathered), oxfmt 0, mobile oxlint 0, root oxlint 0 (7 files), anti-slop 0, changed-code quality 0 across 7 files, React Doctor 0, config/scripts 252 passed / 2 skipped, targeted 13 files 101 tests exit 0. The lane's own full mobile run exited 1 on three 5 s timeouts under a 12-lane load (green alone).
Lead gate on 0338cbb against 895f2cf (gate-style-scoping-0338cbb740.log): tsc 0, ratchet 0, changed-code quality 0, react-doctor 0, anti-slop 0, root-format 0, max-lines 0, root-oxlint 0 (7 files), config/scripts 252 passed / 2 skipped, mobile 815 passed, machine-paths 0.