Skip to content

feat(agent): clickable layer mention pills in AI chat composer and thread#172

Open
Zen0-99 wants to merge 1 commit into
CoreBunch:mainfrom
Zen0-99:feature/agent-layer-mentions
Open

feat(agent): clickable layer mention pills in AI chat composer and thread#172
Zen0-99 wants to merge 1 commit into
CoreBunch:mainfrom
Zen0-99:feature/agent-layer-mentions

Conversation

@Zen0-99

@Zen0-99 Zen0-99 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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

  • All 54 existing tests pass (bun test)
  • TypeScript compiles cleanly (bun tsc --noEmit)
  • Verified multi-selection support: Ctrl+click multiple layers, click sparkles icon, all layers appear as separate pills
  • Verified mention click: clicking a pill selects the corresponding layer on the canvas
image image

@Zen0-99 Zen0-99 changed the title feat: clickable layer mention pills in AI chat feat(agent): clickable layer mention pills in AI chat composer and thread Jul 2, 2026
@DavidBabinec

Copy link
Copy Markdown
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.

@Zen0-99 Zen0-99 closed this Jul 3, 2026
@Zen0-99 Zen0-99 reopened this Jul 3, 2026
@Zen0-99

Zen0-99 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Accidentally pressed to close, but will get right on it!

@Zen0-99

Zen0-99 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@DavidBabinec So I polished up the PR (see new image above)

  • Instead of those chunky badge-style pills with borders and backgrounds that were pushing text around, mentions now render as bold colored inline text — they sit right in the flow of the sentence without messing up line height.
  • Colors now pull from the node's actual tag or class selector, so a div gets its familiar blue, a header its green, etc. — no more random purple. For readability we show human labels like .icon or h3 in the UI while still shipping Layer nodeId to the AI under the hood so it knows exactly what we're talking about.
  • I also added a little registry that remembers node labels across the conversation, so if you ask the AI to delete something and it later references that layer in its reply, the pill still shows .icon instead of a raw ID — even though the node is long gone.

@Zen0-99

Zen0-99 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@DavidBabinec Everything look okay?

@DavidBabinec

Copy link
Copy Markdown
Contributor

@DavidBabinec Everything look okay?

Yes, but I am bit overwhelmed this week. Give me a few days :) I saw the PRs but need some time to test them or provide feedback. Thanks for contributing!

@Zen0-99 Zen0-99 force-pushed the feature/agent-layer-mentions branch from 6cbfb1d to d4fe0b9 Compare July 13, 2026 22:25
- Clickable layer mention pills in AI chat composer and thread

- Human-readable layer mention labels with tag-derived colors

- AI response mention scanning with machine-readable prompts

- Cached tool-call labels and conversation mention registry

- Layer-node context menu Add to AI chat action
@Zen0-99 Zen0-99 force-pushed the feature/agent-layer-mentions branch from d4fe0b9 to 61893c7 Compare July 13, 2026 22:40
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