Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore: files changed app/src/components/layout/shell/AppSidebar.test.tsx,app/src/components/layout/s\n\nAuto-committed-on: macbook\n

Steven Enamakel351fa484585a
diff --git a/app/src/components/layout/shell/AppSidebar.test.tsx b/app/src/components/layout/shell/AppSidebar.test.tsx
index 145a816744..0984731b63 100644
--- a/app/src/components/layout/shell/AppSidebar.test.tsx
+++ b/app/src/components/layout/shell/AppSidebar.test.tsx
@@ -30,6 +30,36 @@ function renderAppSidebar(
// `SidebarHeader.test.tsx`). `ConnectionIndicator` itself is still live — it
// renders on the Home page — so it is only this mount point that went.
vi.mock('../../../lib/i18n/I18nContext', () => ({ useT: () => ({ t: (k: string) => k }) }));
+
+describe('nav separator visibility', () => {
+ it('shows the separator on a route whose region opens with a plain list', () => {
+ renderAppSidebar({ initialEntries: ['/settings'] });
+ expect(screen.getByTestId('sidebar-nav-separator').className).not.toContain('opacity-0');
+ });
+
+ it('hides it on chat, whose region opens with its own outlined button', () => {
+ renderAppSidebar({ initialEntries: ['/chat'] });
+ expect(screen.getByTestId('sidebar-nav-separator').className).toContain('opacity-0');
+ });
+
+ it('hides it on a chat thread route too', () => {
+ renderAppSidebar({ initialEntries: ['/chat/abc123'] });
+ expect(screen.getByTestId('sidebar-nav-separator').className).toContain('opacity-0');
+ });
+
+ it('keeps the separator mounted when hidden', () => {
+ // `opacity-0`, never unmounted: its `my-*` is the only gap between the nav
+ // group and the projected region, so removing it would collapse the two
+ // lists together.
+ renderAppSidebar({ initialEntries: ['/chat'] });
+ expect(screen.getByTestId('sidebar-nav-separator')).toBeInTheDocument();
+ });
+
+ it('does not match a route that merely starts with the same letters', () => {
+ renderAppSidebar({ initialEntries: ['/chatter'] });
+ expect(screen.getByTestId('sidebar-nav-separator').className).not.toContain('opacity-0');
+ });
+});
vi.mock('./SidebarHeader', () => ({ default: () => null }));
vi.mock('./SidebarNav', () => ({ default: () => null }));
vi.mock('./SidebarAppRail', () => ({ default: () => null }));
diff --git a/app/src/components/layout/shell/AppSidebar.tsx b/app/src/components/layout/shell/AppSidebar.tsx
index a8e84096f5..d7da786bf4 100644
--- a/app/src/components/layout/shell/AppSidebar.tsx
+++ b/app/src/components/layout/shell/AppSidebar.tsx
@@ -1,7 +1,6 @@
import debugFactory from 'debug';
import { useEffect } from 'react';
import { LuPanelLeftOpen } from 'react-icons/lu';
-
import { useLocation } from 'react-router-dom';
import { useT } from '../../../lib/i18n/I18nContext';