diff --git a/src/App.tsx b/src/App.tsx index 6e1ec26..f0c0b4d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -106,6 +106,10 @@ const App: React.FC = () => { // Global keydown listener for shortcuts help useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { + const tag = (e.target as HTMLElement)?.tagName; + const isEditable = tag === 'INPUT' || tag === 'TEXTAREA' || (e.target as HTMLElement)?.isContentEditable; + if (isEditable) return; + if (e.key === '?' || e.key === '/') { e.preventDefault(); setShowShortcuts(prev => !prev); @@ -206,20 +210,22 @@ const App: React.FC = () => { className="flex-none border-b border-zinc-800 bg-zinc-950/50 backdrop-blur-sm z-40" >
-

TypoGenie

-
+
{/* UI Zoom Control */} @@ -234,7 +240,7 @@ const App: React.FC = () => { className="hidden sm:flex items-center gap-2 px-3 py-1.5 text-xs text-zinc-400 hover:text-zinc-300 bg-zinc-900 hover:bg-zinc-800 rounded-lg transition-colors border border-zinc-800" title="Reload templates from disk" > - +
); @@ -96,18 +96,20 @@ const FontList: React.FC<{ fonts: string[] }> = ({ fonts }) => { disabled={downloadingFont === font} whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }} + aria-label={`Download ${font} font`} className="px-2 py-1 bg-zinc-900 border border-zinc-800 hover:border-zinc-600 rounded-l text-zinc-300 hover:text-white transition-all flex items-center gap-1.5 text-xs font-medium" > - {downloadingFont === font ? : } + {downloadingFont === font ?
{downloadStatus[font] && ( @@ -381,7 +383,7 @@ export const Preview: React.FC = ({
setFocusedElement('back')} whileHover={{ x: -3 }} whileTap={{ scale: 0.95 }} className="flex items-center gap-2 text-zinc-400 hover:text-white transition-colors outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:ring-offset-zinc-950 rounded-lg px-2 py-1"> - + @@ -404,12 +406,12 @@ export const Preview: React.FC = ({ {successMsg ? ( - + ) : ( - {isExporting ? : } + {isExporting ? )} diff --git a/src/components/StyleSelector.tsx b/src/components/StyleSelector.tsx index 12cbac3..a145d25 100644 --- a/src/components/StyleSelector.tsx +++ b/src/components/StyleSelector.tsx @@ -279,7 +279,7 @@ export const StyleSelector: React.FC = ({ {/* Top Controls */}
-
+
@@ -290,14 +290,15 @@ export const StyleSelector: React.FC = ({
- +
-
+
{(['Letter', 'A4'] as PaperSize[]).map((size) => (
{selectedStyle === style.id && ( -
+ )} @@ -444,10 +466,11 @@ export const StyleSelector: React.FC = ({ ref={iframeRef} className="w-full h-full border-0 block" title="Style Preview" + tabIndex={-1} /> ) : (
- +
@@ -462,7 +485,7 @@ export const StyleSelector: React.FC = ({ className="flex items-center gap-2 px-6 py-3 bg-indigo-600 hover:bg-indigo-500 text-white font-bold rounded-xl transition-all shadow-lg hover:shadow-indigo-500/25 disabled:opacity-50 disabled:cursor-not-allowed" > Apply Style & Convert - +