From 86d25a5823c886f30d4b1a9cd1d829967a6cab4a Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 19 Feb 2026 21:20:27 +0200 Subject: [PATCH] fix: add ARIA roles, labels, and states to all interactive components --- src/App.tsx | 100 ++++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index a0cfbf2..79acdad 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -273,7 +273,7 @@ function App() { const contentRef = useRef(null); const sidebarRef = useRef(null); const searchInputRef = useRef(null); - const menuItemRefs = useRef<{ [key: string]: HTMLDivElement | null }>({}); + const menuItemRefs = useRef<{ [key: string]: HTMLButtonElement | null }>({}); const kineticDragActiveRef = useRef(false); const contextMenuRef = useRef(null); const tabScrollRef = useRef(null); @@ -753,7 +753,7 @@ function App() { Skip to content {isDraggingOver && ( - + @@ -774,9 +774,9 @@ function App() {
- - - + + +
)} @@ -784,39 +784,39 @@ function App() { {!focusMode && ( - -
{ menuItemRefs.current['file'] = el; }} onClick={() => setMenuOpen(prev => prev === 'file' ? null : 'file')}>File
-
{ menuItemRefs.current['view'] = el; }} onClick={() => setMenuOpen(prev => prev === 'view' ? null : 'view')}>View
-
{ menuItemRefs.current['help'] = el; }} onClick={() => setMenuOpen(prev => prev === 'help' ? null : 'help')}>Help
+ + + + {menuOpen === 'file' && menuItemRefs.current['file'] && ( - - - + + +
- +
)} {menuOpen === 'view' && menuItemRefs.current['view'] && ( - - - - + + + +
e.stopPropagation()}> UI Scale -
- +
+ {uiZoom}% - +
)} {menuOpen === 'help' && menuItemRefs.current['help'] && ( - - - + + + )} @@ -827,18 +827,18 @@ function App() { {tabs.length > 1 && ( - -
+ +
{tabs.map(tab => ( - { setActiveTabId(tab.id); parseHeadings(tab.content); }}> + { setActiveTabId(tab.id); parseHeadings(tab.content); }}> {tab.title} - + ))}
- + )} @@ -865,20 +865,20 @@ function App() { {showSearch && activeTab && ( - { setSearchQuery(e.target.value); }} onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); setCurrentMatchIndex(i => (i + 1) % Math.max(searchMatches.length, 1)); setSearchTriggerCount(c => c + 1); } }} autoFocus /> + { setSearchQuery(e.target.value); }} onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); setCurrentMatchIndex(i => (i + 1) % Math.max(searchMatches.length, 1)); setSearchTriggerCount(c => c + 1); } }} aria-label="Search document" autoFocus /> {searchMatches.length > 0 && ( <> - - {currentMatchIndex + 1} of {searchMatches.length} - + + {currentMatchIndex + 1} of {searchMatches.length} + )} - {searchQuery && searchMatches.length === 0 && No results} + {searchQuery && searchMatches.length === 0 && No results} )} - +
{activeTab ? ( @@ -901,10 +901,10 @@ function App() { {showShortcutsModal && ( setShowShortcutsModal(false)}> - e.stopPropagation()}> + e.stopPropagation()}>
-

Keyboard Shortcuts

- +

Keyboard Shortcuts

+
@@ -933,10 +933,10 @@ function App() { )} {showAboutModal && ( setShowAboutModal(false)}> - e.stopPropagation()}> + e.stopPropagation()}>
-

About Vesper

- +

About Vesper

+
@@ -952,7 +952,7 @@ function App() { {menuOpen && ( -
setMenuOpen(null)} /> +