feat(ux): UX16 — autofocus the URL field on launch
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user