Skip to content

fix(web): keep literal characters in sticky message previews - #2272

Merged
chuks-qua merged 4 commits into
mainfrom
fix/sticky-preview-literal-chars
Oct 21, 2026
Merged

chuks-qua merged 4 commits into
mainfrom
fix/sticky-preview-literal-chars

Conversation

@chuks-qua

@chuks-qua chuks-qua commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

The sticky header at the top of a conversation removed every _, *, [, ], (, ), #, > and ~ from the last prompt. delegate_task showed as "delegatetask", and a link showed its text and URL run together. The message bubble below was correct.

The preview now removes only Markdown syntax. It drops heading and quote markers at the start of a line. It removes emphasis, strikethrough and link syntax only where they act as delimiters. Code span contents stay verbatim. Literal underscores, brackets, parentheses, # and > stay as typed.

The inline stripping lives in a new apps/web/src/lib/inline-markdown.ts. The update card's release-notes parser had its own copy of these rules with the same code-span bug, so it now uses the shared helper too.

Verified in the web app against a fixture-repo thread (screenshots below), with new unit cases in user-message-preview.test.ts. They failed on the first commit and pass on the fix. The existing release-notes tests pass unchanged.

Why

Prompts are full of identifiers, paths and URLs. A header that rewrites them misleads the user about what they asked. Closes #2269.

UI Changes

Same thread, same scroll position. Prompt: Check thread_target_list and delegate_task in `src/__tests__/a_b.ts`, see [the docs](https://example.com/a_(b)).

Before After
before after

Review Notes

Rules follow CommonMark delimiter behavior without a full parser. Unquoted __init__ still renders as "init", which matches the message bubble, since Markdown makes it bold there too. Parsing with mdast instead would add about 23 KB gzipped to the eager transcript chunk, because the Markdown renderer is lazy-loaded today.

On input made almost entirely of unclosed delimiters, the lazy regexes are quadratic: about 250 ms for 50,000 characters. The old release-notes regex had the same shape. Ordinary prompts are unaffected.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

The sticky header stripped every _, *, [, ], (, ) and # from the prompt,
so identifiers like delegate_task showed as delegatetask. Move the release
notes Markdown stripper into a shared helper that removes only real
delimiters and keeps code span contents verbatim, and use it for both.
@chuks-qua
chuks-qua enabled auto-merge (squash) October 21, 2026 13:59
writeHandoffAudit created the audit directory before writing handoff.md, so a
reader between the two steps hit ENOENT. The provider-switch test read the audit
in that window and failed in CI. The file is now written under a temporary name
and renamed into place, readers skip a directory whose handoff.md is not there
yet, and the tests wait for the switch audit, which trails turn settlement.
@chuks-qua
chuks-qua merged commit 7bb8433 into main Oct 21, 2026
11 checks passed
@chuks-qua
chuks-qua deleted the fix/sticky-preview-literal-chars branch October 21, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sticky message header strips underscores and brackets from the prompt

1 participant