From cc4fb132e4bad1cf78cea919e90ecd53522dfe36 Mon Sep 17 00:00:00 2001 From: debont80 Date: Wed, 1 Jul 2026 11:35:44 -0400 Subject: [PATCH] =?UTF-8?q?feat(ux):=20UX16=20=E2=80=94=20autofocus=20the?= =?UTF-8?q?=20URL=20field=20on=20launch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An App mount effect focuses #aerofetch-url when the Downloads tab is active (double-rAF for paint), so a user can paste + type immediately instead of clicking first. typecheck + eslint + prettier green. Co-Authored-By: Claude Opus 4.8 --- CODE-AUDIT.md | 4 +++- src/renderer/src/App.tsx | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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