fix(navigation): preserve leading digit in project menu name#60210
Merged
eleftheriatrivyzaki merged 1 commit intoJun 1, 2026
Merged
Conversation
The account menu used `\p{Emoji}` to strip a leading emoji from the
project name before display. The Unicode `Emoji` property also covers
ASCII digits 0-9, `#`, and `*`, so any project name beginning with one
of those characters had its first character silently dropped (e.g.
"100Ddefault project" → "00Ddefault project").
Switch to `\p{Extended_Pictographic}`, which matches actual pictographic
emoji and excludes ASCII digits.
Generated-By: PostHog Code
Task-Id: 155eb630-77be-44d6-9612-0752e596622e
Contributor
|
🎭 Playwright didn't run on this PR — your changes touch code that could affect E2E behavior, but Playwright is opt-in via label now to keep CI cost down. Add the Most PRs don't need this. Real regressions still get caught on master and fix-forward. |
Contributor
|
Reviews (1): Last reviewed commit: "fix(navigation): preserve leading digit ..." | Re-trigger Greptile |
Contributor
|
Size Change: 0 B Total Size: 80.1 MB ℹ️ View Unchanged
|
adamleithp
approved these changes
May 30, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
In the account menu (top-level trigger and the "all projects" submenu trigger), project names whose first character is an ASCII digit have that first character silently dropped — e.g. a project named
100Ddefault projectrenders as00Ddefault project.#- and*-prefixed names are affected the same way.The intent of the existing code is to strip a leading emoji from the displayed name (so
🎉 Party projectshows asParty project), but the regex used to detect that emoji also matches characters most people would not consider emoji.Changes
frontend/src/lib/components/Account/NewAccountMenu.tsxused\p{Emoji}to detect and strip a leading emoji from the project name. Per Unicode, theEmojiproperty isYesfor ASCII digits0–9,#, and*— so/^\p{Emoji}/umatched and stripped the first character on any name starting with those.Swap both occurrences to
\p{Extended_Pictographic}, which is the Unicode property designed for "characters that should be considered emoji" and excludes ASCII digits,#, and*. Actual emoji prefixes continue to be stripped as before.How did you test this code?
I'm an agent. No automated tests were added or run for this change. The author manually verified locally that:
100Ddefault projectnow displays in full in the account menu and the "all projects" submenu (previously rendered as00Ddefault project)🎉 Party project) continue to have the leading emoji strippedPublish to changelog?
no
🤖 Agent context
Authored with PostHog Code (Claude Opus 4.7). The user spotted the bug locally and correctly hypothesized that the project-menu code was stripping the first character because it mistook a digit for an emoji.
The fix was narrowed to a single file after grepping the whole repo for
\p{Emoji}— only this one component uses the pattern, and there is no shared emoji-stripping utility to update.\p{Extended_Pictographic}was chosen over alternatives like\p{Emoji_Presentation}because the latter does not match emoji that need a variation selector (e.g.❤), so it would regress on some existing project names. TheLettermarkglyph elsewhere in the same file usescodePointAt(0)independently and is unaffected.Created with PostHog Code