Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Nov 4, 2025

Related GitHub Issue

Closes: #8076

Roo Code Task Context (Optional)

No Roo Code task context for this PR

Description

Implements refined keyboard behavior for the "@" context picker:

  • Tab on a selected Folder drills into that folder without closing the picker and immediately lists its children.
  • Enter on a selected Folder inserts the folder and closes the picker (previous behavior).

Key implementation details:

  • Added a Tab-specific folder branch in handleMentionSelect() that:
    • Ensures folder mention ends with "/" (escaped when needed).
    • Inserts without trailing space, keeps the menu open, moves caret after "/".
    • Immediately posts a searchFiles message so folder children populate.
    • Normalizes query by stripping a leading "/" before searching for better matches.
  • Extended selection handler signature to accept trigger ("Enter" | "Tab" | "Click") and only drill on Tab handleKeyDown() integration.
  • Normalized "@" input handler to remove a leading "/" from the query before search handleInputChange().

Files touched:

Test Procedure

Manual:

  1. Start a new task, type "@", pick a folder from suggestions.
  2. Press Tab: picker stays open, input becomes "@/path/to/folder/" (no trailing space), folder children are listed and narrow as you type.
  3. Press Enter: folder is inserted and picker closes.
  4. Try nested folders and paths with spaces to verify escaping/normalization.

Automated:

  • Ran webview-ui tests: cd webview-ui && npx vitest run
  • Ran backend tests: cd src && npx vitest run

Both suites passed locally.

Pre-Submission Checklist

  • Issue Linked
  • Scope focused on the issue
  • Self-Review completed
  • Tests executed locally
  • Documentation Impact considered (N/A)
  • Contribution Guidelines reviewed

Screenshots / Videos

No UI screenshot changes; behavior change in picker navigation.

Documentation Updates

  • No documentation updates are required.

Additional Notes

This change confines drill-in to Tab only per feedback, preserving Enter for selection.

Get in Touch

@hannesrudolph


Important

Refines folder picker behavior in ChatTextArea.tsx to allow Tab for drill-in and Enter for selection, updating tests accordingly.

  • Behavior:
    • Tab on a selected folder drills into the folder, keeps the picker open, and lists children in ChatTextArea.tsx.
    • Enter on a selected folder inserts the folder and closes the picker.
  • Functions:
    • handleMentionSelect() in ChatTextArea.tsx updated to handle Tab and Enter differently for folders.
    • handleKeyDown() in ChatTextArea.tsx modified to pass the key trigger to handleMentionSelect().
    • handleInputChange() in ChatTextArea.tsx normalizes query by removing leading "/".
  • Tests:
    • Updated test description in modes.test.ts to reflect new behavior.

This description was created by Ellipsis for bb6ba42. You can customize this summary. It will automatically update as commits are pushed.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Nov 4, 2025
@roomote
Copy link

roomote bot commented Nov 4, 2025

See this task on Roo Code Cloud

All previously flagged issues have been resolved. The latest commit improves test reliability by explicitly instructing the agent to call attempt_completion.

  • Consider using slice(1) instead of regex /^\+/ for removing leading slash (line 385)
Previous Reviews

Mention @roomote in a comment to trigger your PR Fixer agent and make changes to this pull request.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 4, 2025
@roomote
Copy link

roomote bot commented Nov 4, 2025

See this task on Roo Code Cloud

Fixed the reported issue. All local checks passed.

View commit | Revert commit

@hannesrudolph hannesrudolph moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Nov 4, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working PR - Needs Preliminary Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: PR [Needs Prelim Review]

Development

Successfully merging this pull request may close these issues.

[BUG] Tab autocompletes folder and closes picker; can't drill into folders

3 participants