Skip to content

Pre-select current item in go-to dialogs; add import/export for entry name presets - #108

Merged
sdercolin merged 1 commit into
devfrom
feature/goto-preselect-and-preset-import-export
Jul 9, 2026
Merged

sdercolin merged 1 commit into
devfrom
feature/goto-preselect-and-preset-import-export

Conversation

@sdercolin

Copy link
Copy Markdown
Owner

Implements two TODO feature cards.

Pre-select current entry/subproject in the go-to dialogs

The Go to Entry and Go to Subproject dialogs share NavigatorListState.updateSearch(), whose selection branched on hasFocus (focused → first row, else → current item). But these dialogs auto-focus their search bar on open, so hasFocus was already true when the list was first built — the "select current item" branch was dead and the dialogs always opened on the first item.

Selection is now keyed off the action instead of focus:

  • first result only while actively typing a query (onTextChange → selectFirst = true), so Enter still jumps to the top match;
  • the current entry/module on open and navigation (default) — the requested pre-selection.

hasFocus is retained (it still drives the search-bar divider styling).

Blast radius: the pinned in-editor entry list shares this code. The only behavioral change there is that the filter-toggle buttons keep the current entry highlighted instead of jumping to row 0 when the search bar happened to be focused — a minor improvement, not a navigation regression.

Import/export for entry name presets

Added Import (FileDownload) / Export (FileUpload) icon buttons to the reusable string-list preference widget, gated by a new importExportEnabled flag turned on only for the Entry name presets setting. Files are plain text, one item per line (\n-separated); import trims blanks and de-duplicates, export writes the list as-is. Reuses the existing SaveFileDialog/OpenFileDialog + snackbar pattern.

Note: import replaces the preset list (matching export round-trip and the existing config-import precedent) rather than appending.

Tests

New ui/common/NavigatorListStateTest.kt covers the pre-selection logic: current-on-open, current-even-when-focused (the regression), first-result-while-typing, and the filtered-out / empty-result cases. 8 new localized strings added across all four languages. ./gradlew jvmTest and ktlintCheck pass.

🤖 Generated with Claude Code

… name presets

Go-to-entry/subproject dialogs (trello dMRzfaep):
Re-key NavigatorListState selection off the action rather than search-bar
focus. The dialogs auto-focus their search bar on open, so the old
`hasFocus` branch always selected the first row and the "select current
item" branch was dead. `updateSearch(selectFirst)` now selects the first
result only while the user is actively typing, and the current
entry/module on open and navigation, giving the requested pre-selection.

Entry name presets import/export (trello UFNZv4zB):
Add Import/Export icon buttons to the reusable string-list preference
widget, gated by a new `importExportEnabled` flag enabled only for the
entry name presets setting. Files are plain text, one item per line;
import trims blanks and de-duplicates. Reuses the existing file-dialog +
snackbar pattern.

Add NavigatorListStateTest covering the pre-selection logic and new
localized strings across all four languages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sdercolin
sdercolin merged commit 26ef7ca into dev Jul 9, 2026
1 check passed
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