This commit is contained in:
yuneng-jiang 2026-08-29 20:21:52 -04:00 committed by GitHub
commit 9d71bf1308
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 11 deletions

View file

@ -272,6 +272,13 @@ describe("Navbar", () => {
expect(screen.queryByRole("button", { name: /^notifications$/i })).not.toBeInTheDocument();
});
it("should keep the theme toggle on public pages", () => {
const publicPageProps = { ...defaultProps, isPublicPage: true };
renderWithProviders(<Navbar {...publicPageProps} />);
expect(screen.getByRole("button", { name: /^theme$/i })).toBeInTheDocument();
});
it("should handle hide new feature indicators toggle", async () => {
const user = userEvent.setup();

View file

@ -132,7 +132,7 @@ const Navbar: React.FC<NavbarProps> = ({
</div>
)}
<div className="ml-auto flex min-w-0 flex-1 items-center justify-end gap-4">
<div className="ml-auto flex min-w-0 flex-1 items-center justify-end gap-4 max-sm:gap-2">
{showWorkerSwitch && (
<div className="flex shrink-0 items-center">
<WorkerDropdown onWorkerSwitch={handleWorkerSwitch} />
@ -153,17 +153,19 @@ const Navbar: React.FC<NavbarProps> = ({
</div>
)}
{!isPublicPage && (
<div className="flex shrink-0 items-center border-l border-border pl-4">
<div className="flex items-center gap-0.5 rounded-lg bg-muted px-1 py-0 transition-colors hover:bg-accent">
<ThemeToggle />
<span className="mx-0.5 h-6 w-px shrink-0 bg-border" aria-hidden />
<NotificationsBell />
<span className="mx-0.5 h-6 w-px shrink-0 bg-border" aria-hidden />
<UserDropdown onLogout={handleLogout} />
</div>
<div className="flex shrink-0 items-center border-l border-border pl-4 max-sm:border-l-0 max-sm:pl-2">
<div className="flex items-center gap-0.5 rounded-lg bg-muted px-1 py-0 transition-colors hover:bg-accent">
<ThemeToggle />
{!isPublicPage && (
<>
<span className="mx-0.5 h-6 w-px shrink-0 bg-border" aria-hidden />
<NotificationsBell />
<span className="mx-0.5 h-6 w-px shrink-0 bg-border" aria-hidden />
<UserDropdown onLogout={handleLogout} />
</>
)}
</div>
)}
</div>
</div>
</div>
</div>