Skip to content

Conversation

@adamleithp
Copy link
Contributor

@adamleithp adamleithp commented Oct 17, 2025

Problem

Emojis weren't rendering properly in the collapsed project dropdown
darkmode with letters in collapsed project dropdown had poor contrast
image

Changes

use codepoint instead of slice (emojis are more than one byte)
image

ensure contrast regardless of theme for darkmode
image

How did you test this code?

locally

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

<div className="Lettermark bg-[var(--color-bg-fill-button-tertiary-active)] w-5 h-5 ">
{currentTeam.name.slice(0, 1).toLocaleUpperCase()}
<div className="Lettermark bg-[var(--color-bg-fill-button-tertiary-active)] w-5 h-5 dark:text-tertiary">
{String.fromCodePoint(currentTeam.name.codePointAt(0)!).toLocaleUpperCase()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Potential crash if currentTeam.name is empty string. codePointAt(0) on empty string returns undefined, causing String.fromCodePoint(undefined) to fail.

Suggested change
{String.fromCodePoint(currentTeam.name.codePointAt(0)!).toLocaleUpperCase()}
{currentTeam.name ? String.fromCodePoint(currentTeam.name.codePointAt(0)!).toUpperCase() : 'P'}
Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/lib/components/Account/ProjectMenu.tsx
Line: 70:70

Comment:
**logic:** Potential crash if `currentTeam.name` is empty string. `codePointAt(0)` on empty string returns `undefined`, causing `String.fromCodePoint(undefined)` to fail.

```suggestion
                            {currentTeam.name ? String.fromCodePoint(currentTeam.name.codePointAt(0)!).toUpperCase() : 'P'}
```

How can I resolve this? If you propose a fix, please make it concise.

@github-actions
Copy link
Contributor

Size Change: 0 B

Total Size: 3.3 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 3.3 MB

compressed-size-action

@adamleithp adamleithp merged commit 7cd732f into master Oct 20, 2025
127 of 129 checks passed
@adamleithp adamleithp deleted the ux/project-dropdown-handle-emoji-plus-darkmode-fix branch October 20, 2025 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants