diff --git a/CODE-AUDIT.md b/CODE-AUDIT.md index 6a1282e..c48662b 100644 --- a/CODE-AUDIT.md +++ b/CODE-AUDIT.md @@ -1170,8 +1170,10 @@ root cause is already filed. ### Low — polish & smaller friction -- [ ] **UX16 — URL field isn't focused on launch.** `aerofetch-url` is only focused via the command +- [x] **UX16 — URL field isn't focused on launch.** `aerofetch-url` is only focused via the command palette; opening the app or the Downloads tab requires a click to start typing. **Fix:** autofocus it. + *Fixed: an `App` mount effect focuses `#aerofetch-url` on launch when the Downloads tab is active + (double-rAF for paint, reusing the command palette's focus pattern).* - [ ] **UX17 — Icon-only Fetch/Paste buttons** rely on hover tooltips for meaning (UI a11y; new users on touch/keyboard miss them). **Fix:** labels or `aria`-described affordances. - [ ] **UX18 — The quality control morphs after Fetch** (preset list → real formats; label "Quality" → "Quality / format") in place — a surprising transform. **Fix:** keep a stable control with a clear "formats loaded" state. diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index f15a646..490ac36 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -104,6 +104,16 @@ function App(): React.JSX.Element { useDownloads.getState().hydrate() }, []) + // UX16: focus the URL field on launch so the user can paste + type immediately + // (Downloads is the default tab). Double-rAF waits for paint, matching the command + // palette's "New download" focus. + useEffect(() => { + if (useNav.getState().tab !== 'downloads') return + requestAnimationFrame(() => + requestAnimationFrame(() => document.getElementById('aerofetch-url')?.focus()) + ) + }, []) + // Promote scheduled ('saved' + a due scheduledFor) items when their time arrives. // The queue is persisted (M4), so a scheduled item survives a quit and fires on the // next launch once its time has passed. A 15s tick is plenty for minute-granularity