fix(dialog): focus and select the name entry in naming dialogs #31

Merged
dusan merged 1 commit from t3code/autofocus-folder-name-input into main 2026-09-02 11:03:14 +00:00
Owner

The naming dialogs (New Folder, New Session, Rename Folder, Rename Session) all come from Window::prompt, which never named the entry as the dialog's focus widget. AdwDialog therefore focused the response button row on present, so creating a folder needed a click or Tab before the name could be typed.

prompt now builds the dialog with AdwAlertDialog::builder().focus_widget(&entry), set at construction so it holds before the dialog is presented, and pre-selects an existing name so a rename can be overwritten by typing and kept by pressing Enter.

Verified in a running instance with a temporary probe reading AdwDialog::focus() after present: New Folder reports focus on the entry's inner GtkText with no selection, Rename Session the same with the whole old name selected. ./build-aux/ci.sh and ./build-aux/smoke.sh both pass.

The naming dialogs (New Folder, New Session, Rename Folder, Rename Session) all come from `Window::prompt`, which never named the entry as the dialog's focus widget. `AdwDialog` therefore focused the response button row on present, so creating a folder needed a click or Tab before the name could be typed. `prompt` now builds the dialog with `AdwAlertDialog::builder().focus_widget(&entry)`, set at construction so it holds before the dialog is presented, and pre-selects an existing name so a rename can be overwritten by typing and kept by pressing Enter. Verified in a running instance with a temporary probe reading `AdwDialog::focus()` after present: New Folder reports focus on the entry's inner `GtkText` with no selection, Rename Session the same with the whole old name selected. `./build-aux/ci.sh` and `./build-aux/smoke.sh` both pass.
feat(dialog): autofocus and select folder name input
Some checks failed
CI / check (push) Failing after 1m14s
CI / package (push) Has been skipped
CI / check (pull_request) Failing after 1m8s
CI / package (pull_request) Has been skipped
a27f2047a3
- Pre-select text entry so typing immediately replaces existing name
- Set entry as dialog's focus widget to receive input without clicking
- Improves UX for folder rename operations
dusan merged commit 6e1133f551 into main 2026-09-02 11:03:14 +00:00
dusan deleted branch t3code/autofocus-folder-name-input 2026-09-02 11:03:14 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dusan/terminalko!31
No description provided.