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): Markdown previews keep first references with next-line destinations by StiensWout · Pull Request #43807 · pingdotgg/t3code

Conversation

@StiensWout

@StiensWout StiensWout commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Chunked Markdown previews could open a later URL when the first reference definition put its destination on the next line. The chunker now collects complete definitions in document order using bounded batches and preserves their labels, destinations, and titles. It distinguishes a separate quote-led paragraph from a continued title and keeps later duplicates from overriding a confirmed oversized title in its source chunk.

Related: #43647, #43654, #23503, #43673, #43709, #43711

Reproduction on main

Commit f08bafe07f (main), in the running web app:

  1. Start the web app and open a project.
  2. Open a Markdown file from the project files. If the project has none, add one.
  3. Replace the file with these lines, then save it: a line [Release notes][release], a blank line, a line [release]:, a line of two spaces then https://example.com/current, a blank line, a line Notes., a blank line, a line ## Appendix, a blank line, and a line [release]: https://example.com/previous.
  4. Open that file in the preview if it is not already open, and press Show rendered markdown.
  5. Press the Release notes link.

The link opens https://example.com/previous, the address from the later one-line reference. Expected: The link opens https://example.com/current, the address from the first reference.

The cause is at packages/shared/src/markdownChunks.ts:180. Ran pnpm scenarios:prove scripts/scenarios/markdown-first-multiline-definition.e2e.ts --target web with the repro scenario added: it failed in 2 of 2 runs on a clean checkout, with expect.toHaveAttribute failed in the output.

Evidence

Environment: The web app in Chromium on Linux x64, a fresh checkout.

Proven: the repro fails at the test commit 91523cf9fc and passes on the head 14abf45ce3, both on main 6252f1f203.

Before After
Commit 91523cf9fc 14abf45ce3
Result ASSERTION_FAILED: expect.toHaveAttribute failed passed
first reference Before: first reference After: first reference
failure Before: failure

Before the fix, recorded:

https://pub-b182a4071edc4521829926b34990540b.r2.dev/files/0f552df4-d97a-4904-a206-605fc6507b1c/before-recording.webm

After the fix, recorded:

https://pub-b182a4071edc4521829926b34990540b.r2.dev/files/0b73322e-d838-4806-b7e8-bcd646bc7e69/after-recording.webm

Outside view: a person sees it in the running web app by following the steps under Reproduction on main.

Tests

  • 91523cf9fc adds the failing test, alone, before the fix.
  • pnpm exec vp run check:changed 6252f1f203f389b9c8aa2f41b4d415324e8d1fd9 passed on head.

Not in this change

  • Sharing applies to top-level link definitions within the preview’s size budget. Oversized definitions resolve in their source chunk.
  • Footnotes resolve within their own chunks.

Who did the work

  • Repro written by GPT 6.2 Sol, in Codex
  • Outside view by Grok 4.7, in Grok
  • Duplicate check judged by Claude Opus 5.5, in Claude Code
  • Written by GPT 6.2 Sol, in Codex
  • Trimmed by Claude Opus 5.5, in Claude Code
  • Reviewed by Claude Opus 5.5, in Claude Code, and by GPT 6.2 Sol, in Codex, and by Gemini 4 Neon, in Antigravity
  • Reproduction, checks and proof run by a program on base and head, not by an agent

Made in T3 Code by GPT 6.2 Sol, Claude Opus 5.5, Grok 4.7 and Gemini 4 Neon

Sorry, something went wrong.

Uh oh!

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

All reactions
StiensWout and others added 11 commits November 26, 2026 23:35
@StiensWout @codex
test(web): cover Markdown references with next-line destinations
91523cf
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
fix(shared): Markdown previews keep first references with next-line d…
d1ac4f3
…estinations

Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @claude
refactor(shared): read the definition line from its index instead of …
9c08a24
…a duplicate parameter

Co-authored-by: Claude Opus 5.5 <[email protected]>
@StiensWout @claude
refactor(shared): drop a line check every next-line definition alread…
bb99259
…y passes

Co-authored-by: Claude Opus 5.5 <[email protected]>
@StiensWout @codex
fix(shared): parse Markdown reference definitions in bounded runs
f675fd0
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @claude
style(shared): keep the spanning-block comment on its list and the fo…
d02bb8e
…otnote comment as it was

Co-authored-by: Claude Opus 5.5 <[email protected]>
@StiensWout @claude
test(shared): drop the opt-in wall-clock benchmark CI never runs
f9d19dc
Co-authored-by: Claude Opus 5.5 <[email protected]>
@StiensWout @codex
fix(shared): bound Markdown reference detection before parsing
eed734f
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
fix(shared): preserve reference precedence around oversized titles
885a06c
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @claude
refactor(shared): read the cut-off title opener only on the branch th…
cb99278
…at uses it

Co-authored-by: Claude Opus 5.5 <[email protected]>
@StiensWout @claude
style(shared): keep the display math comment's earlier wording when m…
14abf45
…oving it

Co-authored-by: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 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 →

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: dcee01c
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cf879f04-f65c-4b7e-ac18-c888500a3461
Commits

Reviewing files that changed from the base of the PR and between 14abf45 and aacc95e.

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

Markdown splitting now uses Remark to collect eligible link reference definitions across multiple lines. It tracks definition spans and applies the existing 16 KiB shared-definition limit. Tests cover parsing, chunking, and rendered link destinations.

Changes: Markdown reference definitions

Layer / File(s) Summary
Parse reference definition runs
packages/shared/src/markdownChunks.ts
Remark parsing identifies link definitions and their source spans. Run scanning recognizes definition boundaries, display-math openers, and the shared-definition size limit.
Integrate definition spans and validate rendering
packages/shared/src/markdownChunks.ts, packages/shared/src/markdownChunks.test.ts, scripts/scenarios/markdown-first-multiline-definition.e2e.ts
splitMarkdown tracks parsed definition spans and omits definitions that exceed the shared limit. Unit and end-to-end tests cover multiline definitions, chunk boundaries, and rendered links.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge, saphid

Merge Risk: Minimal · previous review 14abf

Markdown previews now resolve multiline link reference definitions to the first definition's destination. No concrete merge-blocking risk was identified, and the change is easy to revert if needed.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix and its scope: Markdown previews in the shared package now keep the first link reference when its destination is on the next line. The changeset adds multiline reference-defini…
Description check Passed The description follows the template's sections (Problem, Change, Scope, Verification) and fills them with specific content. The Problem is covered by the reproduction steps and the expected behavior.…
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 fix and its scope: Markdown previews in the shared package now keep the first link reference when its destination is on the next line. The changeset adds multiline reference-definition parsing in markdownChunks.ts and a matching test, so the title covers the main change. It is 80 characters, slightly long but within a readable range, and it follows the conventional commit format.

Full details: Description check

Explanation

The description follows the template's sections (Problem, Change, Scope, Verification) and fills them with specific content. The Problem is covered by the reproduction steps and the expected behavior. The Change explains the bounded batch collection, label, destination, and title preservation, and the quote-led paragraph distinction. The Scope links related issues and the Verification section gives concrete commands, commit hashes, and before/after results. Minor gaps: the Problem section is not a separate heading with a one or two sentence statement, and the Scope section does not state explicitly why the change is a bug fix rather than a feature. The Verification section also lists tests run, and the 'Not in this change' section is an extra section not in the template. These gaps are non-critical, so the check passes.

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: a4ab2c5
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f2716248-3f23-4009-8dad-65d407c102b0
Commits

Reviewing files that changed from the base of the PR and between a4ab2c5 and 14abf45.

Files selected for processing: 3

  • packages/shared/src/markdownChunks.test.ts
  • packages/shared/src/markdownChunks.ts
  • scripts/scenarios/markdown-first-multiline-definition.e2e.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 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
Merge remote-tracking branch 'origin/main' into wf/find-552abf86acc55…
aacc95e
…26378e702e1
@juliusmarminge

juliusmarminge commented Nov 26, 2026

Copy link
Copy Markdown
Member

Evidence

Created the reported long Markdown document with a next-line first reference destination and a later one-line duplicate. Opened its rendered file preview and hovered Release notes. Environment on both sides: Chromium, 1280×800, light theme, fresh database, synthetic project and Replay thread.

The scenario runner exited 0: base used https://example.com/previous; head used https://example.com/current. Both the app tooltip and anchor href confirmed the difference.

Before After
Before: incorrect previous destination After: correct first destination
dcee01cbfd aacc95e326
Before recording After recording

Scenario source

Not shown:

  • Multiline reference labels and titles were not exercised; this scenario covers the reported next-line destination and duplicate-definition ordering across preview chunks.
  • The short-file variant was not separately exercised.
  • External-tab navigation was not clicked; the app's visible tooltip and actual anchor href were checked on both commits.
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 3ebc46f into pingdotgg:main Nov 26, 2026
60 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
juliusmarminge added a commit to StiensWout/t3code that referenced this pull request Nov 26, 2026
@juliusmarminge @claude
Merge origin/main into fix(shared): Markdown previews show bracketed …
798e693
…prose once

Main's remark-based definition reader (pingdotgg#43807) already rejects invalid labels, so it replaces this branch's one-line matcher. Kept the label tests, kept definition indentation so tabbed labels keep their width, and dropped the scenario that main now passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 27, 2026
@StiensWout @juliusmarminge @github-actions
fix(shared): Markdown previews keep first references with next-line d…
f037061
…estinations (pingdotgg#43807)

Co-authored-by: Julius Marminge <[email protected]>
(cherry picked from commit 3ebc46f)
@github-actions github-actions Bot mentioned this pull request Nov 27, 2026
Upstream fixes (2026-11-27) Ryoku-dev/hyakki#11
Merged
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 27, 2026
@StiensWout @juliusmarminge @github-actions
fix(shared): Markdown previews keep first references with next-line d…
d747b00
…estinations (pingdotgg#43807)

Co-authored-by: Julius Marminge <[email protected]>
(cherry picked from commit 3ebc46f)
@StiensWout
StiensWout deleted the wf/find-552abf86acc5526378e702e1 branch November 27, 2026 07:31
@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:L 100-499 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

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