Skip to content

Commit 06c70f5

Browse files
authored
Dashboard Improvements & Health Status Enhancements (#77)
* feat: Implement keyboard shortcuts functionality and related components - Added shortcuts-utils.ts for managing keyboard shortcuts. - Created KeyboardShortcuts component for displaying shortcuts modal. - Developed EnvironmentPanel, QuickActions, PerformanceMetrics, ServiceDependencies, and ServiceDetailPanel components. - Introduced supporting hooks: useClipboard and useEscapeKey. - Enhanced AzureServiceInfo with additional fields for better resource management. - Updated Sidebar and App.tsx to integrate new views and components. - Conducted comprehensive testing with >80% coverage across new components. - Performed security audit ensuring safe handling of sensitive data and input validation. * feat: implement health check improvements for portless services - Refactor NeedsPort() logic to ensure services without explicit ports in azure.yaml do not get assigned ports. - Update health check type selection to default to process-based checks for portless services. - Modify health check monitor to skip 400 Bad Request responses, allowing for cascading checks. - Enhance ServiceDependencies component with search and filter functionality for better service management. - Add tests to validate new behavior for health checks and service filtering. - Document changes and specifications for health check behavior in portless services. * feat: Add integration tests for service status display consistency - Implemented comprehensive tests to ensure all status display functions return consistent values across the UI. - Added tests for getStatusIndicator, getStatusDisplay, getStatusBadgeConfig, and calculateStatusCounts. - Verified that health statuses are correctly represented and counted in the dashboard. chore: Create Azure deployment test project - Added a minimal project for testing Azure deployment properties using azd. - Included configuration files, Docker setup, and a simple Express app to display Azure context. refactor: Unify service status actions and display logic - Consolidated status display functions into service-utils to reduce duplication. - Updated components to use unified functions for status calculation and display. - Ensured consistent visual indicators and actions for service statuses across the dashboard. fix: Distinguish between stopped and not-running services - Enhanced dashboard to visually differentiate between "stopped" and "not-running" services. - Updated HealthSummary to track stopped services separately. - Adjusted service actions to reflect the stopped state appropriately. docs: Add specifications for health starting status and stopped service status - Documented the requirements and tasks for implementing "starting" health status and distinguishing stopped services. - Included acceptance criteria and progress tracking for tasks related to these features.
1 parent 33f0b9a commit 06c70f5

File tree

93 files changed

+15423
-292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+15423
-292
lines changed

cli/dashboard/design/components/environment-panel.md

Lines changed: 1356 additions & 0 deletions
Large diffs are not rendered by default.

cli/dashboard/design/components/info-field.md

Lines changed: 652 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
# Keyboard Shortcuts Modal - Component Specification
2+
3+
## Overview
4+
5+
Modal dialog displaying all keyboard shortcuts grouped by category. Triggered by pressing `?` key or clicking the Help icon.
6+
7+
## Visual Structure
8+
9+
```
10+
┌──────────────────────────────────────────────────────┐
11+
│ Keyboard Shortcuts [X] │
12+
├──────────────────────────────────────────────────────┤
13+
│ │
14+
│ NAVIGATION │
15+
│ ┌────┐ Resources view │
16+
│ │ 1 │ │
17+
│ └────┘ │
18+
│ ┌────┐ Console view │
19+
│ │ 2 │ │
20+
│ └────┘ │
21+
│ ┌────┐ Metrics view │
22+
│ │ 3 │ │
23+
│ └────┘ │
24+
│ ┌────┐ Environment view │
25+
│ │ 4 │ │
26+
│ └────┘ │
27+
│ ┌────┐ Actions view │
28+
│ │ 5 │ │
29+
│ └────┘ │
30+
│ ┌────┐ Dependencies view │
31+
│ │ 6 │ │
32+
│ └────┘ │
33+
│ │
34+
│ ACTIONS │
35+
│ ┌────┐ Refresh all services │
36+
│ │ R │ │
37+
│ └────┘ │
38+
│ ┌────┐ Clear console logs │
39+
│ │ C │ │
40+
│ └────┘ │
41+
│ ┌────┐ Export logs │
42+
│ │ E │ │
43+
│ └────┘ │
44+
│ ┌──────────┐ Focus search input │
45+
│ │ / or ⌘F │ │
46+
│ └──────────┘ │
47+
│ │
48+
│ VIEWS │
49+
│ ┌────┐ Toggle table/grid view │
50+
│ │ T │ │
51+
│ └────┘ │
52+
│ ┌────┐ Show this modal │
53+
│ │ ? │ │
54+
│ └────┘ │
55+
│ ┌──────┐ Close dialogs/modals │
56+
│ │ Esc │ │
57+
│ └──────┘ │
58+
│ │
59+
└──────────────────────────────────────────────────────┘
60+
```
61+
62+
## Component Structure
63+
64+
```tsx
65+
interface KeyboardShortcutsProps {
66+
isOpen: boolean
67+
onClose: () => void
68+
}
69+
70+
interface Shortcut {
71+
key: string | string[] // Single key or array for alternatives
72+
description: string
73+
category: 'navigation' | 'actions' | 'views'
74+
}
75+
```
76+
77+
## Sub-components
78+
79+
### KeyBadge
80+
Visual representation of a keyboard key.
81+
82+
```tsx
83+
interface KeyBadgeProps {
84+
keys: string | string[] // Single key or alternatives
85+
}
86+
```
87+
88+
**Visual States:**
89+
- Default: `bg-muted border border-border rounded px-2 py-1 font-mono text-xs`
90+
- Multiple keys: Show with "or" separator
91+
92+
### ShortcutRow
93+
Single shortcut entry with key badge and description.
94+
95+
```tsx
96+
interface ShortcutRowProps {
97+
shortcut: Shortcut
98+
}
99+
```
100+
101+
### ShortcutGroup
102+
Category group header with list of shortcuts.
103+
104+
```tsx
105+
interface ShortcutGroupProps {
106+
title: string
107+
shortcuts: Shortcut[]
108+
}
109+
```
110+
111+
## Shortcuts Data
112+
113+
```typescript
114+
const shortcuts: Shortcut[] = [
115+
// Navigation
116+
{ key: '1', description: 'Resources view', category: 'navigation' },
117+
{ key: '2', description: 'Console view', category: 'navigation' },
118+
{ key: '3', description: 'Metrics view', category: 'navigation' },
119+
{ key: '4', description: 'Environment view', category: 'navigation' },
120+
{ key: '5', description: 'Actions view', category: 'navigation' },
121+
{ key: '6', description: 'Dependencies view', category: 'navigation' },
122+
123+
// Actions
124+
{ key: 'R', description: 'Refresh all services', category: 'actions' },
125+
{ key: 'C', description: 'Clear console logs', category: 'actions' },
126+
{ key: 'E', description: 'Export logs', category: 'actions' },
127+
{ key: ['/', 'Ctrl+F'], description: 'Focus search input', category: 'actions' },
128+
129+
// Views
130+
{ key: 'T', description: 'Toggle table/grid view', category: 'views' },
131+
{ key: '?', description: 'Show this modal', category: 'views' },
132+
{ key: 'Esc', description: 'Close dialogs/modals', category: 'views' },
133+
]
134+
```
135+
136+
## Accessibility
137+
138+
**Dialog Accessibility:**
139+
- `role="dialog"`
140+
- `aria-modal="true"`
141+
- `aria-labelledby` pointing to modal title
142+
- Focus trapped within modal when open
143+
- Close on Escape key
144+
145+
**Keyboard Navigation:**
146+
- Tab navigates through close button
147+
- Enter/Space activates close button
148+
- Escape closes modal
149+
150+
**Screen Reader:**
151+
- Modal title announced on open
152+
- Shortcut descriptions readable
153+
- Key badges have proper text alternatives
154+
155+
## Responsive Design
156+
157+
**Desktop (≥768px):**
158+
- Modal width: 480px max
159+
- Three columns of shortcut groups
160+
161+
**Tablet/Mobile (<768px):**
162+
- Modal width: full width with margins
163+
- Single column layout
164+
- Larger touch targets for close button
165+
166+
## Visual Design
167+
168+
**Modal Container:**
169+
- Background: `bg-background`
170+
- Border: `border border-border`
171+
- Shadow: `shadow-xl`
172+
- Border radius: `rounded-lg`
173+
- Max height: `max-h-[80vh]` with overflow scroll
174+
175+
**Header:**
176+
- Title: `text-lg font-semibold`
177+
- Close button: `X` icon, hover state
178+
- Border bottom: `border-b border-border`
179+
- Padding: `p-4`
180+
181+
**Content:**
182+
- Padding: `p-4`
183+
- Gap between groups: `gap-6`
184+
185+
**Group Header:**
186+
- Text: `text-xs font-semibold text-muted-foreground uppercase tracking-wider`
187+
- Margin bottom: `mb-2`
188+
189+
**Shortcut Row:**
190+
- Flex layout: `flex items-center gap-3`
191+
- Padding: `py-1`
192+
193+
**Key Badge:**
194+
- Background: `bg-muted`
195+
- Border: `border border-border`
196+
- Radius: `rounded`
197+
- Padding: `px-2 py-0.5`
198+
- Font: `font-mono text-xs`
199+
- Min width: `min-w-[2rem]` for single keys
200+
- Text align: center
201+
202+
## Animation
203+
204+
**Modal Open:**
205+
- Fade in backdrop: `animate-fade-in` (200ms)
206+
- Scale up modal: `animate-scale-in` (200ms)
207+
208+
**Modal Close:**
209+
- Fade out backdrop
210+
- Scale down modal
211+
212+
## Platform-specific Keys
213+
214+
Display platform-appropriate key names:
215+
- macOS: ⌘ (Command), ⌥ (Option), ⌃ (Control)
216+
- Windows/Linux: Ctrl, Alt
217+
218+
```typescript
219+
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0
220+
221+
const formatKey = (key: string): string => {
222+
if (key === 'Ctrl+F') {
223+
return isMac ? '⌘F' : 'Ctrl+F'
224+
}
225+
return key
226+
}
227+
```
228+
229+
## Integration Points
230+
231+
**App.tsx:**
232+
- State for modal visibility: `useState<boolean>`
233+
- Global keydown listener for `?` key
234+
- Render KeyboardShortcuts component
235+
236+
**Header:**
237+
- Help icon button (HelpCircle) triggers modal
238+
- Tooltip: "Keyboard shortcuts (?)"
239+
240+
## Test Cases
241+
242+
1. Modal opens on `?` key press
243+
2. Modal opens on Help icon click
244+
3. Modal closes on Escape key
245+
4. Modal closes on backdrop click
246+
5. Modal closes on X button click
247+
6. All shortcuts displayed correctly
248+
7. Correct platform key names shown
249+
8. Focus trapped within modal
250+
9. Screen reader announces modal
251+
10. Responsive layout on mobile

0 commit comments

Comments
 (0)