Skip to content

Keep typed query when opening a search result - #21

Open
seungjuchoi wants to merge 2 commits into
raine:mainfrom
seungjuchoi:search-enter-preserves-query
Open

seungjuchoi wants to merge 2 commits into
raine:mainfrom
seungjuchoi:search-enter-preserves-query

Conversation

@seungjuchoi

Copy link
Copy Markdown
Contributor

Problem

Opening a search result with Enter (SearchIntent::Navigate) committed a new search scoped to the picked task's display ref before opening its detail. Closing the detail then left a single-task search view (effectively AVEN-123 as the query) instead of the result list the user was actually choosing from, so there was no natural way back to the other matches.

Change

  • Commit the typed query as the search view and select the picked task within it. Closing the detail now returns to the full result list, with the picked task still selected. g [ back-navigation to the pre-search view is unchanged.
  • If the picked result is missing from the committed results (possible when the input changed after the preview ran), fall back to open_detail_task, the existing exact-task path used for linked tasks.

Tests

  • navigate_search_result_commits_typed_query drives the real flow (type query → settle preview → pick second result → Enter) and asserts the committed view is TaskProjectionOrigin::Search { query: "needle" } with both matches listed and the picked task selected.
  • navigate_search_result_missing_from_results_opens_exact_task covers the fallback.

cargo test --lib passes (1767 tests; RUST_MIN_STACK raised to get past the pre-existing debug-build stack overflow in focused_detail_child_removes_and_undo_restores_relationship, which also aborts on a clean main checkout). cargo fmt --check and cargo clippy --all-targets are clean.

seungju24.choi added 2 commits September 1, 2026 07:24
Accepting a search result with Enter committed a new search scoped to the
picked task's display ref before opening its detail. Closing the detail then
left a single-task search view instead of the result list the user was
choosing from.

Commit the typed query as the search view and select the picked task within
it. When the picked result is missing from the committed results (the input
changed after the preview ran), fall back to opening the task through the
exact-task detail path.

Regression coverage includes committing the typed query with the picked task
selected and the exact-task fallback.
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