fix(tui): extract @token text correctly in on_input_submitted suggestions query #10911

Merged
HAL9000 merged 5 commits from bugfix/m8-suggestions-query-extraction into master 2026-06-10 11:58:10 +00:00

5 Commits

Author SHA1 Message Date
HAL9000 1eca6b1da7 fix(tui): set prompt.value not prompt.text in suggestions query extraction test
CI / push-validation (pull_request) Successful in 26s
CI / lint (pull_request) Successful in 34s
CI / helm (pull_request) Successful in 56s
CI / typecheck (pull_request) Successful in 1m1s
CI / build (pull_request) Successful in 1m1s
CI / quality (pull_request) Successful in 1m9s
CI / security (pull_request) Successful in 1m9s
CI / unit_tests (pull_request) Successful in 4m58s
CI / docker (pull_request) Successful in 1m41s
CI / integration_tests (pull_request) Successful in 8m11s
CI / coverage (pull_request) Successful in 9m34s
CI / status-check (pull_request) Successful in 4s
consume_text() reads self.value (not self.text) on PromptInput.
The step definition was setting prompt.text = text which left
self.value empty, causing on_input_submitted to return early
before the @-token extraction block was reached.

ISSUES CLOSED: #4741
2026-06-10 07:43:02 -04:00
HAL9000 a73fc092f8 fix(tui): add no-@token edge case scenario to TDD regression suite
Adds a 5th scenario to tdd_tui_suggestions_query_extraction_4741.feature
that verifies suggestions() is NOT called when the prompt contains no @token.
This covers the guard condition in on_input_submitted and completes the
regression test suite for issue #4741.
2026-06-10 07:43:02 -04:00
HAL9000 5656ff4892 fix(tui): fix ruff format violations and clarify standalone @token test scenario
- Apply ruff format to tdd_tui_suggestions_query_extraction_4741_steps.py
  (two method signatures reformatted to fit within 88-char line limit)
- Fix redundant wrong value in last TDD scenario: change
  not actor:local/dev → not @actor:local/dev to make the
  assertion error message meaningful and distinguish from the
  correct expected value
2026-06-10 07:43:02 -04:00
HAL9000 e5fb17bf88 fix(tui): replace # type: ignore with setattr in TDD regression test steps 2026-06-10 07:43:02 -04:00
HAL9000 0fe333ea71 fix(tui): extract @token text correctly in on_input_submitted suggestions query
Replace text.replace("@", "").strip() with re.findall(r"@(\S+)", text) to
extract only the last @token text (without the @ sign and without surrounding
non-reference words) as the query passed to suggestions().

Previously, a prompt like "analyse @proj" would pass "analyse proj" as the
query to suggestions(), producing garbage fuzzy matches. Now it correctly
passes "proj".

Add TDD regression tests (tdd_tui_suggestions_query_extraction_4741.feature)
with @tdd_issue and @tdd_issue_4741 tags covering:
- Single @token in multi-word prompt
- @token with category prefix
- Multiple @tokens (uses last token)
- Standalone @token at start of prompt

ISSUES CLOSED: #4741
2026-06-10 07:43:02 -04:00