Repository navigation
feat(mobile): the rich Markdown editor mounts on the page (OTA phase C, C7.10 C2) - #22099
Conversation
The markup gives the editable surface an id, and inside the WebView that is unambiguous because the document is the page. On the page it is not: a stack transition keeps the outgoing session screen mounted while the incoming one starts, so two hosts carry `#editor` at once and a page-wide `getElementById` hands both documents the first one. The seventh seam is the root, exactly as it is the terminal's ninth (ruling 24): the WebView names none of them and gets the whole page, the page names the element its mount planted the markup in. Red first, `vitest run src/components/rich-markdown/document-host-root.test.ts` against the page-wide read: 4 failed, 1 passed — content written into the second host landed in the first, both documents serialized the first surface, an edit in the second reported through the first document's host, and stopping the first took the listeners off the surface the second was still using. The one that passed is the control: a document with no root still reads the whole page, which is what the WebView gets. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The editor's sheet says `:root`, `*`, `html` and `body` because inside the WebView it owns the page. Appended to the head of a React Native Web application all four restyle every screen the shell can show, so the page mount may inject only what it owns — ruling 19's rule for `window.onerror`, applied to CSS. The terminal's half of the scoper drops those rules and repaints through a seam, because the colour `html, body` was setting belongs to the application. The editor has no such seam and needs none: its host element *is* that editor's page, so `scopeDocumentStyleToHost` moves the document's own rules onto the host — the variables every other rule reads, the surface colour, the font, the box model — and everything else hangs under it. A selector that merely starts at the document (`body p`) throws rather than being rewritten into something it did not say. Red first, `vitest run src/components/rich-markdown/page-stylesheet.test.ts`: 6 failed, 0 passed, all on the absent export. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…ces render The row of controls is not the WebView's: a press becomes an injected `runCommand` there and a call on the page, and neither difference belongs in the toolbar. Extracted so the page's editor does not declare fifteen rows of its own that would drift from the phone's. `MobileRichMarkdownToolbar.test.tsx` adds the fence a second copy would have needed: the row names every command in the contract, exactly once. Verified red by dropping `codeBlock` from the row — "names every command in the contract, once" failed on the 14-member list before the case went back. The native component's own test and the web fallbacks file stay green unchanged, which is what says the extraction moved nothing. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
`check-tests-typecheck-ratchet.mjs` reported the new file as newly failing `tsc -p tsconfig.test.json`: the `ScrollView` mock's spread did not match any `createElement` overload, and comparing a node's `ElementType` against the string `'Pressable'` is a no-overlap comparison. Host strings for the mock and `String(node.type)` for the read, rather than a cast. Ratchet back to OK at 800 files. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
`react-native-webview` renders nothing in a browser, so C7.6 gave the page a plain Markdown field and recorded the toolbar and the rendered view as a degradation. Ruling 26 makes that debt rather than done: the page mounts the document itself. `rich-markdown-web-document-mount.ts` is the editor's half of what `terminal-web-document-mount.ts` does for the terminal — the sheet held under the host's class, the markup planted in the host, one factory call, and a dispose that gives the host back. `MobileRichMarkdownEditor.web.tsx` is the component over it, with the same fifteen-command toolbar and the same controller the phone uses, so `MarkdownReader` cannot tell which sibling it has. Three seams are the page's rather than the window's. Messages reach `handleMessage` directly and never `window.ReactNativeWebView`, which on the page is the shell's bridge. The URL for Link and Image comes from `TextInputModal`: `window.prompt` was measured to return null in both shells, so those two commands silently did nothing. And no inset source is supplied, so `onKeyboardInsetChange` is never called — the screen's `keyboard-occlusion.web.ts` measures the same viewport with the same formula, and a report here would lift its bar twice. Red first, two runs. `rich-markdown-web-document-mount.test.ts`: 9 failed on the absent module, and its listener case is the one that holds ruling 21 — a second mount reports its own edits and the first mount's detached surface reports nothing, with an event dispatched on it to say so. The four new cases in `mobile-webview-editor-web-fallbacks.test.tsx`, run against the plain field still in the tree: 4 failed, 6 passed — no toolbar, no URL modal, and the `TextInput` the page is meant to have lost. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…census that can see it `#editor` computed to 14 px, measured in both engines. iOS zooms the page on focus of any editable under 16 px and does not zoom back, and `keyboard-occlusion.web.ts` answers 0 for the rest of the session at a scale other than 1 — the exact failure the floor exists for, on the page's only full-screen writing surface. The size now comes from the text-input seam, which is also where the two hosts part: the phone keeps the app's body size because a WebView has no page to zoom, the page gets the raise, and one binding moves both if the floor ever does. The `TextInput` census could not have caught it. `modulesDeclaringTextInput` matches JSX tags and `style` props, and this is a `contenteditable` in a markup string sized by a rule in a stylesheet. `mobile-web-app-editable-host-font-size.mjs` starts from the markup instead: it finds every editable host a closure declares, follows its id to the rule beside it, and reads the size the same way — a literal at or above the floor, or the seam's own export imported from the seam's module. An editable with no id, or one no sibling sheet styles, is reported unresolved rather than passed. Red first. The rule's own file reported `src/components/rich-markdown/document-style.ts:36` as the offender before the fix (4 failed, 3 passed on the first run, the other three being the brace scanner and the line-start anchor the fixtures found). The closure case in `mobile-web-app-session-terminal-closure.test.mjs` now names the editor as the one editable in the session route's closure and its offender list is empty: 1 passed, 4 skipped under `-t editables`. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…age insert Measured in the render check, on both engines: the Link and Image commands opened the modal, took the URL, and inserted nothing. The dialog is what takes the caret — the modal focuses its own field — and `execCommand` on a document that does not hold the selection does nothing at all. So the page had swapped one silent failure for another: `window.prompt` returning null on the phone, and a command with no selection on the page. Two halves. The document remembers its caret before it waits and puts it back after (`restoreRememberedSelection`, unconditional where `restoreSelectionOrEnd` needs a flag, because the wait itself is the blur); if the host replaced the content while the dialog was open, the remembered range is gone from the document and the caret goes to the end instead. And the component answers the promise from the drawer's `onAfterClose` rather than from the submit, because WebKit would not take the focus back while the field still held it — with the answer released on submit, chromium inserted and WebKit did not. `TextInputModal` forwards `onAfterClose` for that, which is the one thing it did not already pass through to `BottomDrawer`. Red first, `editor-selection.test.ts` against the previous `editor-commands.ts`: 2 failed, 7 passed — the caret was left in the dialog's field, and a replaced document did not fall back to the end. The render check's Link/Image case went from failing on both engines to inserting on both, with the inserted image's `naturalWidth` above zero under the shipped policy. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…the shipped header `config/scripts/mobile-web-app-rich-markdown-render.test.mjs`: the real component, mounted by the real React, driven through its toolbar in chromium and webkit under the policy read out of the shell's own Kotlin source. Sixteen cases, eight per engine. What it measures rather than asserts: all fifteen commands change the document, each with the precondition that what it produces was not there first; the surface computes to the 16 px floor and the document's own `--editor-surface` variable is set on the host and nowhere on the root element; `ready` and `change` cross the seam while `window.ReactNativeWebView` — defined by the rig so its absence is a reading — is never touched; Link and Image are answered by the modal, and the inserted image paints with a non-zero `naturalWidth`; one change per checkbox tap and one per inline code; a link tap reaches the host instead of navigating; a remount leaves the listener snapshot and the scheduler exactly where one whole cycle left them (rulings 20 and 21); and two editors on one page hold their own content and report their own edits. Four harness facts the first runs found, each now in a comment: the entry needs four of `MOBILE_WEB_APP_SHIMS` (`isFabric` threw `global is not defined` and every case failed at `data-ready`); `.web.jsx` in `resolveExtensions` or `react-native-svg` resolves its Fabric components; a `SafeAreaProvider`, which the route's navigator supplies and a bare mount does not; and the document's markup, not its text, as the oracle for a content reset — `### body text here` and `body text here` read the same, so a text wait passed on the document it was replacing. One finding, reported not fixed: WebKit's `insertUnorderedList` nests the `<ul>` inside the `<p>` it was given and the serializer walks back out with the same text, so a bullet list does not survive a round trip there. The phone's WebView is the same engine, so this is not something the page introduces; the case names the command's own element and the reset is numbered per command to work around it. Run 5 of 5: 16 passed, 0 failed, 0 errors, exit 0, 6.58s. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
… page Both sides measured with `mobileWebAppRouteClosure(SESSION_ROUTE)` at base `9267423f22`, all five postinstall generators run first, the before side a scratch worktree detached at that sha: modules 4333 -> 4360 (+27) local modules 991 -> 1018 (+27) All 27 are local and none is vendored, which is the point: the editor is the app's own code, not a library. The document's 24 modules under `src/components/rich-markdown/` were reachable from nothing on the page while it rendered a plain field, and the other three are the mount, the shared toolbar, and the controller with its keyboard-inset module. Nothing leaves, because the web sibling replaces its own native file and that file was never in this closure. Named by diffing the two `local` lists, not inferred from the total. `document-style-scoping.ts` is on both sides: the terminal's mount already brings it, so the editor's second export costs no module. The generation, measured the same way on both sides: 8,028,418 -> 8,056,166 bytes (+27,748) across 109 assets against the 9 MiB ceiling, 85.1% -> 85.4%. The script count does not move (67 against the 76 the chunk fence allows for 15 routes) and neither does the entry's static closure (1,612,052 bytes against 3 MiB) — this is code the route already reached for, not a new chunk boundary. The grant census needs nothing: `openExternalLink` is the editor's only seam with a grant behind it, and the session route already declares `externalLink` for six other openers. `mobile-web-app-page-grant-call-sites.test.mjs` passes unchanged. Closure, webview-consumer and grant censuses together: 28 passed, 0 failed, exit 0. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…unused `check-changed-code-quality.mjs` failed with one finding: the mount effect's `react-hooks/exhaustive-deps` disable reports no problem under that config, so the directive itself is the finding. The reason it carried is worth keeping and now reads as a plain comment — the effect mounts once, with `promptForUrl` taken from the closure, because re-running it would throw away a live document and the caret in it. 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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe web editor now mounts the shared rich Markdown document in a host element with scoped styles and lifecycle cleanup. URL prompts preserve the editor selection. Native and web surfaces use a shared 15-command toolbar. The editor style uses the text-input font-size seam. New tests cover document isolation, style scoping, toolbar behavior, browser rendering, and editable-host font-size validation. The session closure measurement increases from 4,333 to 4,359 modules. Priority: ➖ Normal Merge Risk: 🔵 Low · up to The PR adds a page-mounted editor and expands editable-host validation, but the validation census may still miss some hosts or accept unverified font sizes. The impact is bounded to compliance coverage, so the change is mergeable with owner awareness. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description gives detailed technical context, testing results, known limitations, and bundle measurements. However, it does not follow the required template and omits required sections such as ELI5, What Changed, Why, Linked Issue with a Fixes entry, Visual Proof, AI Disclosure, Review, Agent skill upstream boundary, Notes, and the Checklist. Resolution Rewrite the description using the repository template. Add all required section headings and content. Include a linked issue using a Fixes entry, attach before-and-after visual proof or write N/A with a reason, document manual and automated testing, complete the AI Disclosure and Agent skill upstream boundary sections, address the Notes items, and complete the Checklist.
✨ 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.
Actionable comments posted: 4
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: b6edc042-a15a-4df6-b28d-5e5490bf65e4
📒 Files selected for processing (22)
config/scripts/mobile-web-app-editable-host-font-size.mjsconfig/scripts/mobile-web-app-editable-host-font-size.test.mjsconfig/scripts/mobile-web-app-rich-markdown-render.test.mjsconfig/scripts/mobile-web-app-session-terminal-closure.test.mjsmobile/src/components/MobileRichMarkdownEditor.tsxmobile/src/components/MobileRichMarkdownEditor.web.tsxmobile/src/components/MobileRichMarkdownToolbar.test.tsxmobile/src/components/MobileRichMarkdownToolbar.tsxmobile/src/components/TextInputModal.tsxmobile/src/components/mobile-webview-editor-web-fallbacks.test.tsxmobile/src/components/rich-markdown/document-host-root.test.tsmobile/src/components/rich-markdown/document-host-seams.tsmobile/src/components/rich-markdown/document-scope.tsmobile/src/components/rich-markdown/document-style.tsmobile/src/components/rich-markdown/editor-commands.tsmobile/src/components/rich-markdown/editor-selection.test.tsmobile/src/components/rich-markdown/editor-selection.tsmobile/src/components/rich-markdown/editor-surface.tsmobile/src/components/rich-markdown/page-stylesheet.test.tsmobile/src/components/rich-markdown/rich-markdown-web-document-mount.test.tsmobile/src/components/rich-markdown/rich-markdown-web-document-mount.tsmobile/src/terminal/terminal-webview-html/document-style-scoping.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| const ids = [...source.matchAll(EDITABLE_MARKUP)].map((match) => match[1] ?? match[2] ?? null) | ||
| if (ids.length === 0) { | ||
| found.push({ file, id: null }) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
rg -n 'contenteditable="true"' mobile/src
rg -n 'editableHostsIn|unresolvedEditableHostStyles|editableHostFontSizeOffenders' config/scriptsRepository: stablyai/orca
Length of output: 3669
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- validator implementation ---'
sed -n '1,215p' config/scripts/mobile-web-app-editable-host-font-size.mjs
printf '%s\n' '--- editable-host tests ---'
sed -n '1,155p' config/scripts/mobile-web-app-editable-host-font-size.test.mjs
printf '%s\n' '--- session-terminal closure test ---'
sed -n '300,370p' config/scripts/mobile-web-app-session-terminal-closure.test.mjs
printf '%s\n' '--- closure definitions/usages ---'
rg -n -C 3 'EDITOR_CLOSURE|closure:|closure\b|editableHostFontSizeOffenders|unresolvedEditableHostStyles' config/scripts mobile/src --glob '*.mjs' --glob '*.ts'Repository: stablyai/orca
Length of output: 45509
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- validator implementation ---'
sed -n '1,65p' config/scripts/mobile-web-app-editable-host-font-size.mjs
sed -n '125,195p' config/scripts/mobile-web-app-editable-host-font-size.mjs
printf '%s\n' '--- editable-host tests ---'
sed -n '1,145p' config/scripts/mobile-web-app-editable-host-font-size.test.mjs
printf '%s\n' '--- relevant closure files ---'
fd -i 'closure' config/scripts -t f
printf '%s\n' '--- editable markup in config scripts ---'
rg -n -C 4 'contenteditable|editableHostsIn|editableHostFontSizeOffenders|unresolvedEditableHostStyles' config/scripts --glob '*.mjs'Repository: stablyai/orca
Length of output: 32375
Count each editable host before extracting its optional id.
EDITABLE_MARKUP matches only editable tags that have an id. A mixed file can therefore omit its no-id host, so the unresolved-host and offender checks do not validate it. The current validated editor closure has only one named host, so this is a localized false-negative gap in the regression check.
Parse each contenteditable="true" tag first, extract its optional id, and add a fixture with one named host and one no-id host.
| // No size of its own, so it inherits, and the floor is about the size an editable declares. | ||
| return { text: null, onSeam: true } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,210p' config/scripts/mobile-web-app-editable-host-font-size.mjs
sed -n '105,145p' config/scripts/mobile-web-app-editable-host-font-size.test.mjs
rg -n 'font-size|TEXT_INPUT_FONT_SIZE|textInputFontSizeFloor' mobile/src config/scripts/mobile-web-app-session-terminal-closure.test.mjs | head -120Repository: stablyai/orca
Length of output: 17898
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- consumers and definitions ---'
rg -n -C 5 'unresolvedEditableHostStyles|editableHostFontSizeOffenders|editableHostSizes|onSeam|contenteditable="true"' config/scripts mobile/src --glob '*.mjs' --glob '*.js' --glob '*.ts' --glob '*.tsx' | head -260
printf '%s\n' '--- validator tests and fixture helper ---'
sed -n '1,180p' config/scripts/mobile-web-app-editable-host-font-size.test.mjs
printf '%s\n' '--- likely page/root style declarations ---'
rg -n -C 3 'html\s*\{|body\s*\{|:root\s*\{|font-size\s*:|document-style|styleSheet|stylesheet' mobile/src config/scripts --glob '*.ts' --glob '*.tsx' --glob '*.mjs' | head -320Repository: stablyai/orca
Length of output: 41909
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- route-closure consumer ---'
sed -n '300,355p' config/scripts/mobile-web-app-session-terminal-closure.test.mjs
rg -n -C 8 'editableHostFontSizeOffenders|unresolvedEditableHostStyles' config/scripts --glob '*.mjs' --glob '*.js'
printf '%s\n' '--- real editor markup/style ---'
cat -n mobile/src/components/rich-markdown/document-markup.ts
sed -n '1,90p' mobile/src/components/rich-markdown/document-style.ts
printf '%s\n' '--- page/root style and mount candidates ---'
rg -n -C 6 'document\.body|document\.documentElement|`#root`|font-size|RICH_MARKDOWN_EDITOR_MARKUP|documentStyle|document-style' mobile/src --glob '*.ts' --glob '*.tsx' | head -260Repository: stablyai/orca
Length of output: 41652
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- real document stylesheet ---'
cat -n mobile/src/components/rich-markdown/document-style.ts | sed -n '1,90p'
printf '%s\n' '--- page stylesheet contract/tests ---'
cat -n mobile/src/components/rich-markdown/page-stylesheet.test.ts | sed -n '1,120p'
printf '%s\n' '--- exact root/page font-size declarations ---'
rg -n -C 4 '(^|[,{[:space:]])(html|body|:root|\\*)[^{}]*\\{|font-size\s*:' mobile/src --glob '*.ts' --glob '*.tsx' | head -240Repository: stablyai/orca
Length of output: 8520
Treat an omitted font-size as unresolved.
When the matched rule has no font-size, readFontSize returns onSeam: true. The offender check then accepts the editable without checking its ancestor. A page or host can provide an inherited value such as 14 px. Return an unresolved result for the missing declaration, and update the inheritance fixture to expect an unresolved host. This does not treat every inherited value as unsafe; it reports values this checker cannot prove are at or above the floor.
# Conflicts: # config/scripts/mobile-web-app-session-terminal-closure.test.mjs
…every id CodeRabbit, `mobile-web-app-editable-host-font-size.mjs:50`, and right on the code: the pattern started from `id="…"`, so it matched only hosts that carry one. The no-id guard fired for a file with *no* named host at all, which means a file holding a named host beside an anonymous one reported the named one as clean and said nothing about the other. An editable is its tag; the id is read out of the tag afterwards. Also `:145`, also right: the sibling search was `startsWith(directory + '/')`, which reaches the subtree, and the walk stops at the first file whose sheet opens the host's selector. The closure's order is the bundler's rather than alphabetical, so a sheet one directory down could answer for the sibling the host actually gets. Now the immediate directory only. Red first, both cases in the census's own file. The mixed fixture reported one host where two were planted (1 failed, 7 passed); the nested fixture, with the nested sheet first in the closure and a compliant 18 px rule in it, hid a 14 px sibling and reported no offender (1 failed, 8 passed). 9 passed after. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
CodeRabbit, `mobile-web-app-editable-host-font-size.mjs:110`, and right for the CSS case: `readFontSize` answered `onSeam: true` for a rule that declares no `font-size`, so the offender check accepted the host without being able to say what size it gets. The inherited value comes from a rule this walk does not read — the host element's own, or the page's root — and it can be 14 px. So "no declaration" becomes "cannot say" and lands in `unresolvedEditableHostStyles`, which the session closure census holds at empty. Not an offender: an offender is a size this walk read and found under the floor. The `TextInput` half of the seam still lets an absent `fontSize` through as inheritance. That is main's policy and it is about a prop rather than a cascade, so it is not touched here; the divergence is stated in the reader's own comment. Red first: the inheritance fixture reported no unresolved host where the size is unknowable (1 failed, 8 passed), 9 passed after. The real tree is unaffected — the editor declares its size on the seam — and the closure census still reads an empty unresolved list. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
ℹ️ No critical issues — two minor suggestions inline.
Reviewed changes
- The editor document mounts in the page —
rich-markdown-web-document-mount.tsplants the markup in a host, scopes the document sheet onto it, calls the real factory with the page's seams, and disposes; the web sibling adds a deferred-call queue becausereadyis posted synchronously before the handle is assigned. - One shared toolbar —
MobileRichMarkdownToolbar.tsxholds the fifteen commands both siblings render, replacing the copy inlined in the native component. - A
rootseam —document-host-seams.ts/document-scope.ts/editor-surface.tslet a page mount scope the surface read to its own host, so two editors during a stack transition cannot share one#editor. - The URL commands answered by a modal —
TextInputModalgainsonAfterClose;MobileRichMarkdownEditor.web.tsxresolves the command after the drawer loses focus, andeditor-selection.tssaves and restores the caret across the wait. - The 16 px floor —
document-style.tsbinds the surface size to the text-input seam, and the newmobile-web-app-editable-host-font-size.mjscensus starts from the markup rather than JSXTextInput. - Proof —
mobile-web-app-rich-markdown-render.test.mjsruns the real component in Chromium and WebKit under the shipped CSP; unit tests for the mount, root scoping, page sheet, and toolbar; the session closure repinned to 4,360 / 1,018.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: e2fd0780-22de-4a84-8fdd-4b209675784d
📒 Files selected for processing (5)
config/scripts/mobile-web-app-editable-host-font-size.mjsconfig/scripts/mobile-web-app-editable-host-font-size.test.mjsconfig/scripts/mobile-web-app-session-terminal-closure.test.mjsmobile/src/components/rich-markdown/page-stylesheet.test.tsmobile/src/terminal/terminal-webview-html/document-style-scoping.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
ℹ️ Round-1 fixes look correct; one prior note still stands.
Reviewed changes
Incremental review of the three commits since 556e7284:
- The census counts editable tags, not ids —
EDITABLE_TAGmatches eachcontenteditable="true"tag and reads its optional id from the tag, so an anonymous editable beside a named one in the same file is now found and reported unresolved rather than invisible. - No declared size is unresolved, not a pass —
readFontSizereturnsnullwhen the rule sets nofont-size, so the closure census cannot silently pass an editable whose inherited value it cannot read. - Sheet lookup is the immediate directory — only files in the markup's own directory answer for its selector, so a nested sheet cannot substitute for the sibling the host actually gets.
:rootdescendants are refused —startsAtDocumentRootcatches:root .foo,:root > .foo, and:root.themeinstead of rewriting them into a selector that matches nothing; bare:rootstill moves onto the host.page-stylesheet.test.tspins both directions. The prior review thread on this is resolved.- Closure repin after the main merge — 4,358 modules / 1,016 local, measured on the merged head rather than summed.
The new fixtures are genuine measurements — the nested-sheet case reads a closure whose first entry is the nested sheet, and the no-size case previously asserted a pass, so each fails against the old implementation.
The one outstanding prior note is the hardcoded FLOOR = 16 in mobile-web-app-rich-markdown-render.test.mjs under a comment claiming it is read from the seam (still open as an inline thread).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
… uses
CodeRabbit, `mobile-web-app-editable-host-font-size.mjs:119`, and right: the walk
read the first `font-size` in a rule, and CSS takes the last of equal importance.
`font-size: 16px; font-size: 14px;` was therefore reported compliant for a surface
the browser renders at 14 px. `!important` outranks every declaration that is not,
whatever the order.
The flag is also stripped from the value, which the finding did not name but the
fixture caught: without that, a compliant size carrying `!important` was reported
as an offender, because it matched neither the literal nor the substitution shape.
The declarations are split on the separator rather than matched with a value
pattern. A pattern excluding `}` cut `${TEXT_INPUT_FONT_SIZE}px` at the brace of
its own interpolation and reported the real editor as an offender — caught on the
first run of the fix, and the reason the split is the shape here.
Red first: 2 failed, 9 passed — the repeated-declaration fixture reported no
offender, and the important-declaration pair reported the wrong one of the two.
11 passed after.
Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…of retyping it
pullfrog, `mobile-web-app-rich-markdown-render.test.mjs:37`, and right: the comment
said the floor was read from the seam and the constant was the literal `16`, which
is the shape the seam exists to prevent. It now comes from
`textInputFontSizeFloor(mobileDir)`, the same reader the closure census uses, which
throws rather than defaulting when the seam is gone.
The assertion becomes "at or above the floor" rather than equal to it. The seam is
`Math.max(bodySize, floor)`, so a theme raising the body size past the floor raises
what the page computes; equality against the floor would have been the same stale
literal one module further away.
Two controls, both run. Raising `TEXT_INPUT_FONT_SIZE_FLOOR` to 18 in the seam
keeps the case green on both engines, because the stylesheet reads the same module
and the page computed 18 — the two moving together is the point. Replacing the
stylesheet's `${TEXT_INPUT_FONT_SIZE}px` with a literal `14px` reds it on both
engines, `expected 14 to be greater than or equal to 16`, which is what says the
assertion carries weight. Both files were restored.
Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
# Conflicts: # config/scripts/mobile-web-app-session-terminal-closure.test.mjs
# Conflicts: # config/scripts/mobile-web-app-session-terminal-closure.test.mjs
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: ab8468bc-2eb7-4938-a1f1-29d81d210558
📒 Files selected for processing (4)
config/scripts/mobile-web-app-editable-host-font-size.mjsconfig/scripts/mobile-web-app-editable-host-font-size.test.mjsconfig/scripts/mobile-web-app-rich-markdown-render.test.mjsconfig/scripts/mobile-web-app-session-terminal-closure.test.mjs
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
✅ No new issues found. The two commits since the prior review are correct, and both outstanding prior threads are now resolved.
Reviewed changes
Incremental review of the five commits since dda48c4b (c945fc10, 94e8b1f1, and three merges of main):
- The census reads the declaration the cascade uses —
winningFontSize(mobile-web-app-editable-host-font-size.mjs:119) takes the last declaration among equal importance and lets!importantoutrank it, stripping the flag from the value. PreviouslyreadFontSizematched the firstfont-size:in the rule, sofont-size: 16px; font-size: 14px;read as compliant for a surface the browser paints at 14 px. - The new fixtures can fail —
repeatedasserts the 14 px second declaration is an offender, andimportant-wins/important-offendspin both directions of the cascade. Each reds against the old first-match walk. - The render check reads the floor from the seam —
FLOOR = textInputFontSizeFloor(mobileDir)andNumber.parseFloat(size) >= FLOOR(mobile-web-app-rich-markdown-render.test.mjs:45,438), replacing the hardcoded16. This closes the last open prior thread. - Session closure pin re-measured on the merged head —
SESSION_ROUTE_MODULES = 4359/ 1,017 local, with the docstring reconciling main's corrected 4333 plus the editor's 26.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
… host (round 3) `ruleFor` returned the first exact `#id` rule and the walk stopped there, so a later exact rule of equal specificity, or a higher-specificity subject rule that still targets the host, could lower the rendered size unseen. Every exact rule in the sheet is now collected in source order and read as one cascade, and any other rule whose subject compound targets the host and declares `font-size` makes the host unresolved rather than compliant. No specificity arithmetic, and the sibling walk is unchanged. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Incremental review of the one commit since 5eb1e449b3 (5667d51435), which reworks the editable-host font-size census to evaluate every competing rule:
- Every exact rule is read in source order —
exactRulescollects all#editorrules in a sheet and joins their declarations, so a later#editor { font-size: 14px }overrides an earlier compliant rule instead of being ignored;winningFontSizestill resolves!importantand last-of-equal-importance. - A higher-specificity subject is unresolved, not compliant —
unrankableHostRulesflags a rule such asmain#editor,#editor.x, or a comma list holding one that declares a size, since the census does no specificity arithmetic; the surface is reported as a hole rather than passing. - Selector matching gained an id boundary —
selectorPatternappends(?![\w-]), so#editorno longer matches#editor-notes; the selector list is split on commas so a host riding in one reaches the verdict, and descendant (#editor p) and pseudo-element (::before) rules are left out of the way. - Fixtures can fail —
later-exact,earlier-exact(control),subject-specificity,subject-in-list,neighbour-id, andnot-the-hosteach red against the pre-round-3 walk; the shippeddocument-style.tsstill reads as on-seam with an empty unresolved list.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…ached it (#22135) #21705 added agent-session-option-catalog-antigravity.ts to the option catalog the session page reaches. It merged beside C2 (#22099), whose pin of 4,359 was measured before it, so main reads one short. Measured at eb92222 and named by diffing against the closure at 841d06a. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

C7.10 item C: the rich Markdown editor mounts on the page
C7.6 gave the page a plain Markdown field and recorded the toolbar and the rendered view as a degradation. Ruling 26 makes that debt rather than done: the page now mounts the editor document itself.
rich-markdown-web-document-mount.tsis the editor's half of whatterminal-web-document-mount.tsdoes for the terminal: the sheet held under the host's class, the markup planted in the host, one factory call, a dispose that gives the host back. The component over it renders the same fifteen-command toolbar and uses the same controller the phone uses, soMarkdownReadercannot tell which sibling it has.Seams the page answers differently
postToHostreaches the component directly and neverwindow.ReactNativeWebView, which on the page is the shell's bridge.promptForUrlisTextInputModal.window.promptwas measured to return null in both shells, so Link and Image silently did nothing on the phone.onKeyboardInsetChangeis never called: the screen'skeyboard-occlusion.web.tsmeasures the same viewport with the same formula.rootis the mount's host element, because the markup's id is page-wide and a stack transition can keep two session screens mounted.Two defects fixed
The surface computed to 14 px. iOS zooms on focus of any editable under that and never zooms back, and the keyboard seam then reads scale ≠ 1 as "no keyboard" for the rest of the session. The size now comes from the text-input seam, so the phone keeps 14 and the page gets 16 from one binding. The
TextInputcensus could not see acontenteditablesized by a CSS string, somobile-web-app-editable-host-font-size.mjsstarts from the markup instead.The caret did not survive the URL dialog: the modal focuses its own field, and
execCommandon a document that does not hold the selection inserts nothing. The document now remembers the caret before it waits and restores it after, and the component answers from the drawer'sonAfterClose; WebKit would not take focus back while the field still held it.Numbers
Session route modules 4,333 to 4,359, local 991 to 1,017 on a merge of main at
197550c952, +26, all local (the editor's own 26;markdown-table-rows.tsis on both sides since #22114, and the freebuff icon from #18790 is on both sides since #22119); reproduced by the lead, zero removed. Bundle 8,028,418 to 8,056,166 bytes, 85.1% to 85.4% of the 9 MiB ceiling. Scripts unchanged at 67 against a fence of 76. No new grants:externalLinkwas already declared.Known engine limit
WebKit's
insertUnorderedListnests the<ul>inside the<p>, so a bullet list does not survive a markdown round trip there. The phone's WebView is the same engine, so this is pre-existing rather than introduced here; filed for its own fix.Correction to the design note
The editor has one live consumer,
MarkdownReaderinMobileSessionActiveContent, not two;src/session/MobileMarkdownReader.tsxhas no consumer at all. The root seam is still needed for the stack-transition case, and the render check drives two editors at once.Round 1 (CodeRabbit on
556e7284e4, four findings, all accepted red-first):rootis refused like one descending frombody, instead of being rewritten into a rule that matches nothing.Record note:
7552033979carries the first three;dda48c4b84carries the fourth but its message describes the second (staging error, left as is since history is never rewritten).Round 2 (pullfrog + CodeRabbit on
dda48c4b84, both accepted red-first)font-size, not the first declaration: CSS takes the last of equal importance and!importantoutranks the rest; the!importantflag is stripped from the value (2 failed / 9 passed before).textInputFontSizeFloor(mobileDir)) and asserts at-or-above it; two controls show both sides move together and a14pxregression reds both engines.#idrules cascade by source order (last of equal importance,!importantfirst), and a subject selector of higher specificity that still targets the host is reported as unresolved rather than ranked. No specificity arithmetic; the sibling walk still stops at the first sheet that opens the exact selector, so a sibling sheet carrying only amain#editorrule and no exact rule is out of view (left as is; a document's sheet and markup are one module).Verification
config/scripts/mobile-web-app-rich-markdown-render.test.mjs: 16 cases, 8 per engine, under the shipped CSP. All fifteen commands, the 16 px floor, the sheet reaching nothing outside the host, the bridge object untouched, Link and Image inserting with the image painting, one change per checkbox tap, a link tap reaching the host, a remount leaving the listener and scheduler snapshots unmoved, and two editors holding their own content.Commits
8422339227660f9704a3scopeDocumentStyleToHost::root/*/html/bodymove onto the host7751b83a9f,7cc183de83a2dba1e41aMobileRichMarkdownEditor.web.tsx00770bb2aadocument-style.ts:36(14 px)f7652bc72ea8631ba71b05d09441c33f2d7673f0origin/main(73b726c64f)556e7284e4a89f7c6c08origin/main(55378fce5b); closure pin conflict resolved by measurement, 4,358 / 1,0167552033979dda48c4b84:rootdescendant selector is refused, not rewritten to match nothing (round 1, finding 4; message names finding 2)c945fc106b!importantfirst (round 2)94e8b1f1fbb3d9f317b2origin/main(15472cd4c6), no mobile or config changes1a9ce5b2a0origin/main(059ee59a48); closure pin conflict resolved by measurement, 4,359 / 1,0175eb1e449b3origin/main(197550c952, the #22119 freebuff repin); pin conflict resolved by keeping the measurement, main's paragraph placed first; closure unchanged at 4,359 / 1,0175667d51435#idrules cascade in source order, any other subject rule that sizes the host (main#editor, a comma list holding one) makes it unresolved; id boundary so#editornever matches#editor-notes(round 3, CodeRabbit)[]vs['…:2'];main#editor:[]vs['…:5']; comma list same; source-order and::before/descendant controls green both waysGates
Lane gates all exit 0 on
556e7284e4. Lead gate against73b726c64f: all lint gates 0;config/scripts251 files passed; mobile 807 files passed; no machine paths.Lead gate on
dda48c4b84against55378fce5b: all lint gates 0;config/scripts251 files passed; mobile 808 files passed; no machine paths.Lead gate on
5eb1e449b3against197550c952: artifacts rebuilt, tsc 0, ratchet 0, all lint gates 0;config/scripts251 files passed (2,319 tests); mobile 808 files passed (8,994 tests); no machine paths.Lead gate on
5667d51435against197550c952: tsc 0, ratchet 0, all lint gates 0;config/scripts251 files passed (2,325 tests); mobile 808 files passed; no machine paths.