Repository navigation
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6394cd2a1e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| textAlign: textAlign, | ||
| maxLines: maxLines, | ||
| inlineComponents: inlineComponents, | ||
| inlinePatterns: inlinePatterns, |
There was a problem hiding this comment.
Handle reference-style images in attachment preprocessing
When a bubbled message uses newly supported reference-style media such as ![shot][1]\n\n[1]: https://example.com/shot.png, this plusparse path resolves it and invokes imageBuilder, but messageBubbleSegments() and extractTrailingImageGallery() still recognize only inline  syntax. The image therefore remains inside the text bubble instead of receiving attachment corners, and multiple trailing reference images do not form a gallery; resolve reference definitions before classifying attachments or extend both preprocessors to understand this syntax.
Useful? React with 👍 / 👎.
6394cd2 to
78b9c1a
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78b9c1a6d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Move message Markdown off the legacy regex pipeline, which the deprecated inlineComponents API forced, onto the CommonMark parser that 1.3 added. Mentions, custom emoji and #channel tokens become InlinePatterns; links go through inlineLinkBuilder into the existing _buildLink. Drop workarounds the new parser makes unnecessary: the escape shielding in the render path and the _MarkdownEscapeMd, _MarkdownLabelEntityMd and _MessageLinkMd components, plus the zero-width prefix before a leading handling. Keep \[ \] \( \) literal, as on desktop: plusparse hard-codes them as LaTeX delimiters, so they are written as entities before rendering. Synthesized autolink labels escape backslashes instead of using an entity, which the parser leaves undecoded in a URL-shaped label. Keep non-interactive repo/PR/issue chips as their own semantics node, and clip forum card previews instead of overflowing now that blocks lay out as a column. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tom Brow <tomb@squareup.com>
A real-message diff against desktop's parser found three differences: - A table typed directly under a caption line showed raw pipes. GFM lets a table interrupt a paragraph; plusparse doesn't, so a blank line is inserted before such a table. - `> [!NOTE]` quotes became alerts. Desktop has no alerts, so they stay quotes. - An unclosed backtick run paired with a run in a later block, flipping later code and prose, so math-delimiter escapes leaked into code as entities. A code span now ends with its paragraph. Bubble segmentation now unescapes a link destination itself before the imeta lookup, since content no longer arrives shielded (#8940 relied on that). Also pins gpt_markdown to exactly 1.3.4. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tom Brow <tomb@squareup.com>
A block quote interrupts a paragraph, so an unmatched backtick must not pair with one inside a quote that follows it. Otherwise the quoted bare URL skipped normalization and rendered as non-clickable text. Quoted code spans that continue on the next line at the same depth are unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Tom Brow <tomb@squareup.com>
78b9c1a to
45f75bf
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45f75bf51c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // stand-ins that _MarkdownEscapeMd and the link builders restore. | ||
| final markdownContent = useMemoized( | ||
| () => shieldMarkdownProseEscapes(galleryText), | ||
| () => separateMarkdownTables(escapeMarkdownMathDelimiters(galleryText)), |
There was a problem hiding this comment.
Preserve reference-definition destinations before plusparse
When a newly supported reference link has a normal HTTP definition such as [docs][1]\n\n[1]: https://example.com/docs, the earlier normalizeBareLinks(content) call rewrites the definition destination into [https://example.com/docs](https://example.com/docs) before this plusparse pipeline receives it. The reference consequently resolves to that synthetic Markdown string rather than the HTTP URL, so _buildLink does not open it; exclude reference-definition destinations from bare-link normalization before enabling reference-style parsing.
Useful? React with 👍 / 👎.
| final _paragraphBreak = RegExp( | ||
| r'[ \t]*(?:$|[-*+][ \t]|\d{1,9}[.)][ \t]|#{1,6}(?:[ \t]|$)|`{3}|~{3})', | ||
| multiLine: true, |
There was a problem hiding this comment.
Recognize setext underlines as paragraph boundaries
When an unmatched backtick precedes a setext underline, this expression does not treat --- or === as the end of the paragraph. For example, title \n---\nhttps://example.com code`` pairs the title's backtick with the one in the later paragraph, causing normalizeBareLinksto skip that URL; plusparse then renders the heading and later paragraph separately, andautolink: false` leaves the URL non-clickable. Add setext/thematic-break lines to the paragraph terminators.
Useful? React with 👍 / 👎.
Message Markdown on mobile moves from gpt_markdown 1.2.1's legacy regex pipeline to the CommonMark parser that 1.3 added ("plusparse"). Before this, passing
inlineComponents(now deprecated, removed in 2.0.0) kept every message on the legacy pipeline.What changes for users
Rendering moves closer to desktop (react-markdown + remark-gfm):
_italic_and__bold__work, backslash escapes and HTML entities decode, and[a [b] c](url)labels are correct."```npm install```"in a sentence is inline code, and four-backtick fences work.~~~fences,1)lists and CommonMark list/quote continuation render.\[,\],\(and\)stay literal, as on desktop. Plusparse hard-codes them as LaTeX delimiters, so they're written as entities before rendering.__init__now renders as bold "init", and a line over---becomes a heading, same as desktop.Device benchmark (iPhone SE, profile build, 600 synthetic messages, 3 launches per build): scrolling spends 9% less time building, and frames with more than 8 ms of build drop from 63 to 22. Jumping onto unbuilt messages is 11% cheaper, and raster time is unchanged.
App size: the release app grows about 4.6 MB uncompressed (80.6 to 85.2 MB), mostly Dart code from the new math and highlighting packages.
Before and after
Synthetic messages that reproduce differences found in real channel history, rendered through
MessageContenton main and on this branch:How
Mentions, custom emoji and
#channeltokens areInlinePatterns. Links go throughinlineLinkBuilderinto the existing_buildLink, so chips, media links and taps are unchanged.Removed workarounds the parser makes unnecessary:
_MarkdownEscapeMd,_MarkdownLabelEntityMdand_MessageLinkMdcomponents#channelPlain-text previews and gallery helpers keep their own escape handling.
normalizeBareLinksstays because attachment and gallery detection depend on its output. Bubble segmentation unescapes a link destination itself before its imeta lookup, since content no longer arrives shielded.Kept desktop parity where plusparse differs from GFM:
> [!NOTE]quotes render as quotes (alertBuilderreturnsasBlockQuote()), since desktop has no alertsmapMarkdownProsenow ends an unclosed backtick run at its paragraph. Before, it could pair with a run in a later block and flip code and prose for the rest of the message.Synthesized autolink labels escape backslashes instead of using
\, which the parser leaves undecoded in a URL-shaped label.Repo/PR/issue chips keep their own semantics node.
Forum card previews clip at their 120 px cap instead of overflowing: blocks now lay out as a column.
Pinned to exactly 1.3.4. 1.4.0 renders HTML by default and themes through the separate
material_uipackage, which would need a theme bridge.Validation
MessageContenton main and on this branch. 29 differed in text or styling. On inline and fenced code, the branch matched desktop's parser (remark-gfm) in 23 of them and main in 7. The review found the three parity gaps above, now fixed. The rest are CommonMark behavior that desktop shares.#channelrenders as a link, not a headingLinkButtoncheck passed even with autolink onBefore merge
🤖 Generated with Claude Code