Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: make Review Daily Briefing fullscreen a focus-trapped, Escape-dismissable dialog (#9121)

[._.]/ Adam Eivy51ccc9a469a3
diff --git a/client/src/pages/Review.jsx b/client/src/pages/Review.jsx
index 0e23118128..5212abed30 100644
--- a/client/src/pages/Review.jsx
+++ b/client/src/pages/Review.jsx
@@ -42,6 +42,8 @@ import AgentCard from '../components/cos/tabs/AgentCard';
import TabPills from '../components/ui/TabPills';
import useUrlParams from '../hooks/useUrlParams';
import useAsyncAction from '../hooks/useAsyncAction';
+import useEscapeKey from '../hooks/useEscapeKey';
+import useFocusTrap from '../hooks/useFocusTrap';
import { timeAgo, formatDateTime, formatCount, localDateKey } from '../utils/formatters';
import { markdownToPlainText, dropsMarkupWhenFlattened } from '../utils/markdownText';
import { useActionQueue } from '../hooks/useActionQueue';
@@ -154,6 +156,10 @@ export default function Review() {
const [editingId, setEditingId] = useState(null);
const [filter, setFilter] = useState('pending');
const [briefingFullscreen, setBriefingFullscreen] = useState(false);
+ const briefingRef = useRef(null);
+ // Fullscreen acts as a modal: trap Tab, dismiss on Escape, and hand focus back to the toggle.
+ useFocusTrap(briefingFullscreen, briefingRef);
+ useEscapeKey(briefingFullscreen, () => setBriefingFullscreen(false));
const [counts, setCounts] = useState(null);
const countsRequestId = useRef(0);
@@ -586,7 +592,12 @@ export default function Review() {
{/* Daily Briefing remains available as compatibility/history context. */}
{showLegacyReviewSurface && briefing && briefing.source !== 'none' && (
- <section className={`bg-port-card border border-port-border rounded-xl p-4 ${briefingFullscreen ? 'fixed inset-0 z-50 overflow-y-auto m-0 rounded-none' : ''}`}>
+ <section
+ ref={briefingRef}
+ role={briefingFullscreen ? 'dialog' : undefined}
+ aria-modal={briefingFullscreen ? 'true' : undefined}
+ aria-label={briefingFullscreen ? 'Daily Briefing' : undefined}
+ className={`bg-port-card border border-port-border rounded-xl p-4 ${briefingFullscreen ? 'fixed inset-0 z-50 overflow-y-auto m-0 rounded-none' : ''}`}>
<div className="flex items-center justify-between gap-2 mb-2">
<h3 className="text-sm font-semibold text-white flex items-center gap-2">
<FileText size={16} className="text-gray-400" />
diff --git a/client/src/pages/Review.test.jsx b/client/src/pages/Review.test.jsx
index 63121312c0..3fee375f41 100644
--- a/client/src/pages/Review.test.jsx
+++ b/client/src/pages/Review.test.jsx
@@ -582,3 +582,29 @@ describe('Review Hub triage summary (#6926)', () => {
expect(summaryValue('Alerts')).toBe('2');
});
});
+
+describe('Review Hub Daily Briefing fullscreen dialog (#9121)', () => {
+ it('acts as a focus-trapped, Escape-dismissable dialog and returns focus to the toggle', async () => {
+ api.getReviewBriefing.mockResolvedValueOnce({ source: 'test', generatedAt: '2026-09-29T00:00:00Z', content: 'Briefing body' });
+ render(<Review />);
+
+ const toggle = await screen.findByRole('button', { name: 'Fullscreen' });
+ expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
+ toggle.focus();
+ fireEvent.click(toggle);
+
+ const dialog = await screen.findByRole('dialog', { name: 'Daily Briefing' });
+ expect(dialog).toHaveAttribute('aria-modal', 'true');
+ await waitFor(() => expect(dialog.contains(document.activeElement)).toBe(true));
+
+ // Tab from the last (only) focusable wraps inside instead of escaping to the page behind.
+ const exit = screen.getByRole('button', { name: 'Exit fullscreen' });
+ exit.focus();
+ fireEvent.keyDown(dialog, { key: 'Tab' });
+ expect(dialog.contains(document.activeElement)).toBe(true);
+
+ fireEvent.keyDown(window, { key: 'Escape' });
+ await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
+ expect(screen.getByRole('button', { name: 'Fullscreen' })).toHaveFocus();
+ });
+});