fix: show empty project thread state in sidebar (#1546)
This commit is contained in:
1 parent
d5f2333173
commit
7b676b76de
2 files changed
+26
No files matched your search
@@ -1041,6 +1041,19 @@ describe("ChatView timeline estimator parity (full app)", () => {
|
||||
},
|
||||
);
|
||||
|
||||
it("shows an explicit empty state for projects without threads in the sidebar", async () => {
|
||||
const mounted = await mountChatView({
|
||||
viewport: DEFAULT_VIEWPORT,
|
||||
snapshot: createDraftOnlySnapshot(),
|
||||
});
|
||||
|
||||
try {
|
||||
await expect.element(page.getByText("No threads yet")).toBeInTheDocument();
|
||||
} finally {
|
||||
await mounted.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it("opens the project cwd for draft threads without a worktree path", async () => {
|
||||
setDraftThreadWithoutWorktree();
|
||||
|
||||
|
||||
@@ -1098,6 +1098,7 @@ export default function Sidebar() {
|
||||
const renderedThreads = pinnedCollapsedThread
|
||||
? [pinnedCollapsedThread]
|
||||
: visibleProjectThreads;
|
||||
const showEmptyThreadState = project.expanded && projectThreads.length === 0;
|
||||
|
||||
return {
|
||||
hasHiddenThreads,
|
||||
@@ -1108,6 +1109,7 @@ export default function Sidebar() {
|
||||
projectThreads,
|
||||
threadStatuses,
|
||||
renderedThreads,
|
||||
showEmptyThreadState,
|
||||
shouldShowThreadPanel,
|
||||
isThreadListExpanded,
|
||||
};
|
||||
@@ -1255,6 +1257,7 @@ export default function Sidebar() {
|
||||
projectThreads,
|
||||
threadStatuses,
|
||||
renderedThreads,
|
||||
showEmptyThreadState,
|
||||
shouldShowThreadPanel,
|
||||
isThreadListExpanded,
|
||||
} = renderedProject;
|
||||
@@ -1572,6 +1575,16 @@ export default function Sidebar() {
|
||||
ref={attachThreadListAutoAnimateRef}
|
||||
className="mx-1 my-0 w-full translate-x-0 gap-0.5 overflow-hidden px-1.5 py-0"
|
||||
>
|
||||
{shouldShowThreadPanel && showEmptyThreadState ? (
|
||||
<SidebarMenuSubItem className="w-full" data-thread-selection-safe>
|
||||
<div
|
||||
data-thread-selection-safe
|
||||
className="flex h-6 w-full translate-x-0 items-center px-2 text-left text-[10px] text-muted-foreground/60"
|
||||
>
|
||||
<span>No threads yet</span>
|
||||
</div>
|
||||
</SidebarMenuSubItem>
|
||||
) : null}
|
||||
{shouldShowThreadPanel && renderedThreads.map((thread) => renderThreadRow(thread))}
|
||||
|
||||
{project.expanded && hasHiddenThreads && !isThreadListExpanded && (
|
||||
|
||||
Reference in new issue
Block a user