From dcbb162b43ee438a8afd512459bc5713838fe3ed Mon Sep 17 00:00:00 2001 From: nullStack65 <112618179+nullStack65@users.noreply.github.com> Date: Sat, 21 Nov 2026 06:13:33 +0000 Subject: [PATCH] fix(web): show the sidebar filter tint when filters change The filter button no longer draws an unread-style dot, and it sets text-primary on the sliders icon when the filter differs from the default. SidebarMenuButton paints direct svg children with the sidebar icon color, and that rule beats a plain text-primary, so the changed filter had no visible mark. The icon now uses an important primary color. Model: grok-4.7 Task: fix Agent: Platform Harness: t3 --- .../components/sidebar/SidebarThreadFilterMenu.tsx | 3 ++- .../components/sidebar/threadListFilter.logic.test.ts | 8 ++++++++ .../src/components/sidebar/threadListFilter.logic.ts | 11 +++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/sidebar/SidebarThreadFilterMenu.tsx b/apps/web/src/components/sidebar/SidebarThreadFilterMenu.tsx index 29691cb2208b1..701c9de907c69 100644 --- a/apps/web/src/components/sidebar/SidebarThreadFilterMenu.tsx +++ b/apps/web/src/components/sidebar/SidebarThreadFilterMenu.tsx @@ -32,6 +32,7 @@ import { import { SidebarHeaderIconButton } from "./SidebarThreadHeader"; import { changedThreadListFilters, + sidebarFilterIconClass, EMPTY_THREAD_LIST_FILTER_BUCKETS, inboxMenuOrder, type olderSettledFilterCounts, @@ -91,7 +92,7 @@ export function SidebarThreadFilterMenu({ return ( }> - 0 && "text-primary")} /> + 0)} /> { ).toBe(true); }); + it("tints a changed filter with an important primary color", () => { + // SidebarMenuButton's `[&>svg]:text-[var(--sidebar-icon-color)]` beats a + // plain text-primary on the icon, so the default class must not claim one. + expect(sidebarFilterIconClass(false)).toBe("size-4"); + expect(sidebarFilterIconClass(true)).toBe("size-4 text-primary!"); + }); + it("reports only sections that differ from this device's default", () => { const environments = [laptop, crown]; const unchanged = threadListFilterOf({ founderInboxOwner: "jeff" }); diff --git a/apps/web/src/components/sidebar/threadListFilter.logic.ts b/apps/web/src/components/sidebar/threadListFilter.logic.ts index dd2bc6b3fc368..9c4d4b1ba9c7b 100644 --- a/apps/web/src/components/sidebar/threadListFilter.logic.ts +++ b/apps/web/src/components/sidebar/threadListFilter.logic.ts @@ -200,6 +200,17 @@ export function toggleHiddenEnvironment( const sameMembers = (left: ReadonlyArray, right: ReadonlyArray) => left.length === right.length && left.every((value) => right.includes(value)); +/** + * Class for the filter sliders icon. + * + * `SidebarMenuButton` sets `[&>svg]:text-[var(--sidebar-icon-color)]` on the + * button, and that rule beats a plain `text-primary` on the icon, at rest and + * on hover. The important utility is what makes a non-default filter visible. + */ +export function sidebarFilterIconClass(changed: boolean): string { + return changed ? "size-4 text-primary!" : "size-4"; +} + /** Filter sections that differ from this device's default, ignoring removed environments. */ export function changedThreadListFilters( filter: ThreadListFilter,