fix(workspaces): use the emojibase shortcode preset for emoji suggestions (#11888)
Swap the worktree-name emoji picker from emojibase-data's `github` shortcode preset to `emojibase`, which carries both `flag_kr` and `south_korea` style flag names, and drop the hand-maintained `kr` entry that patched around the gap. Filter skin-tone aliases so they neither crowd the suggestion list nor clobber base-emoji branch names. Search now matches anywhere in the shortcode, ranked exact > prefix > word-start > substring, so `:korea` surfaces both Koreas. Emoji-derived branch names now prefer spelled-out aliases: flags use country names (japan, germany, south-korea) and cryptic stubs are skipped (thumbsdown over no, victory over v).
This commit is contained in:
@@ -77,7 +77,8 @@ describe('sanitizeWorktreeName', () => {
|
||||
it('uses readable git-safe shortcodes for known emoji', () => {
|
||||
expect(sanitizeWorktreeName('🚀')).toBe('rocket')
|
||||
expect(sanitizeWorktreeName('👩💻✨')).toBe('woman-technologist-sparkles')
|
||||
expect(sanitizeWorktreeName('🇯🇵')).toBe('jp')
|
||||
expect(sanitizeWorktreeName('🇯🇵')).toBe('japan')
|
||||
expect(sanitizeWorktreeName('👎')).toBe('thumbsdown')
|
||||
expect(sanitizeWorktreeName('1️⃣')).toBe('one')
|
||||
})
|
||||
|
||||
@@ -86,7 +87,8 @@ describe('sanitizeWorktreeName', () => {
|
||||
})
|
||||
|
||||
it('uses a git-safe fallback for emoji newer than the shortcode catalog', () => {
|
||||
expect(sanitizeWorktreeName('\u{1fae9}')).toBe('workspace')
|
||||
// Unassigned in Unicode 17, so no emojibase shortcode can cover it yet.
|
||||
expect(sanitizeWorktreeName('\u{1faeb}')).toBe('workspace')
|
||||
})
|
||||
|
||||
it('does not treat arbitrary punctuation as a workspace name', () => {
|
||||
|
||||
Reference in New Issue
Block a user