Repository navigation
fix(vcs): keep emoji intact in review commit subjects - #43030
juliusmarminge merged 2 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…-subject-surrogate-safe
EvidenceCreated 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.
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. |




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.
getReviewBranchCommitsandreadReviewCommitMessageinapps/server/src/vcs/GitVcsDriverCore.tsboth cut with a plain.sliceat 300.Change
A small
truncateReviewSubjecthelper inGitVcsDriverCore.tscuts atREVIEW_BRANCH_SUBJECT_LIMITand steps back one code unit when the cut would split a surrogate pair, using the existingsplitsSurrogatePairfrom@t3tools/shared/assistantCitations. Both subject paths use it, and the selected-commit path now uses the named limit instead of a literal300. A new case inGitVcsDriverCore.test.tscommits a 299-character subject followed by an emoji in a real temporary repository and checks both the branch commit list and the commit preview'scommitSubject.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.
On 82e6b02 the tooltip ends "on launch" followed by a broken character.
On 2fed2ca the tooltip ends "on launch" with no broken character.
An AI agent ran these checks. The new
GitVcsDriverCore.test.tscase fails on 82e6b02 (both subjects end in a lone\ud83d) and passes on 2fed2ca. The fullGitVcsDriverCore.test.tsfile passes (385 tests), andvp run check:changedexits 0.Not shown:
readReviewCommitMessagepath; the test covers it).Generated with Claude Opus 5.5 in T3 Code Nightly