Skip to content

Commit dcbb162

Browse files
committed
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
1 parent c0649bf commit dcbb162

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
import { SidebarHeaderIconButton } from "./SidebarThreadHeader";
3333
import {
3434
changedThreadListFilters,
35+
sidebarFilterIconClass,
3536
EMPTY_THREAD_LIST_FILTER_BUCKETS,
3637
inboxMenuOrder,
3738
type olderSettledFilterCounts,
@@ -91,7 +92,7 @@ export function SidebarThreadFilterMenu<T extends CountedThread>({
9192
return (
9293
<Menu>
9394
<MenuTrigger render={<SidebarHeaderIconButton label={label} />}>
94-
<SlidersHorizontalIcon className={cn("size-4", summary.length > 0 && "text-primary")} />
95+
<SlidersHorizontalIcon className={sidebarFilterIconClass(summary.length > 0)} />
9596
</MenuTrigger>
9697
<MenuPopup align="end" className="w-[min(19rem,var(--available-width))]">
9798
<SidebarThreadFilterOptions

‎apps/web/src/components/sidebar/threadListFilter.logic.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { describe, expect, it } from "vite-plus/test";
44

55
import {
66
changedThreadListFilters,
7+
sidebarFilterIconClass,
78
inboxMenuOrder,
89
matchesThreadListFilter,
910
olderSettledFilterCounts,
@@ -96,6 +97,13 @@ describe("thread list filter", () => {
9697
).toBe(true);
9798
});
9899

100+
it("tints a changed filter with an important primary color", () => {
101+
// SidebarMenuButton's `[&>svg]:text-[var(--sidebar-icon-color)]` beats a
102+
// plain text-primary on the icon, so the default class must not claim one.
103+
expect(sidebarFilterIconClass(false)).toBe("size-4");
104+
expect(sidebarFilterIconClass(true)).toBe("size-4 text-primary!");
105+
});
106+
99107
it("reports only sections that differ from this device's default", () => {
100108
const environments = [laptop, crown];
101109
const unchanged = threadListFilterOf({ founderInboxOwner: "jeff" });

‎apps/web/src/components/sidebar/threadListFilter.logic.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,17 @@ export function toggleHiddenEnvironment(
200200
const sameMembers = <A>(left: ReadonlyArray<A>, right: ReadonlyArray<A>) =>
201201
left.length === right.length && left.every((value) => right.includes(value));
202202

203+
/**
204+
* Class for the filter sliders icon.
205+
*
206+
* `SidebarMenuButton` sets `[&>svg]:text-[var(--sidebar-icon-color)]` on the
207+
* button, and that rule beats a plain `text-primary` on the icon, at rest and
208+
* on hover. The important utility is what makes a non-default filter visible.
209+
*/
210+
export function sidebarFilterIconClass(changed: boolean): string {
211+
return changed ? "size-4 text-primary!" : "size-4";
212+
}
213+
203214
/** Filter sections that differ from this device's default, ignoring removed environments. */
204215
export function changedThreadListFilters(
205216
filter: ThreadListFilter,

0 commit comments

Comments
 (0)