feat: add Prompt tab to pair-with-agent modal#9568
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
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="frontend/src/components/editor/actions/pair-with-agent-modal.tsx">
<violation number="1" location="frontend/src/components/editor/actions/pair-with-agent-modal.tsx:181">
P2: The Prompt tab displays the full auth token in plain text. Mask the token in rendered text while keeping raw copy behavior.</violation>
</file>
Architecture diagram
sequenceDiagram
participant User as User (Browser)
participant Modal as PairWithAgentModal
participant TabState as Active Tab State
participant CommandBlock as CommandBlock Component
participant Clipboard as Clipboard API
participant TokenHook as useAuthToken Hook
User->>Modal: Opens pair-with-agent modal
Modal->>TokenHook: Calls useAuthToken()
TokenHook->>TokenHook: useEffect reads auth token from context
TokenHook-->>Modal: Returns token (string | null)
alt Terminal tabs (Claude, Codex, OpenCode)
User->>Modal: Selects agent tab (Claude/Codex/OpenCode)
Modal->>TabState: setActiveTab(tab)
TabState-->>Modal: Active tab updated
Modal->>CommandBlock: Renders Step 1: Install skill<br/>Step 2: getTerminalCommand(agent, url, hasToken)<br/>Step 3: Paste token (if available)
CommandBlock->>CommandBlock: Formats command with agent name, URL, token flag
User->>CommandBlock: Clicks copy button
CommandBlock->>Clipboard: navigator.clipboard.writeText(command)
Clipboard-->>CommandBlock: Success
CommandBlock-->>User: Shows "Copied!" tooltip for 2 seconds
else Prompt tab (NEW)
User->>Modal: Selects "Prompt" tab
Modal->>TabState: setActiveTab("prompt")
TabState-->>Modal: Active tab updated
Modal->>CommandBlock: Renders Step 1: Install skill hint<br/>Step 2: getRawPrompt(url, authToken)
Note over Modal,CommandBlock: NEW: Generates raw text prompt block instead of terminal command
CommandBlock->>CommandBlock: Formats multiline prompt with URL and optional auth token hint
User->>CommandBlock: Clicks copy button
CommandBlock->>CommandBlock: multiline=true triggers <pre> rendering with scrollable text
CommandBlock->>Clipboard: navigator.clipboard.writeText(fullPrompt)
Clipboard-->>CommandBlock: Success
CommandBlock-->>User: Shows "Copied!" tooltip for 2 seconds
end
Note over Modal,CommandBlock: Dialog width changes from sm:max-w-lg to sm:max-w-2xl<br/>to accommodate wider prompt content
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Re-trigger cubic
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a fourth "Prompt" tab to the Pair with Agent modal that surfaces a copy-pasteable prompt (including the optional auth token) for agents that aren't run via terminal, and refactors the modal layout so each tab carries its own step list.
Changes:
- Introduces a
promptAgentTabwith its own raw-prompt generator and aTERMINAL_TABSconstant; renamesgetPromptCommand→getTerminalCommand. - Restructures the modal so each tab renders its own numbered
Steplist, and widens the dialog tosm:max-w-2xl. - Adds a
multilinemode toCommandBlockfor rendering the longer prompt with a scrollable<pre>.
Contributor
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.7-dev43 |
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.
Uh oh!
There was an error while loading. Please reload this page.