feat(swift): E1 Command Center voltooid
E1.S1 Command Center layout: - 4-zone layout (context, canvas, recent, input) - Keyboard shortcuts (⌘K focus, Escape close) - CanvasArea met empty state + voorbeelden E1.S2 Context Bar: - Shift indicator met icons per dienst - Patient chip met avatar + clear button - Terug naar EPD link E1.S3 Command Input: - Dynamic placeholder op basis van context - Send button (verschijnt bij input) - Focus state met ring E1.S4 Voice Input: - useSwiftVoice hook (wraps Deepgram) - Real-time waveform visualisatie - Streaming transcript naar input E1.S5 Recent Strip: - Intent-based chips met icons + kleuren - Relative time (zojuist, 5m, 2u) - Click-to-repeat functionaliteit - Quick hints bij lege state Bouwplan bijgewerkt: E0+E1 done (21/68 SP, 31%) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,27 +4,62 @@
|
||||
* Command Center
|
||||
*
|
||||
* Main container for the Swift interface.
|
||||
* Orchestrates Context Bar, Canvas, Recent Strip, and Command Input.
|
||||
* 4-zone layout: Context Bar | Canvas Area | Recent Strip | Command Input
|
||||
*
|
||||
* Layout specs:
|
||||
* - Context Bar: 48px (h-12)
|
||||
* - Canvas Area: flex-1 (fills remaining space)
|
||||
* - Recent Strip: 48px (h-12)
|
||||
* - Command Input: 64px (h-16)
|
||||
*/
|
||||
|
||||
import { ReactNode } from 'react';
|
||||
import { useEffect, useCallback, useRef } from 'react';
|
||||
import { useSwiftStore } from '@/stores/swift-store';
|
||||
import { ContextBar } from './context-bar';
|
||||
import { CommandInput } from './command-input';
|
||||
import { RecentStrip } from './recent-strip';
|
||||
import { CanvasArea } from './canvas-area';
|
||||
|
||||
interface CommandCenterProps {
|
||||
children?: ReactNode;
|
||||
}
|
||||
export function CommandCenter() {
|
||||
const { closeBlock, activeBlock } = useSwiftStore();
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
// Global keyboard shortcuts
|
||||
const handleKeyDown = useCallback(
|
||||
(e: KeyboardEvent) => {
|
||||
// Escape: close active block
|
||||
if (e.key === 'Escape' && activeBlock) {
|
||||
e.preventDefault();
|
||||
closeBlock();
|
||||
}
|
||||
|
||||
// Cmd/Ctrl + K: focus input
|
||||
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
|
||||
e.preventDefault();
|
||||
inputRef.current?.focus();
|
||||
}
|
||||
},
|
||||
[activeBlock, closeBlock]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
window.addEventListener('keydown', handleKeyDown);
|
||||
return () => window.removeEventListener('keydown', handleKeyDown);
|
||||
}, [handleKeyDown]);
|
||||
|
||||
export function CommandCenter({ children }: CommandCenterProps) {
|
||||
return (
|
||||
<>
|
||||
{/* Context Bar - 48px */}
|
||||
<ContextBar />
|
||||
<main className="flex-1 flex items-center justify-center p-4 overflow-auto">
|
||||
{children}
|
||||
</main>
|
||||
|
||||
{/* Canvas Area - flex */}
|
||||
<CanvasArea />
|
||||
|
||||
{/* Recent Strip - 48px */}
|
||||
<RecentStrip />
|
||||
<CommandInput />
|
||||
|
||||
{/* Command Input - 64px */}
|
||||
<CommandInput ref={inputRef} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user