feat(agent): clickable layer mention pills in AI chat composer and thread#172
Open
Zen0-99 wants to merge 5 commits into
Open
feat(agent): clickable layer mention pills in AI chat composer and thread#172Zen0-99 wants to merge 5 commits into
Zen0-99 wants to merge 5 commits into
Conversation
Adds a Windows-specific retry loop using cmd /c timeout when the port probing helper cannot identify the holding process. This avoids false positives when a previous dev server is still shutting down.
Contributor
|
Can you refine the design so the badge style doesn't push the text out of alignment? Btw. agent was already aware of your selected element, but there was no UI for it yet, so I agree that this is useful too. |
Contributor
Author
|
Accidentally pressed to close, but will get right on it! |
- New mentionLabel.ts helper resolves .classSelector, <tag>, or displayName from a nodeId, plus a tag-derived colorKey. - Mention pills are now bold colored inline text (no badge box) so they don't push line height out of alignment. - Underline uses currentColor so hover matches the pill color. - AgentComposer uses getMentionLabelForNode for inserted pills. - LayerNodeContextMenu generates human labels when staging mentions.
- RichTextBubble scanner now matches Layer/Module/Element/Node/Section/ Component prefixes with optional brackets or backticks. - Preserves the original prefix word in rendered output. - Falls back to agentMentionLabels registry for deleted nodes. - sendAgentMessage replaces human mention labels with 'Layer nodeId' in the AI prompt, and appends a concise instruction telling the AI to use the same format in its responses.
- AgentToolCall gains displayLabel (resolved at creation time via getMentionLabelForNode) so tool rows show human names after deletion. - ToolCallRow and toolCallDisplay.ts thread displayLabel through all node-detail helpers. - AgentSlice gains agentMentionLabels: Record<string, string> to accumulate nodeId→label mappings across the conversation. - Labels are registered when drafting mentions, sending user messages, and creating tool calls — surviving node deletion for AI response scanning. - streamEvents.ts resolves and caches displayLabel on toolCall creation.
Contributor
Author
|
@DavidBabinec So I polished up the PR (see new image above)
|
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
Adds interactive @-style layer mention pills to the AI chat composer and message thread. Users can click a sparkles icon in the canvas selection toolbar or right-click a layer in the DOM panel to queue layer IDs as styled pills in the composer. Pills are clickable and select the corresponding layer on the canvas. Sent messages retain their pill rendering in the thread, and the assistant's replies are also scanned for layer references so those render as pills too.
Why
Previously users had to describe elements to the AI because there was no way to reference the internal layer numbering system. This change lets users point the AI directly at specific layers via visual, clickable references.
Testing