Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🖱️ refactor: Hover the Rail Toggle, New Chat and Marketplace Controls in the Nav Role (#16940)

Marco Berettab12d09dc5bab
diff --git a/client/src/components/Nav/AgentMarketplaceButton.tsx b/client/src/components/Nav/AgentMarketplaceButton.tsx
index 7729cfbc0e..1ab74e3b5e 100644
--- a/client/src/components/Nav/AgentMarketplaceButton.tsx
+++ b/client/src/components/Nav/AgentMarketplaceButton.tsx
@@ -44,7 +44,7 @@ export default function AgentMarketplaceButton({
const button = (
<Button
asChild
- variant="ghost"
+ variant="nav"
size={isRow ? 'row' : 'icon'}
className={cn('shrink-0', isRow ? 'w-full justify-start' : 'h-9 w-9')}
>
diff --git a/client/src/components/UnifiedSidebar/ExpandedPanel.tsx b/client/src/components/UnifiedSidebar/ExpandedPanel.tsx
index 462ee4163b..eb377881fb 100644
--- a/client/src/components/UnifiedSidebar/ExpandedPanel.tsx
+++ b/client/src/components/UnifiedSidebar/ExpandedPanel.tsx
@@ -42,7 +42,7 @@ const NewChatButton = memo(function NewChatButton({
data-testid="new-chat-button"
aria-label={localize('com_ui_new_chat')}
aria-keyshortcuts={ariaKey}
- className="hover:bg-surface-hover flex h-9 w-9 items-center justify-center rounded-lg transition-colors"
+ className="hover:bg-surface-nav-hover flex h-9 w-9 items-center justify-center rounded-lg transition-colors"
onClick={handleNewChatClick}
>
<SquarePen className="text-text-primary h-5 w-5" />
@@ -156,7 +156,7 @@ function ExpandedPanel({
id={expanded ? CLOSE_SIDEBAR_ID : undefined}
data-testid={expanded ? 'close-sidebar-button' : 'open-sidebar-button'}
size="icon"
- variant="ghost"
+ variant="nav"
aria-label={localize(toggleLabel)}
aria-expanded={expanded}
aria-keyshortcuts={toggleSidebarAriaKey}
diff --git a/client/src/components/UnifiedSidebar/__tests__/ExpandedPanel.spec.tsx b/client/src/components/UnifiedSidebar/__tests__/ExpandedPanel.spec.tsx
index 7fdb63c889..034c990083 100644
--- a/client/src/components/UnifiedSidebar/__tests__/ExpandedPanel.spec.tsx
+++ b/client/src/components/UnifiedSidebar/__tests__/ExpandedPanel.spec.tsx
@@ -216,6 +216,14 @@ describe('ExpandedPanel', () => {
expect(idle).toHaveAttribute('aria-pressed', 'true');
expect(active).toHaveAttribute('aria-pressed', 'false');
});
+
+ it('hovers the sidebar toggle and new chat link in the navigation role', () => {
+ renderPanel({ expanded: true });
+
+ expect(screen.getByTestId('close-sidebar-button')).toHaveClass('hover:bg-surface-nav-hover');
+ expect(screen.getByTestId('new-chat-button')).toHaveClass('hover:bg-surface-nav-hover');
+ expect(screen.getByTestId('new-chat-button')).not.toHaveClass('hover:bg-surface-hover');
+ });
});
describe('NewChatButton panel switch', () => {
diff --git a/e2e/specs/mock/scenarios/rail-nav-states.spec.ts b/e2e/specs/mock/scenarios/rail-nav-states.spec.ts
index 6fde58b594..a50d60a98f 100644
--- a/e2e/specs/mock/scenarios/rail-nav-states.spec.ts
+++ b/e2e/specs/mock/scenarios/rail-nav-states.spec.ts
@@ -85,6 +85,35 @@ test.describe('desktop icon rail', () => {
}
});
+ test('the rail toggle, new chat and marketplace controls hover in the navigation role @scenario:rail-controls-nav-hover', async ({
+ page,
+ }) => {
+ await installThemeBridge(page);
+ const cases: Array<[ThemeChoice, Mode, string]> = [
+ ['clickhouse', 'light', rgb(clickHouseTheme.modes.light?.colors?.['rgb-surface-nav-hover'])],
+ ['clickhouse', 'dark', rgb(clickHouseTheme.modes.dark?.colors?.['rgb-surface-nav-hover'])],
+ ['default', 'light', 'rgb(227, 227, 227)'],
+ ['default', 'dark', 'rgb(47, 47, 47)'],
+ ];
+ for (const [theme, mode, hover] of cases) {
+ const { idle } = await openRail(page, theme, mode);
+ await idle.hover();
+ await expect.poll(() => fill(idle)).toBe(hover);
+
+ for (const testId of [
+ 'close-sidebar-button',
+ 'new-chat-button',
+ 'nav-agents-marketplace-button',
+ ]) {
+ const control = page.getByTestId(testId).filter({ visible: true }).first();
+ await expect(control).toBeVisible();
+ await control.hover();
+ await expect.poll(() => fill(control)).toBe(hover);
+ }
+ await page.mouse.move(640, 400);
+ }
+ });
+
test('the default theme keeps the rail selected and hovered fills @scenario:rail-nav-default-unchanged', async ({
page,
}) => {