Skip to content

feat(chat): click prompt chip in editor to edit its arguments#3384

Open
viniciusventura29 wants to merge 2 commits into
mainfrom
viniciusventura29/setup-logs
Open

feat(chat): click prompt chip in editor to edit its arguments#3384
viniciusventura29 wants to merge 2 commits into
mainfrom
viniciusventura29/setup-logs

Conversation

@viniciusventura29
Copy link
Copy Markdown
Contributor

@viniciusventura29 viniciusventura29 commented May 15, 2026

What is this contribution about?

Slash-prompt chips in the Tiptap editor (e.g. /Predict And Apply in the automation Instructions field, or in chat) are now clickable. Clicking a prompt chip re-opens PromptArgsDialog pre-filled with the values the user originally typed and, on submit, replaces the chip in place with refreshed metadata. Mention nodes now persist kind ("prompt" | "resource") and args so the edit flow knows what to pre-fill and can ignore non-editable chips.

Screenshots/Demonstration

N/A — pure UX wiring on existing components.

How to Test

  1. bun run dev, open an automation that has a slash-prompt with arguments (e.g. /Predict And Apply) in its Instructions.
  2. Click the orange chip. The arguments modal should open with the previous values pre-filled.
  3. Change a value, confirm — the chip stays in place and autosaves. Reload to verify persistence.
  4. Resources (/-mentions with kind: "resource") and @ agent chips should remain non-clickable.

Migration Notes

Backward compatible: existing chips in the DB have no kind/args. They are still clickable; the dialog opens with empty values on first edit, and from then on the args are stored.

Review Checklist

  • PR title is clear and descriptive
  • Changes are tested and working
  • Documentation is updated (if needed)
  • No breaking changes

Summary by cubic

Slash-prompt chips are now clickable to edit arguments in place via PromptArgsDialog; submit refreshes the chip. Resource and @ chips remain non-clickable; backward compatible (old chips open blank on first edit).

  • New Features

    • Prompt chips open PromptArgsDialog pre-filled; submit replaces the chip in place with refreshed metadata.
    • Mention nodes persist kind ("prompt" | "resource") and args; only prompt chips are clickable.
    • PromptArgsDialog accepts defaultValues; added click-to-edit bridge from MentionNode to SlashMention. Ice breakers and tools popover now set kind and args on insert.
  • Bug Fixes

    • Wrapped prompt lookup in the edit-on-click flow with try/catch and toast error to avoid unhandled rejections when loading prompts fails.

Written for commit b279797. Summary will update on new commits. Review in cubic

Persist user-supplied prompt argument values on mention nodes so chips
inserted via "/" (or the tools popover / ice-breakers) can be clicked
to re-open PromptArgsDialog pre-filled, and replace the chip in place
on submit. Adds a "kind" discriminator ("prompt" | "resource") so only
prompt chips become clickable; resources and "@" agent chips do not.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

🧪 Benchmark

Should we run the Virtual MCP strategy benchmark for this PR?

React with 👍 to run the benchmark.

Reaction Action
👍 Run quick benchmark (10 & 128 tools)

Benchmark will run on the next push after you react.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 15, 2026

Release Options

Suggested: Minor (2.328.0) — based on feat: prefix

React with an emoji to override the release type:

Reaction Type Next Version
👍 Prerelease 2.327.6-alpha.1
🎉 Patch 2.327.6
❤️ Minor 2.328.0
🚀 Major 3.0.0

Current version: 2.327.5

Note: If multiple reactions exist, the smallest bump wins. If no reactions, the suggested bump is used (default: patch).

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/mesh/src/web/components/chat/tiptap/mention-slash.tsx">

<violation number="1" location="apps/mesh/src/web/components/chat/tiptap/mention-slash.tsx:156">
P2: Handle errors in the async chip-edit dispatcher; otherwise failed prompt fetches can produce unhandled promise rejections and silently fail to open the edit dialog.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Re-trigger cubic

Comment thread apps/mesh/src/web/components/chat/tiptap/mention-slash.tsx
Prompt lookup in the edit-on-click flow can throw if listPrompts fails;
wrap it in try/catch so the user gets a toast instead of an unhandled
rejection and a silently broken click.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant