Add inline @-mention agent picker to the compose bar - #14
Open
PanAndDuck wants to merge 1 commit into
Open
PanAndDuck wants to merge 1 commit into
PanAndDuck wants to merge 1 commit into
Conversation
Typing "@" in the message composer now pops up a small card listing the server's enabled agents (mirroring the desktop/web client's existing @-mention feature). Picking one inserts [@name](codeg://agent/<type>) into the draft, which the server already parses into a delegation when the message is sent — no server or send-path changes needed. - ComposeInsertModel: loadAgentsAction/loadAgentsIfNeeded, matchingAgents, trailingMentionToken (a live, tail-anchored @token scan since the plain TextField exposes no caret position), and draftInsertingAgentMention. - ComposeBar: mentionSuggestions popup (same glass styling as the rest of the bar) driven by the above, scrollable rather than truncated so it stays usable with more than a handful of agents configured. - SessionDetailViewModel: wires loadAgentsAction to the existing client.listAgents() call (already used by the Agents settings screen). Verified: builds and runs on Simulator and a physical device; typing "@" lists agents and selecting one inserts the correct reference text, which a live server correctly turns into a delegation.
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.
Summary
@in the message composer now pops up a small card listing the server's enabled agents, mirroring the desktop/web client's existing@-mention feature.[@Name](codeg://agent/<type>)into the draft — the exact format the server already parses into a delegation on send, so no server or send-path changes are needed here.Implementation
ComposeInsertModel:loadAgentsAction/loadAgentsIfNeeded,matchingAgents(for:),trailingMentionToken(in:)(a live, tail-anchored@tokenscan, since the compose bar's plainTextFieldexposes no caret position), anddraftInsertingAgentMention(_:to:).ComposeBar: amentionSuggestionspopup (same glass styling as the rest of the bar), shown as aVStacksibling above the text field alongside the existing notice/attachment chips.SessionDetailViewModel: wiresloadAgentsActionto the existingclient.listAgents()call already used by the Agents settings screen — no new API surface.Test plan
@lists the server's agents; selecting one inserts the correct reference text