fix: move team/environment selectors from sidebar to header bar#75
fix: move team/environment selectors from sidebar to header bar#75TerrifiedBug merged 1 commit intomainfrom
Conversation
Two stacked dropdowns in the sidebar looked cluttered and wasted vertical space. Move both selectors into the main content header bar where they sit side-by-side with a separator between them. The sidebar now contains only the logo, separator, and navigation — clean and aligned with the h-14 header.
Greptile SummaryThis PR relocates the team and environment selectors from the sidebar into the main content header bar, placing them side-by-side with a vertical separator. The sidebar is simplified to logo → separator → nav items, and ~40 lines of collapsed-mode popover/tooltip code are removed. Key changes:
Findings:
Confidence Score: 4/5
Important Files Changed
Last reviewed commit: 1b024c5 |
| <header className="flex h-14 shrink-0 items-center gap-3 border-b px-4"> | ||
| <TeamSelector /> | ||
| <Separator orientation="vertical" className="!h-5" /> | ||
| <EnvironmentSelector /> |
There was a problem hiding this comment.
TeamSelector returns null when teams.length === 0 (which occurs during the initial load, before teamsQuery.data arrives). During that window, the header renders [null] | Separator | [EnvironmentSelector skeleton] — the separator appears to float with nothing on its left side.
The isTeamless guard only activates after teamsQuery.isSuccess && teams.length === 0, so the full sidebar layout (including this header) is visible while teams are still loading.
Consider one of these fixes:
Option 1: Conditionally render the separator only when TeamSelector produces content
<TeamSelector />
{teams.length > 0 ? (
<Separator orientation="vertical" className="!h-5" />
) : null}
<EnvironmentSelector />Option 2: Add a loading skeleton to TeamSelector (mirroring EnvironmentSelector) so it occupies space during load, making the transition smoother.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/app/(dashboard)/layout.tsx
Line: 139-142
Comment:
`TeamSelector` returns `null` when `teams.length === 0` (which occurs during the initial load, before `teamsQuery.data` arrives). During that window, the header renders `[null] | Separator | [EnvironmentSelector skeleton]` — the separator appears to float with nothing on its left side.
The `isTeamless` guard only activates after `teamsQuery.isSuccess && teams.length === 0`, so the full sidebar layout (including this header) is visible while teams are still loading.
Consider one of these fixes:
**Option 1: Conditionally render the separator only when TeamSelector produces content**
```tsx
<TeamSelector />
{teams.length > 0 ? (
<Separator orientation="vertical" className="!h-5" />
) : null}
<EnvironmentSelector />
```
**Option 2: Add a loading skeleton to TeamSelector** (mirroring `EnvironmentSelector`) so it occupies space during load, making the transition smoother.
How can I resolve this? If you propose a fix, please make it concise.
Summary
border-b(both at the bottom ofh-14)Test plan