GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(shared): a Markdown piece held open for a wrapper is cut before it passes 128 KB by Marve10s · Pull Request #42040 · pingdotgg/t3code

Conversation

@Marve10s

@Marve10s Marve10s commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Problem

Since #41596, splitMarkdown skips cut points while a <details> or <table> is open, until the piece reaches 32 KB. That size is checked before each line, so a large block can join a short piece unchecked. A <details> holding an 8 KB paragraph and then a 124 KB line, or a 124 KB fenced log, becomes one ~135 KB piece, where before #41596 the block got its own piece.

A piece past LARGE_MARKDOWN_CHUNK_MAX_CHARS (128 KB) shows as plain source: that piece on web (ChunkedMarkdown.tsx), and the whole file on mobile (FileMarkdownPreview.tsx).

CodeRabbit raised this on #41596 (thread) after its last round of fixes, and it merged before I followed up.

Change

splitMarkdown remembers the last cut point it skipped for an open wrapper. When the piece grows past 128 KB, it is cut there after all, which is where main before #41596 would have cut. The 32 KB rule is unchanged.

Scope

This is a small follow-up to #41596, so it has no issue. It changes nothing for a piece that stays under 128 KB.

Verification

Piece sizes for the input in the CodeRabbit thread (<details>, an 8 KB paragraph, a 124 KB line, </details>, after):

before #41596:  8204, 126989, 5
main:           135194, 5
fix:            8204, 126989, 5

Three more expectations in the existing "keeps HTML blocks and display math open across blank lines" case in markdownChunks.test.ts: a <details> and an 8 KB paragraph, then a long line. At exactly 128 KB in total it stays one piece, as the renderers accept it; one character more and the line starts its own piece. The same with the long block in a fence cuts at the fence.

main:  expected [ '<details>' ] to deeply equal [ '<details>', 'xxxx…' ]
fix:   Tests  7 passed (7)

vp run check:changed upstream/main passes. Not checked in a browser.

Claude Opus 5.5 (Claude Agent in T3 Code) wrote the fix and test from CodeRabbit's finding on #41596. Claude Opus 5.5 (xhigh), GPT-6.2 Sol, GPT-6.2 Astra (high, Codex), and Claude Fable 5.2 reviewed the patch in T3 Code.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@Marve10s
fix(shared): a Markdown piece held open for a wrapper is cut before i…
f0cf972
…t passes 128 KB
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T09:22:45.573798Z f0cf972 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: 9010d7d
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 74bab4a4-d084-4f0b-a75b-ae2380235df2
Commits

Reviewing files that changed from the base of the PR and between f0cf972 and e4df151.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

splitMarkdown now tracks cut points inside open HTML wrappers and uses them when a chunk exceeds the size limit. Tests cover exact-limit and over-limit lines, plus a fenced block inside a <details> block.

Changes: Markdown chunk boundary handling

Layer / File(s) Summary
Held cut handling and boundary tests
packages/shared/src/markdownChunks.ts, packages/shared/src/markdownChunks.test.ts
splitMarkdown records cut points while wrappers are open and splits an oversized chunk at the held cut. flush clears the held cut. Tests check the size boundary and a fenced block inside <details>.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · previous review f0cf9

This change keeps oversized Markdown pieces from growing past the 128 KB limit when an HTML wrapper is open, so they render normally instead of falling back to plain source. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: splitMarkdown now cuts a piece held open for an HTML wrapper before it passes LARGE_MARKDOWN_CHUNK_MAX_CHARS (128 KB). It follows the conventional commit format and ma…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the bug with reproduction input. The Change section explains the fix. The S…
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: Title check

Explanation

The title names the main change: splitMarkdown now cuts a piece held open for an HTML wrapper before it passes LARGE_MARKDOWN_CHUNK_MAX_CHARS (128 KB). It follows the conventional commit format and matches the raw summary, the PR description, and the objectives.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the bug with reproduction input. The Change section explains the fix. The Scope section says why no issue is linked and cites the follow-up to #41596. The Verification section lists piece-size results, test expectations, and the check command. It also states what was not checked (browser behavior). The author lists the models used, as the template requests.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: 110ed77
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 53fb481f-4ac6-49e1-8d9d-152e474bc6ee
Commits

Reviewing files that changed from the base of the PR and between 110ed77 and f0cf972.

Files selected for processing: 2

  • packages/shared/src/markdownChunks.test.ts
  • packages/shared/src/markdownChunks.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026
@juliusmarminge
Merge remote-tracking branch 'origin/main' into fix/markdown-chunks-h…
e4df151
…uge-line
@juliusmarminge

juliusmarminge commented Nov 24, 2026

Copy link
Copy Markdown
Member

Evidence

Web: Chromium, 1280×800, light theme, fresh isolated servers and synthetic Replay fixtures. Desktop: real Linux Electron 44.10.1 under Xvfb, 1280×800, light theme, isolated data. Mobile: same pooled iPhone 18 Pro, iOS 27.2, 402×874, light theme, separate server and Metro per commit. Manual stills were checked for identical pixels at least 500 ms apart.

Steps: create the reported wrapped paragraph and wrapped JSON-fence files with 8,192 a characters and 126,976 b characters; create unwrapped controls and an exactly 131,072-character ASCII wrapper file; seed a project/thread; open Files and select rendered Markdown/Preview; inspect disclosures and long blocks. Repeat on base and head. Native comparisons use the two wrapped files.

The web scenario exited 0: it observed the source fallback on base and no fallback on head. Desktop and iOS independently show the reported difference.

Case Before 9010d7d5a1 After e4df151260
Web: wrapped paragraph, disclosure collapsed Before: raw wrapper source After: rendered paragraph outside collapsed Details
Web: wrapped JSON fence Before: raw fenced source After: code characters visibly painted
Web: unwrapped-fence control Before: control code paints After: control code paints
Web: exactly 128 KiB, collapsed Before: intact disclosure After: intact disclosure
Web: exactly 128 KiB, expanded Before: content renders inside disclosure After: content renders inside disclosure
Linux Electron: wrapped paragraph Before: source fallback After: rendered paragraph
Linux Electron: wrapped fence Before: source fallback After: code line paints
iOS: wrapped paragraph, Preview selected Before: whole-file numbered source After: Markdown text
iOS: wrapped fence, Preview selected Before: whole-file numbered source After: Markdown text

Visible overflow tradeoff: above 128 KiB, head releases the wrapper hold. The 8 KiB paragraph remains in Details while the long b paragraph or fence renders outside the collapsed section. This is shown explicitly; the proof establishes render eligibility, not preservation of the oversized wrapper’s collapse semantics. At exactly 131,072 ASCII characters/bytes, the wrapper remains intact on both commits.

Supplementary iOS evidence:

Before: Preview is checked despite source fallback

After: long b paragraph paints after scrolling

After: long JSON code line and after paragraph paint after scrolling

Full scenario evidence, including expanded states and paragraph controls. Before recording · After recording. These recordings include wrapped rendered views; the stills are the primary static-rendering evidence.

Web scenario · Desktop driver · Mobile seed · Stable mobile capture driver.

No scripts or captures were committed. Temporary servers, device lease, worktrees, and scratch files were cleaned up.

Not shown:

  • Android was not run; native mobile evidence uses the pooled iOS simulator.
  • Exact-limit and unwrapped controls were captured on web; desktop and iOS comparisons cover the two wrapped reproduction files.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 24, 2026
@juliusmarminge
juliusmarminge merged commit 42068f5 into pingdotgg:main Nov 24, 2026
55 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 24, 2026
@patroza patroza mentioned this pull request Nov 24, 2026
Merge upstream main through 26f4c7550e7a patroza/t3code#673
Merged
@Yarden-zamir Yarden-zamir mentioned this pull request Nov 24, 2026
chore(sync): merge pingdotgg/t3code main Yarden-zamir/t3code#628
Merged
@only21mil only21mil mentioned this pull request Nov 24, 2026
fix(shared): chunked Markdown previews keep a link definition right after a code fence #42427
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Marve10s @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.