You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): long VS Code theme names no longer end in a broken emoji - #44044
Importing a VS Code theme cuts its name to 48 UTF-16 code units with .slice(0, 48) in apps/web/src/vscodeThemeImport.ts. When an emoji sits across unit 48, the cut keeps only the first half of the emoji's surrogate pair, so the saved theme label ends in a broken character (U+FFFD). This happens in two places in that file: resolveName (the theme's own displayName/name) and the rename helper in resolveThemeLabelCollisions (a same-named theme renamed from its file name).
Change
Both cuts now use the existing splitsSurrogatePair helper from @t3tools/shared/assistantCitations and cut at 47 when 48 would split a pair, matching the pattern apps/web already uses (for example PullRequestListEmptyState.tsx). I added one test in apps/web/src/vscodeThemeImport.test.ts covering both paths. Only one production file is changed.
Scope
This is a bug fix for corrupted data (a saved label with a broken character); a one-file bug like this needs no issue. #42274 tried a wider multi-file version and was closed unmerged by its author. This PR covers only vscodeThemeImport.ts; the "Keep both" copy name in ThemeImportDialog.tsx is a separate open PR, #44027.
Verification
Setup: Linux, T3 Code web from source (vp run dev), Chromium in T3's browser panel, 1280×800, the imported dark theme applied, fresh isolated data for each commit, no accounts.
Steps: Settings → Appearance → Add theme → paste {"name": "Midnight Harbor Theme with Soft Blue Highlights🌙", "type": "dark", "colors": {"editor.background": "#14161f", "editor.foreground": "#d8dee9"}} (47 characters plus 🌙) → Add theme → open the new theme's editor (pencil).
Reviewing files that changed from the base of the PR and between 376e606 and 1b57651.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
Theme import truncation now checks the 48-character boundary for surrogate pairs. If the boundary splits a pair, the name is truncated at 47 characters. A regression test covers imported names and collision labels.
Theme names and collision labels are truncated at 47 characters when the 48-character boundary splits a surrogate pair. The regression test checks both cases.
This change stops VS Code theme names from ending in a broken emoji character after truncation. It is a small, localized fix with a regression test, and no merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: long VS Code theme names no longer end in a broken emoji. It matches the fix in vscodeThemeImport.ts, which avoids splitting a surrogate pair at the 48-unit truncation…
Description check
The description follows the template. It has Problem, Change, Scope, and Verification sections, and each section has specific content. The Problem section gives the cause and both affected code paths.…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: long VS Code theme names no longer end in a broken emoji. It matches the fix in vscodeThemeImport.ts, which avoids splitting a surrogate pair at the 48-unit truncation point. The title uses the conventional commit format from the repository template.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections, and each section has specific content. The Problem section gives the cause and both affected code paths. The Change section explains the fix and the reuse of splitsSurrogatePair. The Scope section explains why no issue is linked and names related PRs. The Verification section gives reproduction steps, before and after results, and test outcomes, and it states what was not checked. The template asks for screenshots in UI changes, and the author provides before and after images. The template also asks for the model and harness used, and the author names Gemini 4 Neon in T3 Code Nightly. The Scope section does not link an issue, but it gives a reason for omitting one, as the template allows.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 656a1ac and 376e606.
Files selected for processing: 2
apps/web/src/vscodeThemeImport.test.ts
apps/web/src/vscodeThemeImport.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.
Imported the reported VS Code JSON through Settings → Appearance → Add theme, then opened the imported theme's editor and scrolled Theme name to its end. Real web app, Chromium, 1280×800, fresh synthetic state on both commits. Base retained a lone high surrogate and visibly rendered �; head omitted the whole emoji and ended at Highlights. The scenario failed on base and passed on head.
…ingdotgg#44044)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit ee38528)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
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.
Problem
Importing a VS Code theme cuts its name to 48 UTF-16 code units with
.slice(0, 48)inapps/web/src/vscodeThemeImport.ts. When an emoji sits across unit 48, the cut keeps only the first half of the emoji's surrogate pair, so the saved theme label ends in a broken character (U+FFFD). This happens in two places in that file:resolveName(the theme's owndisplayName/name) and therenamehelper inresolveThemeLabelCollisions(a same-named theme renamed from its file name).Change
Both cuts now use the existing
splitsSurrogatePairhelper from@t3tools/shared/assistantCitationsand cut at 47 when 48 would split a pair, matching the patternapps/webalready uses (for examplePullRequestListEmptyState.tsx). I added one test inapps/web/src/vscodeThemeImport.test.tscovering both paths. Only one production file is changed.Scope
This is a bug fix for corrupted data (a saved label with a broken character); a one-file bug like this needs no issue. #42274 tried a wider multi-file version and was closed unmerged by its author. This PR covers only
vscodeThemeImport.ts; the "Keep both" copy name inThemeImportDialog.tsxis a separate open PR, #44027.Verification
Setup: Linux, T3 Code web from source (
vp run dev), Chromium in T3's browser panel, 1280×800, the imported dark theme applied, fresh isolated data for each commit, no accounts.Steps: Settings → Appearance → Add theme → paste
{"name": "Midnight Harbor Theme with Soft Blue Highlights🌙", "type": "dark", "colors": {"editor.background": "#14161f", "editor.foreground": "#d8dee9"}}(47 characters plus 🌙) → Add theme → open the new theme's editor (pencil).The theme name ends in a broken character: "…Soft Blue Highlights�"
The theme name ends cleanly: "…Soft Blue Highlights"
The new test fails on the base source (1 failed, 43 passed) and passes on head (44 passed);
vp run check:changedpassed. An AI agent ran these checks.Not shown
Generated with Gemini 4 Neon in T3 Code Nightly