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
37 changes: 22 additions & 15 deletions plugins/stewards/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1398,21 +1398,28 @@ function SidebarCollapsible({ title, count, children }: { title: string; count:
function ProjectTabs({ tabs, counts, activeId, onPick, onNewThread }: { tabs: Array<{ projectId: string; name: string }>; counts: ReadonlyMap<string, number>; activeId: string | null; onPick: (projectId: string) => void; onNewThread: () => void }) {
return (
<div className="flex items-center gap-1 px-2 py-1.5">
<select
aria-label="Project"
className="h-8 min-w-0 flex-1 rounded-md border border-input bg-transparent px-3 text-sm"
value={activeId ?? ""}
onChange={(e) => onPick(e.target.value)}
>
{tabs.map((t) => {
const count = counts.get(t.projectId) ?? 0;
return (
<option key={t.projectId} value={t.projectId}>
{count > 0 ? `${t.name} (${count})` : t.name}
</option>
);
})}
</select>
<div className="relative min-w-0 flex-1">
<select
aria-label="Project"
className="h-8 w-full min-w-0 appearance-none rounded-md border border-input bg-transparent pl-3 pr-7 text-sm"
value={activeId ?? ""}
onChange={(e) => onPick(e.target.value)}
>
{tabs.map((t) => {
const count = counts.get(t.projectId) ?? 0;
return (
<option key={t.projectId} value={t.projectId}>
{count > 0 ? `${t.name} (${count})` : t.name}
</option>
);
})}
</select>
<Icon
name="ChevronDown"
className="pointer-events-none absolute right-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"
aria-hidden
/>
</div>
{tabs.length > 0 ? (
<button
type="button"
Expand Down
17 changes: 17 additions & 0 deletions plugins/stewards/sidebar-app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,23 @@ describe("the stewards sidebar list (BB-44)", () => {
}
});

it("draws a custom chevron on the project picker instead of the native arrow", async () => {
const slot = await renderSidebar({
sidebarThreads: { projects, threads: [] },
rpc: { stewardsSidebar: () => sidebarData() } as never,
});
const select = await waitFor(() => slot.getByLabelText("Project") as HTMLSelectElement);
expect(select.className).toContain("appearance-none");
expect(select.className).toContain("pr-7");
expect(select.closest(".relative")).not.toBeNull();
const chevron = slot.container.querySelector('[data-icon="ChevronDown"]');
expect(chevron).not.toBeNull();
expect(chevron!.className).toContain("pointer-events-none");
expect(chevron!.className).toContain("text-muted-foreground");
expect(chevron!.getAttribute("aria-hidden")).toBe("true");
slot.lifecycle.unmount();
});

it("follows activeProjectId in the picker and switches on pick without navigating", async () => {
const slot = await renderSidebar(
{
Expand Down
Loading