Skip to content

Return dialog for exact todo query and preserve submenu for todo #791

Merged
multiplex55 merged 2 commits intomasterfrom
codex/update-todoplugin-search_internal-behavior
Feb 2, 2026
Merged

Return dialog for exact todo query and preserve submenu for todo #791
multiplex55 merged 2 commits intomasterfrom
codex/update-todoplugin-search_internal-behavior

Conversation

@multiplex55
Copy link
Copy Markdown
Owner

Motivation

  • Make the root todo query show the primary dialog action instead of listing submenu commands when the user types exactly todo (case-insensitive) with no trailing text.
  • Preserve discoverability of submenu commands when the user types todo (with a trailing space) or todo <command>.

Description

  • Update TodoPlugin::search_internal to detect an exact todo match and return a single Action with action == "todo:dialog" and label "todo: edit todos" when the suffix is exactly empty.
  • Keep the existing submenu action list in the todo branch when the suffix contains only whitespace so todo still shows all subcommands.
  • Change the entry-point trimming in Plugin::search to use trim_start() so trailing spaces are preserved and the plugin can distinguish "todo" from "todo ".
  • Add a unit test search_todo_space_shows_submenu and simplify search_plain_todo_opens_dialog in tests/todo_plugin.rs to assert exact behaviors for "todo" and "todo " respectively.

Testing

  • Added unit tests in tests/todo_plugin.rs verifying that plugin.search("todo") returns exactly one result with action == "todo:dialog" and that plugin.search("todo ") exposes the submenu labels; the tests were added successfully.
  • Ran cargo test --test todo_plugin, but the build failed during dependency compilation due to a missing system library required by alsa-sys (error: missing alsa.pc / alsa development package), so the test run could not complete in this environment.

Codex Task

@multiplex55 multiplex55 merged commit 85808db into master Feb 2, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/update-todoplugin-search_internal-behavior branch February 2, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant