feat: allow empty submit when selected context is attached - #366
Merged
Conversation
Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
…bmit Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
quiet-node
force-pushed
the
feat/363-empty-submit-with-selection
branch
from
August 11, 2026 00:45
72e2372 to
6a06fb7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Pressing Enter on an empty ask bar now sends a turn whenever Thuki has captured selected text from the app you came from. The selection alone is the message, and the system prompt decides what happens to it, so a persona that already says "analyse and explain the content" no longer needs a typed instruction every time. Closes #363.
Key changes
handleSubmitresolves the sanitized selection up front and treats it as content, so an empty ask bar with a live selection is a valid submit. A genuinely empty submit, with no text, no images and no selection, stays blocked./think-only exception to any selection, stating the rule once instead of twice.runChatTurnno longer bails on a blank message when quoted text is present.build_user_contentcomposes the user message content. With no typed request it emits the[Highlighted Text]block alone and omits the[Request]header, leaving the system prompt as the sole authority over the content. It sits outsideask_modelso the branch is covered by tests rather than by the coverage-off command body./rewritewhose image failed could leave sticky armed alongside a live selection, and the next bare submit would auto-replace the user's selection in the source app with a free-form answer.has_user_requestwithholds the shortcut and hands the turn to the model. Turns carrying a typed request are unaffected, and/searchstill forces a search from its own path.Testing
bun run test:all:coverageandbun run validate-buildboth green: 2652 frontend tests, 2319 backend tests, 100% coverage on both sides.