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(server): keep discovered workspace folder labels valid when an emoji crosses the name limit - #42133
When a project folder holds a repository named 127 ASCII as followed by 🚀 (a valid 131-byte Linux name), its saved label ends in a lone \ud83d instead of stopping before the emoji. The 128-UTF-16-unit label cut in WorkspaceFolders.ts splits the emoji's surrogate pair.
Change
The cut (also used for .code-workspace folder names) stops one unit earlier when it would split a surrogate pair, using the shared splitsSurrogatePair helper. Leading whitespace is trimmed first, so the step back can't blank a label. Names that fit are unchanged.
Scope
Bug fix for wrong stored data in discovered folder labels. The steps below reproduce it, so it needs no issue. Folders named with t3 project add --track use a separate limit, fixed in #42083.
Verification
Setup: Ubuntu 26.04.1, Node 26.13.1, git 2.53.0, fresh scratch folders, T3CODE_LOG_LEVEL=Warn, server named "Test machine". t3 is node <checkout>/apps/server/src/bin.ts. Before mounts base's WorkspaceFolders.ts over head. Screens, light theme: web (vp run dev, T3's Browser panel, 1280×800), desktop (vp run dev:desktop, driven over its debug port), Android 17 Pixel 10 emulator (SwiftShader) and iOS 27.2 iPhone 18 Pro simulator.
Steps: these commands on both revisions; the last prints the stored label's tail, length, isWellFormed(), discovered. For the screens, app also holds repositories named 127 spaces + 🚀 and web, and --base-dir matches vp run dev --home-dir; then (phones paired) Settings → Projects → app → Repositories.
name="$(printf 'a%.0s' {1..127})🚀"
git init -q "app/$name"
t3 project add app --base-dir state;echo"exit $?"
node -e 'const db = new (require("node:sqlite").DatabaseSync)("state/userdata/statev2.sqlite"); const [f] = JSON.parse(db.prepare("SELECT tracked_folders_json FROM projection_projects").get().tracked_folders_json); console.log(JSON.stringify(f.name.slice(-3)), f.name.length, f.name.isWellFormed(), f.discovered)'
On newest green main b6a04be41c51 they print the Before line; merged cleanly with 3dbeb77c7192, the After line.
An AI agent found this reading the cut against the 128-unit limit, and ran each check:
The scan test now also finds repositories named 127 letters + 🚀 (labelled as the letters), 126 letters + 🚀 (kept) and 127 spaces + 🚀 (labelled 🚀). It fails on 26f4c7550e7a, and on 3dbeb77c7192 without the surrogate check or the leading trim.
WorkspaceFolders.test.ts passes 3 of 3 serial runs on 3dbeb77c7192 and passes on the merge; vp run check:changed passes.
Reviewing files that changed from the base of the PR and between 3dbeb77 and 5f63769.
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
Workspace folder names are trimmed and capped at 128 UTF-16 code units. Truncation avoids splitting surrogate pairs. The scan tests cover whitespace-padded names and labels at the truncation boundary.
Changes: Workspace folder name bounds
Layer / File(s)
Summary
Bound and validate folder names apps/server/src/workspace/WorkspaceFolders.ts, apps/server/src/workspace/WorkspaceFolders.test.ts
boundedName trims leading whitespace, avoids splitting surrogate pairs when it truncates names to 128 UTF-16 code units, and trims trailing whitespace. Scan tests cover padded names and emoji at the boundary.
Discovered workspace folder labels that fall on the 128-character limit no longer end in a broken half-emoji. Names that already fit are unchanged. The change is small and covered by new boundary tests, and no merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: discovered workspace folder labels are kept valid when an emoji crosses the 128-unit name limit. It follows conventional commit form and matches the WorkspaceFolders.t…
Description check
The description follows the template. It covers Problem (a 127-ASCII-letter plus rocket-emoji repository stores a lone surrogate), Change (cut steps back on a split surrogate pair, leading whitespace …
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: discovered workspace folder labels are kept valid when an emoji crosses the 128-unit name limit. It follows conventional commit form and matches the WorkspaceFolders.ts change, the surrogate-pair check, and the test additions.
Full details: Description check
Explanation
The description follows the template. It covers Problem (a 127-ASCII-letter plus rocket-emoji repository stores a lone surrogate), Change (cut steps back on a split surrogate pair, leading whitespace trimmed first), Scope (bug fix with reproduction steps, separate --track limit referenced to #42083), and Verification (detailed setup, before/after outputs, test results, and screenshots). It does not state the agent model in the template's requested form, but it does name Claude Opus 5.5 at the end. Overall it is mostly complete and specific.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Created the three boundary-case repositories, added their parent through the project CLI, and opened Settings → Projects → emoji-labels → Repositories on fresh state for each commit. The space-padded label visibly changes from a replacement character to 🚀. The scenario also checks the exact rendered names for all three cases and Unicode validity. scenarios:prove exited 0.
Environment: Chromium, 1920×1000, light theme, Noto Color Emoji; local path descriptions hidden for privacy. Details below are crops of the inspected app captures.
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
When a project folder holds a repository named 127 ASCII
as followed by🚀(a valid 131-byte Linux name), its saved label ends in a lone\ud83dinstead of stopping before the emoji. The 128-UTF-16-unit label cut inWorkspaceFolders.tssplits the emoji's surrogate pair.Change
The cut (also used for
.code-workspacefolder names) stops one unit earlier when it would split a surrogate pair, using the sharedsplitsSurrogatePairhelper. Leading whitespace is trimmed first, so the step back can't blank a label. Names that fit are unchanged.Scope
Bug fix for wrong stored data in discovered folder labels. The steps below reproduce it, so it needs no issue. Folders named with
t3 project add --trackuse a separate limit, fixed in #42083.Verification
Setup: Ubuntu 26.04.1, Node 26.13.1, git 2.53.0, fresh scratch folders,
T3CODE_LOG_LEVEL=Warn, server named "Test machine".t3isnode <checkout>/apps/server/src/bin.ts. Before mounts base'sWorkspaceFolders.tsover head. Screens, light theme: web (vp run dev, T3's Browser panel, 1280×800), desktop (vp run dev:desktop, driven over its debug port), Android 17 Pixel 10 emulator (SwiftShader) and iOS 27.2 iPhone 18 Pro simulator.Steps: these commands on both revisions; the last prints the stored label's tail, length,
isWellFormed(),discovered. For the screens,appalso holds repositories named 127 spaces +🚀andweb, and--base-dirmatchesvp run dev --home-dir; then (phones paired) Settings → Projects → app → Repositories.26f4c7550e7a3dbeb77c7192Web: the padded repository shows �
Web: the padded repository shows 🚀
Desktop: the padded repository shows �
Desktop: the padded repository shows 🚀
Android: the padded repository shows �
Android: the padded repository shows 🚀
iOS: the padded repository shows �
iOS: the padded repository shows 🚀
Before,
26f4c7550e7a, last two lines:After,
3dbeb77c7192:On newest green main
b6a04be41c51they print the Before line; merged cleanly with3dbeb77c7192, the After line.An AI agent found this reading the cut against the 128-unit limit, and ran each check:
🚀(labelled as the letters), 126 letters +🚀(kept) and 127 spaces +🚀(labelled🚀). It fails on26f4c7550e7a, and on3dbeb77c7192without the surrogate check or the leading trim.WorkspaceFolders.test.tspasses 3 of 3 serial runs on3dbeb77c7192and passes on the merge;vp run check:changedpasses.Links: the commits above, the test rows and the proof scripts.
Not shown:
Generated with Claude Opus 5.5 in T3 Code Nightly