From 8bdff4e759d3d234ecffd405cd07b1129935c666 Mon Sep 17 00:00:00 2001 From: qduc Date: Sat, 30 Aug 2025 22:02:27 +0700 Subject: [PATCH 01/20] Improve accessibility and styling in chat components; add mocks for navigation hooks in tests --- frontend/__tests__/components.chat.test.tsx | 6 ++--- frontend/components/ChatHeader.tsx | 2 +- frontend/components/ChatSidebar.tsx | 2 +- frontend/components/ChatV2.tsx | 3 +-- frontend/components/RightSidebar.tsx | 2 +- frontend/jest.setup.js | 30 +++++++++++++++++++++ 6 files changed, 37 insertions(+), 8 deletions(-) diff --git a/frontend/__tests__/components.chat.test.tsx b/frontend/__tests__/components.chat.test.tsx index 81957da4..57ea2c9e 100644 --- a/frontend/__tests__/components.chat.test.tsx +++ b/frontend/__tests__/components.chat.test.tsx @@ -119,9 +119,9 @@ describe('', () => { renderWithProviders(); await waitFor(() => { - // Test behavior: User should be able to see and interact with a model selection interface - // Focus on the presence of the selection element and its accessibility - const modelSelect = screen.getByRole('combobox', { name: /model/i }); + // User should be able to see and interact with a model selection interface + // Query by accessible label instead of relying on a specific ARIA role implementation + const modelSelect = screen.getByLabelText('Model'); expect(modelSelect).toBeInTheDocument(); expect(modelSelect).toBeEnabled(); }); diff --git a/frontend/components/ChatHeader.tsx b/frontend/components/ChatHeader.tsx index f6662256..04f3cbb2 100644 --- a/frontend/components/ChatHeader.tsx +++ b/frontend/components/ChatHeader.tsx @@ -122,7 +122,7 @@ export function ChatHeader({ model, onModelChange, providerId, onProviderChange, }; return ( -
+
diff --git a/frontend/components/ChatSidebar.tsx b/frontend/components/ChatSidebar.tsx index 0959c890..b23d1ef6 100644 --- a/frontend/components/ChatSidebar.tsx +++ b/frontend/components/ChatSidebar.tsx @@ -25,7 +25,7 @@ export function ChatSidebar({ onNewChat }: ChatSidebarProps) { return ( -
))}
@@ -520,21 +521,6 @@ export default function SettingsModal({ /> -
-
- -

Allow this provider to be used for chat completions

-
- setForm((f) => ({ ...f, enabled: v }))} - /> -
- {/* Test Result Display */} {testResult && (
Date: Sun, 31 Aug 2025 09:51:37 +0700 Subject: [PATCH 07/20] Refactor SettingsModal: Adjust layout and styling for improved UI consistency and accessibility --- frontend/components/SettingsModal.tsx | 74 +++++++++++++-------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/frontend/components/SettingsModal.tsx b/frontend/components/SettingsModal.tsx index 5a7d4be3..1d7e57bc 100644 --- a/frontend/components/SettingsModal.tsx +++ b/frontend/components/SettingsModal.tsx @@ -292,10 +292,10 @@ export default function SettingsModal({ Settings
as any} + maxWidthClassName="max-w-2xl" + title={
Settings
as any} > -
+
{/* Tab Navigation */}