Skip to content

Commit 61b8848

Browse files
t3dotggclaude
andcommitted
feat(web): option to keep sidebar project icons in color; drop hero chevron
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent c6a28d7 commit 61b8848

7 files changed

Lines changed: 44 additions & 8 deletions

File tree

‎apps/web/src/components/chat/DraftHeroHeadline.tsx‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { composerDraftHasUserContent, useComposerDraftStore } from "~/composerDr
33
import { resolveEnvironmentMachineKind, type ScopedProjectRef } from "@t3tools/contracts";
44
import { scopedProjectKey, scopeProjectRef } from "@t3tools/client-runtime/environment";
55
import { isScratchProject } from "@t3tools/client-runtime/state/projects";
6-
import { ChevronDownIcon, FolderPlusIcon } from "lucide-react";
6+
import { FolderPlusIcon } from "lucide-react";
77
import { useAtomValue } from "@effect/atom-react";
88
import { useEffect, useRef, useState } from "react";
99

@@ -260,10 +260,6 @@ export function DraftHeroHeadline({
260260
value={isScratchDraft ? "No project" : (activeProjectDisplayName ?? "Choose a project")}
261261
singleLine
262262
/>
263-
<ChevronDownIcon
264-
aria-hidden
265-
className="size-[0.65em] shrink-0 self-center text-foreground/55"
266-
/>
267263
</TooltipTrigger>
268264
{activeProjectDisplayName && !isScratchDraft ? (
269265
<TooltipPopup side="top">{activeProjectDisplayName}</TooltipPopup>

‎apps/web/src/components/chat/DraftHeroProjectHeading.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ export function DraftHeroProjectHeading({
5252
</span>
5353
<span className="flex min-w-0 max-w-full items-baseline justify-center text-base tracking-normal lg:group-data-[inline=true]/draft-hero:text-3xl lg:group-data-[inline=true]/draft-hero:tracking-tight">
5454
<span className="min-w-0">{children}</span>
55-
<span className="hidden shrink-0 -ms-1 lg:group-data-[inline=true]/draft-hero:inline">
56-
?
57-
</span>
55+
<span className="hidden shrink-0 lg:group-data-[inline=true]/draft-hero:inline">?</span>
5856
</span>
5957
</h1>
6058
</div>

‎apps/web/src/components/settings/AppearanceSettingsPanel.tsx‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,32 @@ export function AppearanceSettingsPanel() {
351351
</div>
352352
}
353353
/>
354+
<SettingsRow
355+
{...searchableSetting("sidebar-project-icon-colors")}
356+
description="Show project icons in the sidebar in full color instead of gray."
357+
resetAction={
358+
settings.sidebarProjectIconColors !==
359+
DEFAULT_UNIFIED_SETTINGS.sidebarProjectIconColors ? (
360+
<SettingResetButton
361+
label="colored project icons"
362+
onClick={() =>
363+
updateSettings({
364+
sidebarProjectIconColors: DEFAULT_UNIFIED_SETTINGS.sidebarProjectIconColors,
365+
})
366+
}
367+
/>
368+
) : null
369+
}
370+
control={
371+
<Switch
372+
checked={settings.sidebarProjectIconColors}
373+
onCheckedChange={(checked) =>
374+
updateSettings({ sidebarProjectIconColors: Boolean(checked) })
375+
}
376+
aria-label="Colored project icons"
377+
/>
378+
}
379+
/>
354380
<SettingsRow
355381
{...searchableSetting("math-rendering")}
356382
description="Typeset LaTeX math, such as $x^2$ or \[x^2\], in messages and Markdown previews. The composer keeps TeX source editable."

‎apps/web/src/components/settings/SettingsPanels.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,9 @@ export function useSettingsRestore(onRestored?: () => void) {
409409
...(settings.mathRenderingEnabled !== DEFAULT_UNIFIED_SETTINGS.mathRenderingEnabled
410410
? ["Render math"]
411411
: []),
412+
...(settings.sidebarProjectIconColors !== DEFAULT_UNIFIED_SETTINGS.sidebarProjectIconColors
413+
? ["Colored project icons"]
414+
: []),
412415
...(settings.panelAnimationDurationMs !== DEFAULT_UNIFIED_SETTINGS.panelAnimationDurationMs
413416
? ["Panel animations"]
414417
: []),
@@ -582,6 +585,7 @@ export function useSettingsRestore(onRestored?: () => void) {
582585
diffColorScheme: DEFAULT_UNIFIED_SETTINGS.diffColorScheme,
583586
chatWidth: DEFAULT_UNIFIED_SETTINGS.chatWidth,
584587
mathRenderingEnabled: DEFAULT_UNIFIED_SETTINGS.mathRenderingEnabled,
588+
sidebarProjectIconColors: DEFAULT_UNIFIED_SETTINGS.sidebarProjectIconColors,
585589
timestampFormat: DEFAULT_UNIFIED_SETTINGS.timestampFormat,
586590
notificationMode: DEFAULT_UNIFIED_SETTINGS.notificationMode,
587591
inAppNotificationsEnabled: DEFAULT_UNIFIED_SETTINGS.inAppNotificationsEnabled,

‎apps/web/src/components/settings/settingsSearch.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,12 @@ export const SETTINGS_SEARCH_ITEMS = [
263263
to: "/settings/appearance",
264264
searchTerms: ["wide full width column layout messages composer monitor"],
265265
},
266+
{
267+
id: "sidebar-project-icon-colors",
268+
title: "Colored project icons",
269+
to: "/settings/appearance",
270+
searchTerms: ["sidebar favicon logo grayscale gray color"],
271+
},
266272
{
267273
id: "math-rendering",
268274
title: "Render math",

‎apps/web/src/components/sidebar/SidebarThreadRow.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ import { Menu, MenuItem, MenuPopup, MenuSeparator, MenuShortcut, MenuTrigger } f
111111
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
112112
import { MiddleTruncate } from "../ui/middle-truncate";
113113
import { useThreadHasUnsentDraft } from "../../composerDraftStore";
114+
import { useClientSettings } from "../../hooks/useSettings";
114115

115116
// The fields thread rows show. Provider status pushes refresh `checkedAt`,
116117
// status and auth on every provider; leaving those out keeps each
@@ -642,6 +643,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
642643
wokeAtDate !== null &&
643644
(lastVisitedDate === null || lastVisitedDate < wokeAtDate) &&
644645
thread.settledOverride !== "settled";
646+
const projectIconColors = useClientSettings((s) => s.sidebarProjectIconColors);
645647
const shouldRecede = shouldRecedeSidebarThread({
646648
status,
647649
isUnread,
@@ -1281,6 +1283,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
12811283
"size-4 shrink-0",
12821284
// Repeated brand colors outshout titles; color returns on the row in focus.
12831285
!props.isActive &&
1286+
!projectIconColors &&
12841287
"opacity-60 grayscale group-focus-visible/sidebar-row:opacity-100 group-focus-visible/sidebar-row:grayscale-0 group-any-hover/sidebar-row:opacity-100 group-any-hover/sidebar-row:grayscale-0",
12851288
)}
12861289
/>

‎packages/contracts/src/settings.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,8 @@ export const ClientSettingsSchema = Schema.Struct({
475475
// Opt-in TeX typesetting in rendered Markdown. Off keeps math parsing and
476476
// KaTeX out of the render path entirely.
477477
mathRenderingEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
478+
// Sidebar project icons rest in grayscale so titles lead; this keeps their colors.
479+
sidebarProjectIconColors: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
478480
});
479481
export type ClientSettings = typeof ClientSettingsSchema.Type;
480482

@@ -1680,5 +1682,6 @@ export const ClientSettingsPatch = Schema.Struct({
16801682
snapShotAnimations: Schema.optionalKey(Schema.Boolean),
16811683
wordWrap: Schema.optionalKey(Schema.Boolean),
16821684
mathRenderingEnabled: Schema.optionalKey(Schema.Boolean),
1685+
sidebarProjectIconColors: Schema.optionalKey(Schema.Boolean),
16831686
});
16841687
export type ClientSettingsPatch = typeof ClientSettingsPatch.Type;

0 commit comments

Comments
 (0)