authorgravatar for 91240327+shivamhwp@users.noreply.github.comshivam <91240327+shivamhwp@users.noreply.github.com> 2026-03-30 00:17:51+05:30
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-03-29 11:47:51-07:00
log7b676b76de536b0a9e60fd8bc6e20404815d6294
treeb649b601f208b45d6e3b8b5511170b86cba38a39
parentd5f2333173f6b01e38d6488dd7a2f157b479195f
signature Signed by PGP key B5690EEEBB952194

fix: show empty project thread state in sidebar (#1546)


2 files changed, 26 insertions(+), 0 deletions(-)

apps/web/src/components/ChatView.browser.tsx+13
......@@ -1041,6 +1041,19 @@ describe("ChatView timeline estimator parity (full app)", () => {
10411041 },
10421042 );
10431043
1044 it("shows an explicit empty state for projects without threads in the sidebar", async () => {
1045 const mounted = await mountChatView({
1046 viewport: DEFAULT_VIEWPORT,
1047 snapshot: createDraftOnlySnapshot(),
1048 });
1049
1050 try {
1051 await expect.element(page.getByText("No threads yet")).toBeInTheDocument();
1052 } finally {
1053 await mounted.cleanup();
1054 }
1055 });
1056
10441057 it("opens the project cwd for draft threads without a worktree path", async () => {
10451058 setDraftThreadWithoutWorktree();
10461059
apps/web/src/components/Sidebar.tsx+13
......@@ -1098,6 +1098,7 @@ export default function Sidebar() {
10981098 const renderedThreads = pinnedCollapsedThread
10991099 ? [pinnedCollapsedThread]
11001100 : visibleProjectThreads;
1101 const showEmptyThreadState = project.expanded && projectThreads.length === 0;
11011102
11021103 return {
11031104 hasHiddenThreads,
......@@ -1108,6 +1109,7 @@ export default function Sidebar() {
11081109 projectThreads,
11091110 threadStatuses,
11101111 renderedThreads,
1112 showEmptyThreadState,
11111113 shouldShowThreadPanel,
11121114 isThreadListExpanded,
11131115 };
......@@ -1255,6 +1257,7 @@ export default function Sidebar() {
12551257 projectThreads,
12561258 threadStatuses,
12571259 renderedThreads,
1260 showEmptyThreadState,
12581261 shouldShowThreadPanel,
12591262 isThreadListExpanded,
12601263 } = renderedProject;
......@@ -1572,6 +1575,16 @@ export default function Sidebar() {
15721575 ref={attachThreadListAutoAnimateRef}
15731576 className="mx-1 my-0 w-full translate-x-0 gap-0.5 overflow-hidden px-1.5 py-0"
15741577 >
1578 {shouldShowThreadPanel && showEmptyThreadState ? (
1579 <SidebarMenuSubItem className="w-full" data-thread-selection-safe>
1580 <div
1581 data-thread-selection-safe
1582 className="flex h-6 w-full translate-x-0 items-center px-2 text-left text-[10px] text-muted-foreground/60"
1583 >
1584 <span>No threads yet</span>
1585 </div>
1586 </SidebarMenuSubItem>
1587 ) : null}
15751588 {shouldShowThreadPanel && renderedThreads.map((thread) => renderThreadRow(thread))}
15761589
15771590 {project.expanded && hasHiddenThreads && !isThreadListExpanded && (