Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Extend session picker keyboard navigation
rcourtman789358fa379d
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.mdindex 6e15f94ebe..05294ee133 100644--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md@@ -926,7 +926,7 @@ runtime cost control, and shared AI transport surfaces.refresh/search is still running, and loading/error states must stay insidethe picker instead of making the main send path look busy. The referencedOpenCode source at fetched `origin/dev` commit- `1399323b78a04229d9bfe00c7436d7f41770fda8` implements+ `4519a1da329c1a4fc384054e7203ba7d06928205` implements`SessionSwitcherDialog` in`packages/opencode/src/cli/cmd/tui/feature-plugins/session/dialog.tsx` with`createDebouncedSignal("", 150)`,@@ -954,8 +954,12 @@ runtime cost control, and shared AI transport surfaces.The picker trigger and result rows are part of that source-backed workflow:the trigger must expose its accessible name and expanded state, opening thepicker must focus search, and each result must be a keyboard-addressable- option with list navigation and a named delete action instead of a- mouse-only row.+ option with up/down, page, home/end, and Escape navigation from both the+ focused search field and focused result rows. Session-picker Escape is a+ local close path that returns focus to the session trigger and must consume+ the keypress so the App-level Assistant drawer Escape guard does not also+ close the whole drawer. Delete remains a named row action instead of a+ mouse-only affordance.Assistant session rename is part of that same source-backed sessionworkflow. The referenced OpenCode source in`packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx`diff --git a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsxindex 18c4a6a418..33a9b71d67 100644--- a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx+++ b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx@@ -2744,6 +2744,66 @@ describe('AIChat', () => {});});+ it('supports page, home, end, and Escape from session picker search', async () => {+ const onClose = vi.fn();+ const onParentKeyDown = vi.fn();+ const pageSessions = Array.from({ length: 12 }, (_, index) => ({+ id: `session-${index}`,+ title: `Page Session ${index}`,+ created_at: '',+ updated_at: '',+ message_count: index + 1,+ }));+ mockAIChatAPI.listSessions.mockResolvedValue(pageSessions);++ render(() => (+ <div onKeyDown={onParentKeyDown}>+ <AIChat onClose={onClose} />+ </div>+ ));+ await waitFor(() => {+ expect(mockAIChatAPI.listSessions).toHaveBeenCalled();+ });++ const sessionButton = screen.getByTitle('Pulse Assistant sessions');+ fireEvent.click(sessionButton);+ const searchInput = await screen.findByPlaceholderText('Search sessions...');+ const optionFor = (index: number) =>+ screen.getByRole('option', {+ name: `Resume Page Session ${index}, ${index + 1} ${index === 0 ? 'message' : 'messages'}`,+ });++ await waitFor(() => {+ expect(document.activeElement).toBe(searchInput);+ });++ fireEvent.keyDown(searchInput, { key: 'PageDown' });+ expect(document.activeElement).toBe(optionFor(10));++ searchInput.focus();+ fireEvent.keyDown(searchInput, { key: 'PageUp' });+ expect(document.activeElement).toBe(optionFor(11));++ searchInput.focus();+ fireEvent.keyDown(searchInput, { key: 'End' });+ expect(document.activeElement).toBe(optionFor(11));++ searchInput.focus();+ fireEvent.keyDown(searchInput, { key: 'Home' });+ expect(document.activeElement).toBe(optionFor(0));++ searchInput.focus();+ fireEvent.keyDown(searchInput, { key: 'Escape' });+ await waitFor(() => {+ expect(+ screen.queryByRole('dialog', { name: 'Pulse Assistant sessions' }),+ ).not.toBeInTheDocument();+ expect(document.activeElement).toBe(sessionButton);+ });+ expect(onParentKeyDown).not.toHaveBeenCalled();+ expect(onClose).not.toHaveBeenCalled();+ });+it('pins sessions above the recency groups and persists the choice', async () => {mockAIChatAPI.listSessions.mockResolvedValue([{diff --git a/frontend-modern/src/components/AI/Chat/index.tsx b/frontend-modern/src/components/AI/Chat/index.tsxindex 3427c1100f..052ce42b7d 100644--- a/frontend-modern/src/components/AI/Chat/index.tsx+++ b/frontend-modern/src/components/AI/Chat/index.tsx@@ -1225,6 +1225,17 @@ export const AIChat: Component<AIChatProps> = (props) => {const focusSessionSearch = () => {queueMicrotask(() => sessionSearchInputRef?.focus());};+ const focusSessionTriggerAfterClose = () => {+ const trigger = sessionButtonRef;+ if (!trigger) return;+ window.setTimeout(() => trigger.focus(), 0);+ };+ const closeSessionPickerAndFocusTrigger = () => {+ setShowSessions(false);+ setSessionRefreshLoading(false);+ resetSessionSearch();+ focusSessionTriggerAfterClose();+ };const focusSessionRenameInput = () => {queueMicrotask(() => {sessionRenameInputRef?.focus();@@ -1255,6 +1266,20 @@ export const AIChat: Component<AIChatProps> = (props) => {return true;};+ const focusSessionOptionFromSearchByOffset = (offset: number) => {+ const sessionList = sessionPickerSessions();+ if (sessionList.length === 0) return false;+ let nextIndex = offset;+ if (nextIndex < 0) nextIndex = sessionList.length - 1;+ if (nextIndex >= sessionList.length) nextIndex = 0;+ return focusSessionOptionAtIndex(nextIndex);+ };++ const consumeSessionPickerKey = (event: KeyboardEvent) => {+ event.preventDefault();+ event.stopPropagation();+ };+const focusSessionOptionRelativeTo = (sessionId: string, offset: number) => {const sessionList = sessionPickerSessions();const currentIndex = sessionList.findIndex((session) => session.id === sessionId);@@ -1265,19 +1290,32 @@ export const AIChat: Component<AIChatProps> = (props) => {const handleSessionSearchKeyDown = (event: KeyboardEvent) => {if (event.altKey || event.ctrlKey || event.metaKey) return;if (event.key === 'ArrowDown' && focusSessionOptionAtIndex(0)) {- event.preventDefault();+ consumeSessionPickerKey(event);return;}if (event.key === 'ArrowUp' && focusSessionOptionAtIndex(sessionPickerSessions().length - 1)) {- event.preventDefault();+ consumeSessionPickerKey(event);+ return;+ }+ if (event.key === 'PageDown' && focusSessionOptionFromSearchByOffset(10)) {+ consumeSessionPickerKey(event);+ return;+ }+ if (event.key === 'PageUp' && focusSessionOptionFromSearchByOffset(-10)) {+ consumeSessionPickerKey(event);+ return;+ }+ if (event.key === 'Home' && focusSessionOptionAtIndex(0)) {+ consumeSessionPickerKey(event);+ return;+ }+ if (event.key === 'End' && focusSessionOptionAtIndex(sessionPickerSessions().length - 1)) {+ consumeSessionPickerKey(event);return;}if (event.key === 'Escape') {- event.preventDefault();- setShowSessions(false);- setSessionRefreshLoading(false);- resetSessionSearch();- sessionButtonRef?.focus();+ consumeSessionPickerKey(event);+ closeSessionPickerAndFocusTrigger();}};@@ -1288,35 +1326,32 @@ export const AIChat: Component<AIChatProps> = (props) => {if (event.altKey || event.ctrlKey || event.metaKey) return;if (event.key === 'ArrowDown' && focusSessionOptionRelativeTo(sessionId, 1)) {- event.preventDefault();+ consumeSessionPickerKey(event);return;}if (event.key === 'ArrowUp' && focusSessionOptionRelativeTo(sessionId, -1)) {- event.preventDefault();+ consumeSessionPickerKey(event);return;}if (event.key === 'Home' && focusSessionOptionAtIndex(0)) {- event.preventDefault();+ consumeSessionPickerKey(event);return;}if (event.key === 'End' && focusSessionOptionAtIndex(sessionPickerSessions().length - 1)) {- event.preventDefault();+ consumeSessionPickerKey(event);return;}if (event.key === 'PageDown' && focusSessionOptionRelativeTo(sessionId, 10)) {- event.preventDefault();+ consumeSessionPickerKey(event);return;}if (event.key === 'PageUp' && focusSessionOptionRelativeTo(sessionId, -10)) {- event.preventDefault();+ consumeSessionPickerKey(event);return;}if (event.key === 'Escape') {- event.preventDefault();- setShowSessions(false);- setSessionRefreshLoading(false);- resetSessionSearch();- sessionButtonRef?.focus();+ consumeSessionPickerKey(event);+ closeSessionPickerAndFocusTrigger();}};@@ -3451,6 +3486,7 @@ export const AIChat: Component<AIChatProps> = (props) => {value={sessionSearchQuery()}onChange={setSessionSearchQuery}onKeyDown={handleSessionSearchKeyDown}+ clearOnFocusedEscape={false}placeholder={AI_CHAT_SESSION_SEARCH_PLACEHOLDER}title={AI_CHAT_SESSION_SEARCH_TITLE}inputClass="py-1.5 text-xs"