Skip to content

Commit e704b11

Browse files
Copilothotlong
andcommitted
refactor: address code review feedback
- Simplify tooltip and label rendering for fallback nav items - Reduce test timeouts from 10000ms to 5000ms - Update ROADMAP.md with P1.12.1 empty state improvements Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 313be35 commit e704b11

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

ROADMAP.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,15 @@ ObjectUI is a universal Server-Driven UI (SDUI) engine built on React + Tailwind
728728
- [x] Settings button → `/system/` hub (was `/system/profile`)
729729
- [x] App switcher "Manage All Apps" link → `/system/apps`
730730

731+
**Empty State & System Route Accessibility (P1.12.1):**
732+
- [x] "Create App" button always shown in empty state (even when config loading fails)
733+
- [x] "System Settings" link always shown alongside "Create App" in empty state
734+
- [x] Top-level `/system/*` routes accessible without any app context (promoted to main routes)
735+
- [x] Top-level `/create-app` route accessible without any app context
736+
- [x] Sidebar fallback navigation with system menu items when no apps are configured
737+
- [x] System pages (`SystemHubPage`, `AppManagementPage`) handle missing `appName` gracefully
738+
- [x] Login/Register/Forgot password pages remain always accessible regardless of app state
739+
731740
**Routes:**
732741
- [x] `/system/` → SystemHubPage
733742
- [x] `/system/apps` → AppManagementPage

apps/console/src/__tests__/EmptyStateSystemRoutes.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,22 +159,22 @@ describe('Empty State — No Apps Configured', () => {
159159
renderApp();
160160
await waitFor(() => {
161161
expect(screen.getByTestId('create-first-app-btn')).toBeInTheDocument();
162-
}, { timeout: 10000 });
162+
}, { timeout: 5000 });
163163
expect(screen.getByText('No Apps Configured')).toBeInTheDocument();
164164
});
165165

166166
it('shows "System Settings" button in empty state', async () => {
167167
renderApp();
168168
await waitFor(() => {
169169
expect(screen.getByTestId('go-to-settings-btn')).toBeInTheDocument();
170-
}, { timeout: 10000 });
170+
}, { timeout: 5000 });
171171
});
172172

173173
it('shows descriptive text about creating apps or visiting settings', async () => {
174174
renderApp();
175175
await waitFor(() => {
176176
expect(screen.getByText(/Create your first app or visit System Settings/i)).toBeInTheDocument();
177-
}, { timeout: 10000 });
177+
}, { timeout: 5000 });
178178
});
179179
});
180180

@@ -197,13 +197,13 @@ describe('System Routes Within App Context (No Active App)', () => {
197197
renderApp('/apps/_new/system');
198198
await waitFor(() => {
199199
expect(screen.getByTestId('system-hub-page')).toBeInTheDocument();
200-
}, { timeout: 10000 });
200+
}, { timeout: 5000 });
201201
});
202202

203203
it('renders create app page at /apps/_new/create-app when no active app', async () => {
204204
renderApp('/apps/_new/create-app');
205205
await waitFor(() => {
206206
expect(screen.getByTestId('create-app-page')).toBeInTheDocument();
207-
}, { timeout: 10000 });
207+
}, { timeout: 5000 });
208208
});
209209
});

apps/console/src/components/AppSidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,10 @@ export function AppSidebar({ activeAppName, onAppChange }: { activeAppName: stri
494494
const NavIcon = getIcon(item.icon);
495495
return (
496496
<SidebarMenuItem key={item.id}>
497-
<SidebarMenuButton asChild tooltip={typeof item.label === 'string' ? item.label : item.label?.defaultValue ?? ''}>
497+
<SidebarMenuButton asChild tooltip={item.label as string}>
498498
<Link to={(item as any).url || '/system'}>
499499
<NavIcon className="h-4 w-4" />
500-
<span>{resolveI18nLabel(item.label, t)}</span>
500+
<span>{item.label as string}</span>
501501
</Link>
502502
</SidebarMenuButton>
503503
</SidebarMenuItem>

0 commit comments

Comments
 (0)