Skip to content

Preserve leading '/' when opening tree filter and add initial_text parameter#4

Merged
koianaoki merged 1 commit into
codex/fix-filter-issue-in-tree-viewfrom
codex/fix-regular-expression-search
May 11, 2026
Merged

Preserve leading '/' when opening tree filter and add initial_text parameter#4
koianaoki merged 1 commit into
codex/fix-filter-issue-in-tree-viewfrom
codex/fix-regular-expression-search

Conversation

@koianaoki
Copy link
Copy Markdown
Owner

Motivation

  • Ensure that opening the tree filter via the / key preserves the leading slash in the input and enters regex mode so users can immediately type a regex prefix.
  • Allow callers to open the tree filter with optional initial text to support explicit invocations with a starting character.

Description

  • Added an initial_text: str | None = None parameter to action_tree_filter and updated the ExplorerActionsProtocol signature to match.
  • When initial_text is not provided, infer a leading slash if the filter was opened by the / key using _last_key_char or _last_key, and set _tree_filter_text to initial_text instead of clearing it.
  • Updated key handling to call action_tree_filter("/") when receiving / key events and adjusted printable character handling accordingly.
  • Use the raw filter text when calling tree_filter_input.set_filter for empty queries so the leading slash remains visible.
  • Added unit tests covering opening the filter with / and preserving an empty regex prefix.

Testing

  • Added test_tree_filter_opened_by_slash_keeps_slash_visible which asserts the leading slash is preserved and the filter enters regex mode. This test passed.
  • Added test_tree_filter_empty_regex_prefix_remains_visible which asserts an empty regex prefix ("/") sets regex mode and updates the displayed filter; this test passed.
  • Existing tree filter unit tests were run and continued to pass (including invalid-regex handling and regex prefix tests).

Codex Task

@koianaoki koianaoki merged commit be43e31 into codex/fix-filter-issue-in-tree-view May 11, 2026
@koianaoki koianaoki deleted the codex/fix-regular-expression-search branch May 11, 2026 01:56
koianaoki added a commit that referenced this pull request May 11, 2026
…sion-search"

This reverts commit be43e31, reversing
changes made to af08c6c.
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