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): chunked Markdown links keep the first definition’s destination by saphid · Pull Request #43692 · pingdotgg/t3code

Conversation

@saphid

@saphid saphid commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Problem

A reference link in a chunked Markdown file preview can open a different destination than the same link in the original document. Appending shared definitions also inserts synthetic text into an unclosed code fence.

Deterministic repro on origin/main (44a533378653164dea96435e23c8ea27efaffedb):

const md = '[id]: /first\n\n' + 'x'.repeat(4100) + '\n\n# Next\n[id]: /later\n\n[id]';
const { chunks, definitions } = splitMarkdown(md);
// Compare the Words-rendered href for md with:
withMarkdownDefinitions(chunks[1].text, definitions);

Import the helpers from packages/shared/src/markdownChunks.ts and render using the bundled @pierre/words WASM. Observed: the whole document links to /first, but the second chunk links to /later. Expected: both link to /first. A second fixture, '[ref]: /dst\n\n```text\nshown', should render only shown inside its code block; base also displays [ref]: /dst.

The runtime transcript includes the complete executable script and base/head commands. Test-only patch repro: vp test run packages/shared/src/markdownChunks.test.ts -t 'keeps the first document|keeps shared definitions'.

Change

Prepend shared link definitions in document order after masking leading frontmatter. Subtract the synthetic prefix from web checkbox offsets; raw chunks remain unchanged for copying. The shared helper covers web, Electron, and mobile file previews; native preview has no source-offset checkbox editing path.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • Base: both focused regressions fail with the incorrect href and extra fenced code; exact assertions are in the transcript.
  • Head: 3 consecutive runs of vp test run packages/shared/src/markdownChunks.test.ts pass 14/14 tests after rebasing onto d6061ec8ad2fa71fe54b3e306e0b8e283ca33bac (which adds one upstream case), including frontmatter masking, leading BOM headings/tasks/quotes without frontmatter, and checkbox source offsets with CRLF and Unicode.
  • vp run check:changed: exit 0 (format, lint, knip, affected typechecks/tests, React Compiler).
  • Bundled Words WASM runtime evidence: href /later → /first, fenced code contains only shown, checkbox offset stays 44, and raw chunks reconstruct the original source.
  • Cross-provider review: Gemini 4 Neon found a BOM regression in the initial fix. It was reproduced, corrected in one pass by preserving the BOM at index zero, and rechecked with the bundled Words runtime and the extended regression. The final independent recheck returned APPROVE_FOR_PR.
  • Not shown: real-app browser screenshots/scenario, Electron shell, native iOS/Android runtime, external-link navigation, checkbox persistence through the server, remote/tunnel connections, or the full repository suite. This is parser/runtime proof; no dev server was launched by the delegated implementation task.

Authored by GPT-6.1 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).

Sorry, something went wrong.

Uh oh!

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

All reactions
@saphid
fix(shared): chunked Markdown links keep the first definition’s desti…
3a495a7
…nation
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 26, 2026
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

This change prepends shared Markdown definitions to chunk content, preserves a leading BOM, and adjusts task-marker offsets for the added prefix. Tests cover definition resolution, frontmatter, source offsets, rendered output, and unclosed code fences.

Changes: Chunked Markdown definitions

Layer / File(s) Summary
Definition prefix and source offsets
packages/shared/src/markdownChunks.ts, apps/web/src/components/files/ChunkedMarkdown.tsx, packages/shared/src/markdownChunks.test.ts
withMarkdownDefinitions masks frontmatter and prepends definitions, placing them after a leading BOM when present. Chunked rendering adjusts task-marker offsets for the prefix. Tests cover shared definitions, source offsets, rendered output, and unclosed code fences.

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

Change: Bug fix

Suggested reviewers: marve10s, juliusmarminge

Merge Risk: Minimal · up to 72d50

This change makes chunked Markdown previews resolve links to the first definition and stops synthetic definition text from leaking into unclosed code fences. The change is small and covered by focused tests. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: chunked Markdown links keep the first definition's destination, with the conventional fix(shared) prefix. The changeset prepends shared link definitions in document or…
Description check Passed The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section gives the bug, a deterministic reproduction, and expected behavior. The Change section expl…
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: chunked Markdown links keep the first definition's destination, with the conventional fix(shared) prefix. The changeset prepends shared link definitions in document order so reference links in later chunks resolve to the first definition. The title is 75 characters, which is long but within a single readable sentence.

Full details: Description check

Explanation

The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section gives the bug, a deterministic reproduction, and expected behavior. The Change section explains the prepend-after-frontmatter approach and the checkbox offset adjustment. The Scope section states this is a small bug fix and why no issue is needed. The Verification section lists focused test runs, the repo check command, and the runtime evidence. It also lists what was not checked, which matches the template's request. The description keeps the template's optional agent attribution line, as the template asks.

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: 9022118
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4e61bf7a-6ff6-4a04-9409-c177e6f72a36
Commits

Reviewing files that changed from the base of the PR and between 3a495a7 and 72d50de.

Files selected for processing: 1

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

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 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 26, 2026
juliusmarminge and others added 2 commits November 26, 2026 18:54
@juliusmarminge
Merge remote-tracking branch 'origin/main' into hunter/c-761d05a5ad
6e89355
@juliusmarminge @claude
test(shared): focus chunked Markdown definition tests
72d50de
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge

juliusmarminge commented Nov 26, 2026

Copy link
Copy Markdown
Member

Evidence

Real web app, Chromium, 1280×800, light theme, fresh synthetic state on each commit. Opened the right panel → Files and rendered the reported fence.md and dup.md. The red link annotation displays the actual DOM href. Also toggled a task in a later chunk and back; only its intended source marker changed, and the original file was restored on both commits.

Proven: the scenario fails on base and passes on head; scenarios:prove exited 0.

Capture Before — 90221188bf After — 72d50de841
Unclosed fence Before: extra definition inside fence After: only shown remains inside fence
First reference destination Before: id resolves to /later After: id resolves to /first
Checkbox edit Before: intended task checked After: intended task checked
Scripted interaction Before recording After recording

Scenario and synthetic seed

Not shown:

  • Frontmatter and BOM preservation were not exercised; the reported reproductions contain neither.
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 26, 2026
@juliusmarminge
juliusmarminge merged commit 9b4a5e1 into pingdotgg:main Nov 26, 2026
61 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 26, 2026
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 26, 2026
@saphid @juliusmarminge @github-actions
fix(shared): chunked Markdown links keep the first definition’s desti…
fad9834
…nation (pingdotgg#43692)

Co-authored-by: SAPHID <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
(cherry picked from commit 9b4a5e1)
@github-actions github-actions Bot mentioned this pull request Nov 26, 2026
Upstream fixes (2026-11-26) Ryoku-dev/hyakki#8
Merged
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 26, 2026
@saphid @juliusmarminge @github-actions
fix(shared): chunked Markdown links keep the first definition’s desti…
c83ae3e
…nation (pingdotgg#43692)

Co-authored-by: SAPHID <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
(cherry picked from commit 9b4a5e1)
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 26, 2026
@saphid @juliusmarminge @github-actions
fix(shared): chunked Markdown links keep the first definition’s desti…
46c952d
…nation (pingdotgg#43692)

Co-authored-by: SAPHID <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
(cherry picked from commit 9b4a5e1)
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 26, 2026
@saphid @juliusmarminge @github-actions
fix(shared): chunked Markdown links keep the first definition’s desti…
c31dc3f
…nation (pingdotgg#43692)

Co-authored-by: SAPHID <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
(cherry picked from commit 9b4a5e1)
@omegent-app omegent-app Bot mentioned this pull request Nov 27, 2026
Merge upstream main through 1f63e7f385e3 patroza/t3code#679
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:trusted Author is trusted by repo permissions or 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

@saphid @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.