Show colored icons for projects without an icon
The letter-on-grey placeholder is replaced by a fill whose color is a deterministic hash of the project key, so each project keeps a stable color across the sidebar, projects list, and settings header. Mid- saturation tones keep the white letter legible in both themes.
This commit is contained in:
@@ -6,6 +6,13 @@ export function projectIconQueryKey(serverId: string, cwd: string) {
|
||||
return ["projectIcon", serverId, cwd] as const;
|
||||
}
|
||||
|
||||
export function projectIconToDataUri(icon: ProjectIcon | null): string | null {
|
||||
if (!icon) {
|
||||
return null;
|
||||
}
|
||||
return `data:${icon.mimeType};base64,${icon.data}`;
|
||||
}
|
||||
|
||||
interface UseProjectIconQueryOptions {
|
||||
serverId: string;
|
||||
cwd: string;
|
||||
|
||||
Reference in New Issue
Block a user