Repository navigation
fix(web): render empty-state in sidebar when no projects configured - #1549
Conversation
Greptile SummaryThis PR replaces the Confidence Score: 5/5Safe to merge — the change is narrowly scoped to the zero-projects path, leaves ProjectSidebarInner untouched, and is well-covered by the updated test suite. The only finding is a P2 style suggestion (missing aria-hidden on a decorative SVG inside a fully labelled button). No logic errors, data issues, or security concerns were identified. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["ProjectSidebar (props)"] --> B{projects.length === 0?}
B -- Yes --> C["ProjectSidebarEmpty"]
B -- No --> D["ProjectSidebarInner"]
C --> E["Header: 'Projects' label + '+' button"]
C --> F["Body: 'No projects yet' text"]
C --> G["Footer: ThemeToggle"]
C --> H["AddProjectModal (controlled by addProjectOpen state)"]
E -->|click '+'| H
Reviews (1): Last reviewed commit: "fix(web): render empty-state in sidebar ..." | Re-trigger Greptile |
Test Coverage ReportChanged files have no coverage data (not instrumented or no tests ran). |
Review finding[P1] Empty sidebar never renders on fresh installs The new Location: |
327396f to
97f0727
Compare
|
P2 Honor collapsed state in empty sidebar Dashboard now always renders ProjectSidebar and passes collapsed={sidebarCollapsed}, but the zero-project branch drops those props and always renders a full-width .project-sidebar. On a fresh install, clicking the header sidebar toggle applies .dashboard-shell--sidebar-collapsed so the wrapper shrinks to 44px, while the child sidebar remains 224px wide and can overlap the main dashboard instead of collapsing like the populated sidebar path. The empty branch should either render a collapsed variant when props.collapsed is true or avoid enabling the desktop collapse path for the zero-project sidebar. |
A fresh-install user with zero projects saw a blank sidebar and had no way to open AddProjectModal from it. The early-return was originally projects.length <= 1 (#381), softened to === 0 in #927, but no empty- state UI was added at the same time. Replace the null branch with a small ProjectSidebarEmpty sibling that reuses the existing header (with the + button wired to AddProjectModal), shows a one-line explainer, and renders only the ThemeToggle in the footer (the show-killed/show-done/settings buttons are meaningless with zero projects).
The decorative SVG inside the labeled + buttons (empty-state and populated sidebar) should not be announced — screen readers should rely on the button's aria-label. Adds aria-hidden="true" to both for consistency.
Dashboard previously gated the sidebar on projects.length >= 1, leaving ProjectSidebarEmpty unreachable. ProjectSidebar handles both cases now, so drop the gate and add a dashboard-level test for the zero-project path.
97f0727 to
5f61d91
Compare
|
Respect collapsed state in empty sidebar Dashboard now always renders the sidebar toggle and passes collapsed={sidebarCollapsed}, including when projects is empty. But this branch discards the prop and always renders the full-width empty sidebar. On a fresh install, clicking the desktop sidebar toggle shrinks only .sidebar-wrapper to 44px while the inner .project-sidebar remains 224px, so the empty-state sidebar protrudes/overlaps the main content instead of collapsing like the populated path. Pass collapsed into the empty component or render a collapsed empty rail for this state. |
ProjectSidebarEmpty discarded the collapsed prop, so on a fresh install the wrapper shrank to 44px while the inner sidebar stayed 224px and overlapped the main content. Render a 44px-wide rail with just the + button when collapsed, matching the populated sidebar's collapse path.
* chore(release): add changesets for 0.5.0 and bump codex version test - Add changesets for #1643 (orchestrator worktree adoption), #1549 (sidebar empty-state), and #1608 (terminal attach + mux routing). - Update agent-codex package-version.test.ts expectation from 0.4.0 to 0.5.0 so the test no longer fails after the upcoming version bump. * chore: release 0.5.0 --------- Co-authored-by: i-trytoohard <[email protected]>
…rchestratorInc#1549) * fix(web): render empty-state in sidebar when no projects configured A fresh-install user with zero projects saw a blank sidebar and had no way to open AddProjectModal from it. The early-return was originally projects.length <= 1 (OrchestratorInc#381), softened to === 0 in OrchestratorInc#927, but no empty- state UI was added at the same time. Replace the null branch with a small ProjectSidebarEmpty sibling that reuses the existing header (with the + button wired to AddProjectModal), shows a one-line explainer, and renders only the ThemeToggle in the footer (the show-killed/show-done/settings buttons are meaningless with zero projects). * fix(web): mark sidebar + button SVGs aria-hidden The decorative SVG inside the labeled + buttons (empty-state and populated sidebar) should not be announced — screen readers should rely on the button's aria-label. Adds aria-hidden="true" to both for consistency. * fix(web): always mount sidebar so empty-state renders on fresh installs Dashboard previously gated the sidebar on projects.length >= 1, leaving ProjectSidebarEmpty unreachable. ProjectSidebar handles both cases now, so drop the gate and add a dashboard-level test for the zero-project path. * fix(web): honor collapsed prop in empty sidebar branch ProjectSidebarEmpty discarded the collapsed prop, so on a fresh install the wrapper shrank to 44px while the inner sidebar stayed 224px and overlapped the main content. Render a 44px-wide rail with just the + button when collapsed, matching the populated sidebar's collapse path.
* chore(release): add changesets for 0.5.0 and bump codex version test - Add changesets for OrchestratorInc#1643 (orchestrator worktree adoption), OrchestratorInc#1549 (sidebar empty-state), and OrchestratorInc#1608 (terminal attach + mux routing). - Update agent-codex package-version.test.ts expectation from 0.4.0 to 0.5.0 so the test no longer fails after the upcoming version bump. * chore: release 0.5.0 --------- Co-authored-by: i-trytoohard <[email protected]>
Summary
AddProjectModal— the outerProjectSidebarwrapper returnsnullwhenprojects.length === 0.nullwith a smallProjectSidebarEmptysibling that reuses the existing header ++button, shows a one-line explainer, and keeps only theThemeTogglein the footer.Context
projects.length <= 1.=== 0but did not add a replacement empty-state UI, so the wrapper still returnsnull.UX decision
The empty-state mirrors the populated sidebar's chrome (so the
+button stays in the same spot a returning user would look) and drops the show-killed / show-done / settings buttons because they have no meaning with zero projects. The body usesvar(--color-text-tertiary)and the existingproject-sidebar__emptyclass — no new tokens, no inline styles.Constraints honored
style=attributes (C-02). All styling via existing classes (project-sidebar,project-sidebar__compact-hdr,project-sidebar__sect-label,project-sidebar__add-btn,project-sidebar__empty,project-sidebar__footer,project-sidebar__theme-toggle) and Tailwind utilities.ProjectSidebarInner(the populated path) is untouched.Test plan
pnpm --filter @aoagents/ao-web typecheck— clean.pnpm --filter @aoagents/ao-web test ProjectSidebar— 17/17 pass (14 existing + 3 new).pnpm lint— 0 errors (45 pre-existing warnings, none from this change).api-routes.test.ts,serialize.test.ts,sessions/[id]/page.test.tsx) reproduce onmain— unrelated to this change.