Skip to content

fix: focus the right field when a form, popover or menu opens - #25

Merged
ttncode merged 1 commit into
mainfrom
fix/focus-on-open
Oct 12, 2026
Merged

ttncode merged 1 commit into
mainfrom
fix/focus-on-open

Conversation

@ttncode

@ttncode ttncode commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Summary

Whatever opens now puts keyboard focus where you'd type next.

Opens Before Now
Edit Display Name (Alt+Shift+N / Welcome menu) focus stayed on the page name field focused, prefilled with the current name and selected
Habit → Edit stayed on the page name field focused
Goal → comments stayed on the page comment field focused
Focus summary → edit session stayed on the page title field focused
Add Tag popover (Alt+Shift+T / click) stayed on the page "Create new tag" focused; Esc closes
Menu (Alt+M / click) stayed on the button first item focused; Esc closes and returns focus to the button

Already correct and unchanged: Alt+G (goal), Alt+N on To-Dos/Goals/Habits/Tags/Boost, to-do inline edits, habit notes, new tags, dialogs and panels.

Testing

  • Lint, typecheck, unit tests and build pass.
  • In the browser: Alt+Shift+N → name field focused with "Alex" selected, Esc closes; Alt+Shift+T → "Create new tag" focused, Esc closes; Alt+M → first menu item focused, Esc closes; Alt+G → goal field focused.

## Summary
Whatever opens now puts keyboard focus where you'd type next.

| Opens | Before | Now |
| --- | --- | --- |
| Edit Display Name (Alt+Shift+N / Welcome menu) | focus stayed on the page | name field focused, prefilled with the current name and selected |
| Habit → Edit | stayed on the page | name field focused |
| Goal → comments | stayed on the page | comment field focused |
| Focus summary → edit session | stayed on the page | title field focused |
| Add Tag popover (Alt+Shift+T / click) | stayed on the page | "Create new tag" focused; Esc closes |
| Menu (Alt+M / click) | stayed on the button | first item focused; Esc closes and returns focus to the button |

Already correct and unchanged: Alt+G (goal), Alt+N on To-Dos/Goals/Habits/Tags/Boost, to-do inline edits, habit notes, new tags, dialogs and panels.

## Testing
- Lint, typecheck, unit tests and build pass.
- In the browser: Alt+Shift+N → name field focused with "Alex" selected, Esc closes; Alt+Shift+T → "Create new tag" focused, Esc closes; Alt+M → first menu item focused, Esc closes; Alt+G → goal field focused.
@ttncode
ttncode merged commit e4fa91e into main Oct 12, 2026
2 checks passed
@ttncode
ttncode deleted the fix/focus-on-open branch October 12, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant