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): keep review comment text inside its context block by saphid · Pull Request #14780 · pingdotgg/t3code

Conversation

@saphid

@saphid saphid commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Review-comment prose containing literal <review_comment> or </review_comment> can be truncated or parsed as an extra attachment in the legacy pre-inlineMessageContext wire path and mobile's review composer. Mobile formats comments into that legacy text before upgrading them into typed draft records; current web-to-current-server sends already use typed records and bypass the legacy serializer.

Escape only delimiter-shaped tags and entity runs that would otherwise be ambiguous, and decode one escape level after readers establish block boundaries. Ordinary &, &&, and & in comment prose and code remain byte-identical on the wire. Keep the bodyEncoding marker so historical literal <review_comment text is not decoded. The shared reader already tracks code fences; quoted source is neutralized specifically for mobile's fence-unaware parseReviewInlineComments and message-segment parser. Mobile's attachment counter uses the matching Unicode tag boundary required by its regression test.

Verification: the same 107 focused shared/mobile tests produce 10 failures on main and pass on this branch. New ordinary-ampersand checks fail on the pre-amend branch. Shared and mobile package typechecks, targeted lint, and formatting checks pass. Bundle rebuild/check is inapplicable because this upstream-main change has no extension bundle inputs. Mobile visual proof remains unverified; if needed, capture one mobile before/after of a comment containing literal </review_comment>.

GPT-6.1 Sol via T3 Code

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

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

All reactions
@saphid
fix(shared): keep review comment text inside its context block
5aab280
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 2, 2026
macroscopeapp[bot]
macroscopeapp Bot reviewed Oct 2, 2026
View reviewed changes
Comment thread apps/mobile/src/features/review/reviewCommentSelection.ts

export function countReviewCommentContexts(value: string): number {
return Array.from(value.matchAll(/<review_comment\b/g)).length;
return Array.from(value.matchAll(/<review_comment\b/giu)).length;

@macroscopeapp macroscopeapp Bot Oct 2, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium review/reviewCommentSelection.ts:285

countReviewCommentContexts counts case-insensitive <Review_Comment ...> openings, but the parser does not recognize them, so the review header shows a pending-comment count for text that produces no rendered inline comment. Keep this scan case-sensitive to match REVIEW_COMMENT_BLOCK_PATTERN.

Suggested change
return Array.from(value.matchAll(/<review_comment\b/giu)).length;
return Array.from(value.matchAll(/<review_comment\b/gu)).length;
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/mobile/src/features/review/reviewCommentSelection.ts around line 285:

`countReviewCommentContexts` counts case-insensitive `<Review_Comment ...>` openings, but the parser does not recognize them, so the review header shows a pending-comment count for text that produces no rendered inline comment. Keep this scan case-sensitive to match `REVIEW_COMMENT_BLOCK_PATTERN`.

Sorry, something went wrong.

Uh oh!

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

All reactions
@macroscopeapp

macroscopeapp Bot commented Oct 2, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Would Approve

Macroscope's review found this PR approvable — This is a narrowly scoped compatibility bug fix that preserves review-comment text across legacy serialization paths, with extensive regression coverage and no product-default, schema, deployment, security, billing, or authentication changes. A remaining medium automated finding concerns a counter/parser case-sensitivity mismatch, but it is isolated from the core serialization fix.

Not approved because:

  • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

All reactions

Sorry, something went wrong.

Uh oh!

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

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 2, 2026 — with ChatGPT Codex Connector
@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 47168702-82ec-4e47-9d81-e304811c7642

📥 Commits

Reviewing files that changed from the base of the PR and between 54084ae and 5aab280.

📒 Files selected for processing (6)
  • apps/mobile/src/features/review/reviewCommentSelection.test.ts
  • apps/mobile/src/features/review/reviewCommentSelection.ts
  • packages/shared/src/composerContextLegacy.test.ts
  • packages/shared/src/composerContextLegacy.ts
  • packages/shared/src/composerContextLegacySend.test.ts
  • packages/shared/src/composerContextLegacySend.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Review-comment serialization now escapes delimiter-shaped content in comment text and quoted diffs, and adds a body-encoding marker. Inline and legacy readers decode marked bodies while preserving unmarked or unknown encodings.

Changes

Review comment body encoding

Layer / File(s) Summary
Serialize review comments
packages/shared/src/composerContextLegacySend.ts, packages/shared/src/composerContextLegacySend.test.ts, apps/mobile/src/features/review/reviewCommentSelection.ts
Serialization adds a body-encoding marker and neutralizes review-comment tags in comment text and quoted diffs. Tests cover entity-like text and delimiter-shaped content.
Read encoded review comments
packages/shared/src/composerContextLegacy.ts, packages/shared/src/composerContextLegacy.test.ts, apps/mobile/src/features/review/reviewCommentSelection.ts, apps/mobile/src/features/review/reviewCommentSelection.test.ts
Inline and legacy readers decode only bodies with the supported marker. Tests cover marked, unmarked, and unknown encodings, plus comment text and diffs.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: chrisdeeming

Merge Risk: ⚪ Minimal · up to 5aab2

No merge-blocking issue is established; the change is ready for normal merge checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 5aab2

The change strengthens comment-boundary handling, and no new security issue was established in the reviewed paths. Risk remains low because the format crosses shared and mobile readers, while mixed-version deployment behavior is not fully verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated exposure is comment prose and quoted diff content entering legacy attachment reconstruction and mobile message segmentation. The reviewed public entrypoint is a library-format change, not evidence of a newly exposed network endpoint.

Security Findings and Attack Paths

  • inferred — No introduced delimiter-based boundary bypass was established in the scoped producer-consumer trace. Attacker-controlled review-shaped content is neutralized before serialization, and supported decoding occurs only after the readers establish ownership of the body.

Trust Boundaries and Controls

  • observed — Boundary-first parsing and marker-gated decoding separate structural review-comment delimiters from literal delimiters in comment content. Mobile additionally treats reference labels as opaque during block matching.

Resilience and Maintainability Implications

  • observed — Legacy reconstruction is an in-memory read-time conversion rather than an event-history rewrite. Semantic section, file and range metadata are retained, while context identifiers are reconstructed under the existing legacy conversion model.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description clearly explains the problem, implementation, affected paths, and focused verification results. It does not include the required Scope and approval section or provide a triaged issue, … Add the Scope and approval section. Include the triaged issue or explicit maintainer approval with its discussion link and approval comment. If no prior issue or discussion exists, explain why this is a small, focused fix of an obvious bug …
Docstring Coverage ⚠️ Warning Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main fix: keeping review comment text inside its legacy context block.
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: Description check

Explanation

The description clearly explains the problem, implementation, affected paths, and focused verification results. It does not include the required Scope and approval section or provide a triaged issue, maintainer approval, or a clear explanation of why this focused fix qualifies for an exemption.

Resolution

Add the Scope and approval section. Include the triaged issue or explicit maintainer approval with its discussion link and approval comment. If no prior issue or discussion exists, explain why this is a small, focused fix of an obvious bug that qualifies for the exemption.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

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

@saphid

saphid commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing this myself to follow CONTRIBUTING's problem-and-scope guidance. The fix adds an escaping scheme and an encoding marker to the legacy review-comment serializer, which is more than a trivially obvious change, and I haven't yet shown the failure in a real mobile client. I've opened # describing the defect (review-comment text containing a literal </review_comment> is truncated or split into an extra attachment on the legacy/mobile path) so maintainers can confirm the intended behavior first. If it's triaged, I'll return with a focused PR, before/after mobile captures, and the case-sensitivity mismatch flagged by Macroscope fixed. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

@saphid saphid closed this Oct 2, 2026
@only21mil only21mil mentioned this pull request Oct 22, 2026
fix(mobile): show draft review comments inline and in the count #23602
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] left review comments

Uh oh!

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

Assignees

No one assigned

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:M 30-99 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

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