Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 40 additions & 7 deletions apps/web/src/components/Sidebar.logic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,17 +318,50 @@ describe("resolveThreadRowClassName", () => {

describe("resolveProjectNameTone", () => {
it("keeps the selected project name on its assigned project color", () => {
expect(resolveProjectNameTone({ isSelectedProject: true, visualIndex: 3 })).toBe("project");
expect(
resolveProjectNameTone({
isSelectedProject: true,
accentProjectNames: false,
visualIndex: 3,
}),
).toBe("project");
});

it("starts inactive project names on the stronger muted grey", () => {
expect(resolveProjectNameTone({ isSelectedProject: false, visualIndex: 0 })).toBe(
"mutedStrong",
);
it("uses project color for all names when accentProjectNames is true", () => {
expect(
resolveProjectNameTone({
isSelectedProject: false,
accentProjectNames: true,
visualIndex: 0,
}),
).toBe("project");
expect(
resolveProjectNameTone({
isSelectedProject: false,
accentProjectNames: true,
visualIndex: 1,
}),
).toBe("project");
});

it("alternates inactive project names to a softer muted grey on the next row", () => {
expect(resolveProjectNameTone({ isSelectedProject: false, visualIndex: 1 })).toBe("mutedSoft");
it("starts inactive project names on the stronger muted grey when accent is off", () => {
expect(
resolveProjectNameTone({
isSelectedProject: false,
accentProjectNames: false,
visualIndex: 0,
}),
).toBe("mutedStrong");
});

it("alternates inactive project names to a softer muted grey on the next row when accent is off", () => {
expect(
resolveProjectNameTone({
isSelectedProject: false,
accentProjectNames: false,
visualIndex: 1,
}),
).toBe("mutedSoft");
});
});

Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/components/Sidebar.logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ export function resolveThreadRowClassName(input: {

export function resolveProjectNameTone(input: {
isSelectedProject: boolean;
accentProjectNames: boolean;
visualIndex: number;
}): "project" | "mutedStrong" | "mutedSoft" {
if (input.isSelectedProject) {
if (input.isSelectedProject || input.accentProjectNames) {
return "project";
}

Expand Down
1 change: 1 addition & 0 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,7 @@ export default function Sidebar() {
const isDark = resolvedTheme === "dark";
const projectNameTone = resolveProjectNameTone({
isSelectedProject: activeProjectId === project.id,
accentProjectNames: appSettings.sidebarAccentProjectNames,
visualIndex,
});

Expand Down
10 changes: 5 additions & 5 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading