fix(code): hide incomplete streaming link destinations - #79142
Merged
Conversation
Keep long link destinations out of the rendered conversation until their closing delimiter arrives, while preserving the visible link label. Generated-By: PostHog Code Task-Id: 412b0a25-4e72-446e-812d-0574055968dd
|
😎 Merged successfully - details. |
adboio
marked this pull request as ready for review
August 6, 2026 18:53
Contributor
Prompt To Fix All With AI### Issue 1
products/desktop/packages/ui/src/features/editor/components/splitMarkdownBlocks.ts:148-150
**Unmatched backticks bypass masking**
When an incomplete link follows an unmatched backtick, `findClosingBacktickRun` advances to the end of the block even though CommonMark treats the backtick as literal text, causing the raw destination and any presigned URL parameters to remain visible until the link closes.
### Issue 2
products/desktop/packages/ui/src/features/editor/components/splitMarkdownBlocks.ts:185-193
**Destination grammar misdetects completion**
When a streamed link uses a CommonMark angle-bracket destination or quoted title, this parenthesis-only scanner disagrees with `react-markdown` about whether the link is complete, causing an unfinished destination to appear as literal text or a completed link containing parentheses to remain non-clickable.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(code): hide incomplete streaming lin..." | Re-trigger Greptile |
Apply incomplete link destination masking to the dedicated streaming Markdown component used by the current chat thread. Generated-By: PostHog Code Task-Id: 412b0a25-4e72-446e-812d-0574055968dd
Render incomplete chat links with their final visual treatment and an inline loading indicator until the destination closes. Generated-By: PostHog Code Task-Id: 412b0a25-4e72-446e-812d-0574055968dd
Handle unmatched backticks, angle-bracket destinations, and quoted link titles consistently with completed Markdown rendering. Generated-By: PostHog Code Task-Id: 412b0a25-4e72-446e-812d-0574055968dd
puemos
approved these changes
Aug 6, 2026
1 task
Contributor
Author
|
/trunk merge |
1 similar comment
Contributor
Author
|
/trunk merge |
Contributor
|
React Doctor found 1 issue in 1 file · 1 warning. 1 warning
Reviewed by React Doctor for commit |
There was a problem hiding this comment.
Contained frontend markdown-rendering fix outside risky territory; both Greptile concerns were fixed with regression tests and resolved, and a current-head reviewer approved with no outstanding holds.
- puemos reviewed the current head.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 218L, 3F substantive, 382L/6F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1d-complex (382L, 6F, single-area, fix) |
| stamphog 2.0.0b4 | .stamphog/policy.yml @ 90b6195 · reviewed head d097ab4 |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
People reading a streaming agent response can see long, unrendered link destinations until the final Markdown delimiter arrives. Presigned artifact URLs are especially noisy and may contain temporary access parameters.
Changes
Why: Streaming should keep readable content stable without exposing transport details that are not meant to be read.
How did you test this code?
pnpm --filter @posthog/ui test --run src/features/editor/components/StreamingMarkdown.test.tsx src/features/editor/components/splitMarkdownBlocks.test.tspnpm --filter @posthog/ui typecheckAutomatic notifications
Docs update
None.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Implemented with Codex through PostHog Code. No repository or public skills were invoked. The change extends the existing streaming Markdown boundary instead of changing completed Markdown rendering.
Created with PostHog Code