Skip to content

fix(mobile): two more table parsers hold a pipe in a cell (OTA phase C follow-up) - #22114

Merged
Jinwoo-H merged 6 commits into
mainfrom
ota-fu-table-pipe-parsers
Sep 22, 2026
Merged

Jinwoo-H merged 6 commits into
mainfrom
ota-fu-table-pipe-parsers

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​53 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​52
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​44 $\color{#cf222e}{\Huge{\mathbf{−}}}$​40

Summary

Two more table parsers could not hold a pipe inside a cell. #22054 fixed the rich-markdown editor's copy; the PR comment renderer and the mobile markdown preview each carried their own splitter.

The preview parser split on every pipe, so | a \| b | c | became three cells and kept the backslash. The PR comment parser already unescaped \|, but stripped a row's trailing pipe before walking escapes (a row ending \| lost the pipe) and read \\| as an escaped pipe, merging the cells either side of a real separator.

Both now read rows through mobile/src/components/rich-markdown/markdown-table-rows.ts, which splits on unescaped pipes and unescapes the cell. It imports nothing, so it joins the session page's closure alone: 4,331 modules to 4,332, repinned by measurement (the lane's first draft claimed no closure change; the lead's gate caught the pin). The PR comment parser keeps its own delimiter check: a single dash opens a table there, which the editor's three-dash separator would reject.

Red-first: each parser's escaped-pipe cases were committed failing, then fixed. The existing 2,197-row delimiter grammar sweep in markdown-table-delimiter-performance.test.ts still agrees with the original regex. No golden.

Commits

sha change red before
a1cb6804c0 test: escaped pipes in mobile markdown table cells 2 failed / 13 passed
26b51bbc80 fix: the preview parser reads rows through the shared splitter
b6471145e5 test: escaped-pipe rows in PR comment tables 2 failed / 14 passed; `
a2d275bb55 fix: PR comment rows split on unescaped pipes only
87a75d2f7e merge of origin/main (8307dc5d7b)
753dfb689b test: repin the session route closure at 4,332, the one leaf named lead gate red on 4,331

Gates

Lane gates all exit 0 on 87a75d2f7e (mobile 804 files / 8,969 passed; ratchet 800 files). Lead gate at base 8307dc5d7b below.

Lead gate on 753dfb689b against 8307dc5d7b: all lint gates 0; config/scripts 249 files passed; mobile 804 files passed; no machine paths.

The mobile preview parser splits a table row on every pipe, so a cell
that escaped one becomes two cells and keeps the backslash.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The editor's markdown-table-rows already splits on unescaped pipes only
and unescapes the cell; it has no imports of its own, so owning the rule
once costs the preview parser nothing.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Its splitter strips the trailing pipe before walking escapes and reads
`\\|` as an escaped pipe, so a row ending in `\|` loses the pipe and a
cell holding a backslash swallows the separator after it.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Its own delimiter grammar stays local: a single dash still opens a table
here, which the editor's three-dash separator would reject.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
markdown-table-rows.ts joins through the PR comment renderer. Measured on
this head: 4,332 modules / 990 local, and it is the only file under
rich-markdown/ in the closure, so nothing came with it.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 48030137-d26b-442e-98f0-a02ed3423bb9

📥 Commits

Reviewing files that changed from the base of the PR and between 15472cd and 753dfb6.

📒 Files selected for processing (5)
  • config/scripts/mobile-web-app-session-terminal-closure.test.mjs
  • mobile/src/components/MobileMarkdown.test.ts
  • mobile/src/components/mobile-markdown-parser.ts
  • mobile/src/components/pr-sidebar/markdown-blocks.test.ts
  • mobile/src/components/pr-sidebar/markdown-blocks.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Both mobile table parsers now use markdown-table-rows for row splitting and separator checks. Tests cover escaped pipes and escaped backslashes. The session closure test updates its module count from 4331 to 4332 and its local count from 989 to 990.

Priority: ⬇️ Low

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the implementation, motivation, tests, and gate results, but it omits most required template sections. It does not provide an ELI5 section, a Fixes # issue link, visual proo… Update the description to include all required template sections. Add a linked issue using Fixes #<issue-number>, provide visual proof or state N/A with a reason, complete the testing checklist and platform details, add the required AI …
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the mobile table-parser fix and the affected behavior. It is concise and related to the primary change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the implementation, motivation, tests, and gate results, but it omits most required template sections. It does not provide an ELI5 section, a Fixes # issue link, visual proof or an explicit N/A, structured testing checkboxes, AI disclosure, review details, agent boundary confirmation, notes, or the checklist.

Resolution

Update the description to include all required template sections. Add a linked issue using Fixes #&lt;issue-number&gt;, provide visual proof or state N/A with a reason, complete the testing checklist and platform details, add the required AI disclosure or applicable internal-contributor treatment, complete Review, Agent skill upstream boundary, Notes, and Checklist sections, and include clear ELI5, What Changed, and Why content.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Shared row splitter adopted — mobile-markdown-parser.ts and pr-sidebar/markdown-blocks.ts drop their local splitTableRow and read rows through rich-markdown/markdown-table-rows.ts, so \| now survives inside the cell that escaped it and \\| correctly ends a cell instead of being read as an escaped pipe.
  • Escaped-pipe coverage — both suites pin the new cases with exact toEqual expectations (| a \| b | c | → ['a | b', 'c'], | x\\|y | → ['x\', 'y'], plus a row with no closing pipe ending \|); the PR comment parser keeps its single-dash isTableDelimiter with a comment explaining the deliberate divergence from the editor's three-dash separator.
  • Closure pin — the session-route module count moves 4,331 → 4,332 for the one shared leaf, with the reasoning recorded alongside the existing measurement log.

I read the complete diff and validated the shared splitTableRow semantics against every new and existing case, including the 2,197-row delimiter sweep in markdown-table-delimiter-performance.test.ts. I also ran the two changed mobile suites (31 passed) and oxlint on the changed files (0 warnings / 0 errors). No other mobile parser still hand-rolls a pipe splitter. The change is a clean consolidation with red-first tests.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit 226f4a0 into main Sep 22, 2026
33 checks passed
@Jinwoo-H
Jinwoo-H deleted the ota-fu-table-pipe-parsers branch September 22, 2026 00:26
Jinwoo-H added a commit that referenced this pull request Sep 22, 2026
…ached it (#22119)

#18790 added the freebuff agent icon to mobile-agent-icon-assets.ts, which the
session page reaches. It merged between #22114's closure measurement (4,332)
and its merge, so main pins one module short. Measured on main's tip
059ee59 and named by diffing the closure at 226f4a0 against it.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant