Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This change refactors SmartInput and AutocompletePopup to adhere to the Principle of Least Knowledge and improve separation of concerns.

Key changes:

  1. SmartInput: Removed DiskFileLoader and XmlFormattingFileLoader dependencies. SmartInput no longer expands file content; it submits a CompletionResult containing the raw text and file references.
  2. TextualApp: Assumed responsibility for expanding file content using FileLoader when handling the SmartInput.Submitted event. This keeps I/O logic at the application root rather than deep in a UI widget.
  3. AutocompletePopup: Implemented handle_key to encapsulate navigation logic (up, down, accept, close). SmartInput now delegates these key events to the popup instead of manipulating the popup's state directly.

These changes simplify the API of SmartInput and ensure AutocompletePopup is more self-contained. All tests passed.


PR created automatically by Jules for task 3963878248178462808 started by @gregorriegler

…ncerns

- Decouple SmartInput from File I/O by moving file expansion logic to TextualApp.
- SmartInput.Submitted message now carries a CompletionResult instead of a string.
- Delegate key handling (up/down/enter/tab/escape) from SmartInput to AutocompletePopup using a new `handle_key` method.
- Update TextualApp to use FileLoader to expand content upon submission.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

…ncerns

- Decouple SmartInput from File I/O by moving file expansion logic to TextualApp.
- SmartInput.Submitted message now carries a CompletionResult instead of a string.
- Delegate key handling (up/down/enter/tab/escape) from SmartInput to AutocompletePopup using a new `handle_key` method.
- Update TextualApp to use FileLoader to expand content upon submission.
- Remove backward compatibility for `Submitted.value`.
@gregorriegler gregorriegler marked this pull request as ready for review January 4, 2026 12:25
@gregorriegler gregorriegler merged commit c97c3dd into main Jan 4, 2026
3 checks passed
@gregorriegler gregorriegler deleted the refactor-smart-input-autocomplete-3963878248178462808 branch January 4, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants