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
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.
- 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
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