Skip to content

fix(web): prevent long markdown links from flooding the DOM - #26827

Closed
saimircelaj0 wants to merge 1 commit into
pingdotgg:mainfrom
saimircelaj0:fix/long-markdown-link-rendering
Closed

saimircelaj0 wants to merge 1 commit into
pingdotgg:mainfrom
saimircelaj0:fix/long-markdown-link-rendering

Conversation

@saimircelaj0

Copy link
Copy Markdown
Contributor

A long raw URL can make the desktop UI stall on clicks. MarkdownExternalLinkContent inserts a <wbr> after every character in each long word. A macOS 0.1.3 trace showed roughly four-second main-thread commits with one such link mounted; removing and restoring the link removed and restored the load.

Render each long word in one inline span with overflow-wrap: anywhere instead. Keep short words intact, preserve the unbroken protocol/favicon prefix, and preserve the full text, destination, and rich children. This is a small, focused obvious-bug fix under CONTRIBUTING's prior-issue exception: it removes the unbounded element expansion without adding a feature or changing link actions.

Validation:

  • Added two browser regression cases (plain and formatted link content). Both fail before the fix: growing a URL from 128 to 16,000 payload characters grows its descendant count from 152 to 16,024 (153 to 16,025 with rich children). Both pass after it, including exact text/href and wrapping inside a narrow markdown table.
  • vp run check:changed passed format, lint, knip, affected-package typechecks, and both browser tests.
  • Integrated Replay (dev) check using a synthetic 16,838-character URL: descendant elements 16,834 → 5, with the same text and href. Short PR and labelled links remain unchanged. Web and desktop share this component; mobile uses a separate renderer. No provider or wire-contract changes.

The screenshots and short recordings below use synthetic data. They demonstrate preserved rendering and interaction, not a controlled before/after latency benchmark. Private traces and real conversations are not included.

Before After
Before After

Before recording · After recording

Implemented with GPT-6.1 Sol through the Codex harness in T3 Code.

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

macroscopeapp Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at ebf1f29

Macroscope's review found this PR approvable — Long Markdown link labels now use CSS wrapping instead of per-character DOM elements, reducing DOM growth. The change is confined to presentation and leaves link destinations and actions unchanged.

You can add or adjust custom eligibility rules. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant