Skip to content

fix(vcs): keep emoji intact in review commit subjects - #43030

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/vcs-review-commit-subject-surrogate-safe
Nov 25, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/vcs-review-commit-subject-surrogate-safe

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

The server cuts the commit subjects shown in the Diff panel's commit list and selected-commit label to 300 UTF-16 code units. When an emoji starts at code unit 299, the cut keeps only the first half of its surrogate pair, so the subject ends in a broken character (�) in the commit tooltip and in the selected commit's label. getReviewBranchCommits and readReviewCommitMessage in apps/server/src/vcs/GitVcsDriverCore.ts both cut with a plain .slice at 300.

Change

A small truncateReviewSubject helper in GitVcsDriverCore.ts cuts at REVIEW_BRANCH_SUBJECT_LIMIT and steps back one code unit when the cut would split a surrogate pair, using the existing splitsSurrogatePair from @t3tools/shared/assistantCitations. Both subject paths use it, and the selected-commit path now uses the named limit instead of a literal 300. A new case in GitVcsDriverCore.test.ts commits a 299-character subject followed by an emoji in a real temporary repository and checks both the branch commit list and the commit preview's commitSubject.

Scope

Small fix of an obvious bug (a broken character in text the server generates), so no issue. Server only; the web Diff panel, which desktop also uses, shows these subjects. Mobile does not show them.

Verification

Setup: T3 web app from source (dev runner), Browser panel 1440x900, light theme, fresh isolated unseeded dev data on each commit (server labelled "Test machine"), Replay (dev) provider, a synthetic repository whose branch commit subject is 299 characters followed by 🚀.

Steps: add the repository as a project → start a Replay thread → open Changes → Diff scope menu → Commits → hover the commit to show its tooltip.

82e6b029800 (before) 2fed2ca810d (after)
On 82e6b029800 the tooltip ends "on launch" followed by a broken character.
On 82e6b02 the tooltip ends "on launch" followed by a broken character.
On 2fed2ca810d the tooltip ends "on launch" with no broken character.
On 2fed2ca the tooltip ends "on launch" with no broken character.

An AI agent ran these checks. The new GitVcsDriverCore.test.ts case fails on 82e6b02 (both subjects end in a lone \ud83d) and passes on 2fed2ca. The full GitVcsDriverCore.test.ts file passes (385 tests), and vp run check:changed exits 0.

Not shown:

  • Desktop on screen (same web Diff panel).
  • The selected-commit label (same readReviewCommitMessage path; the test covers it).

Generated with Claude Opus 5.5 in T3 Code Nightly

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

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Review commit subjects are truncated to 300 UTF-16 code units without splitting surrogate pairs. Commit previews and branch commit listings use the shared helper. A regression test covers an emoji at the truncation boundary.

Changes: Review subject truncation

Layer / File(s) Summary
Shared truncation and call sites
apps/server/src/vcs/GitVcsDriverCore.ts, apps/server/src/vcs/GitVcsDriverCore.test.ts
A shared helper truncates subjects without splitting surrogate pairs. Commit previews and branch commit listings use it. The regression test checks both paths with an emoji at the boundary.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge, stienswout

Merge Risk: Minimal · up to 102a6

Review commit subjects with emoji at the 300-character boundary no longer show a broken character. The change is small and localized with a regression test, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(vcs): keep emoji intact in review commit subjects" matches the changeset. The change truncates review commit subjects at 300 UTF-16 code units without splitting a surrogate pair, and th…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section states the broken surrogate pair and the affected functions. The Change section desc…
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: Title check

Explanation

The title "fix(vcs): keep emoji intact in review commit subjects" matches the changeset. The change truncates review commit subjects at 300 UTF-16 code units without splitting a surrogate pair, and the title names that fix, the affected area (review commit subjects), and the conventional commit prefix.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section states the broken surrogate pair and the affected functions. The Change section describes the truncateReviewSubject helper and the new test. The Scope section explains why no issue is linked, which the template permits for a small obvious-bug fix. The Verification section gives concrete setup, steps, before/after evidence, and test results, and it lists what was not checked. The description also names the model and harness, as the template asks. The template's conventional-commit title example is satisfied by the PR title.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2fed2ca and 102a6ff.

Files selected for processing: 1

  • apps/server/src/vcs/GitVcsDriverCore.ts

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 25, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Created a synthetic feature commit whose subject is 299 ASCII characters followed by 🚀. In the real web app, opened a Replay thread → Changes vs main → Diff scope → Commits, hovered the commit, then selected it. Both runs used Chromium, 1280×800, dark theme, and fresh isolated state.

Before After
Commit bf961f8121 102a6fff59
Tooltip Before: tooltip ends in replacement glyph After: tooltip ends cleanly
Selected commit Before: selected commit scope After: selected commit scope
Recording Before interaction After interaction
Observed text Tooltip and scope accessible name end in lone U+D83D. Both contain exactly 299 ASCII characters; the whole emoji is omitted.

Reproduction scenario

The real-app comparison exited 0: reproduced on base and fixed on head. The selected scope is visually ellipsized on both sides; its accessible name was checked directly.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 25, 2026
@juliusmarminge
juliusmarminge merged commit b9b1f57 into pingdotgg:main Nov 25, 2026
51 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 25, 2026
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 Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants