Skip to content

feat: add Prompt tab to pair-with-agent modal#9568

Merged
mscolnick merged 2 commits into
mainfrom
ms/feature/add-prompt-tab
May 18, 2026
Merged

feat: add Prompt tab to pair-with-agent modal#9568
mscolnick merged 2 commits into
mainfrom
ms/feature/add-prompt-tab

Conversation

@mscolnick

@mscolnick mscolnick commented May 16, 2026

Copy link
Copy Markdown
Contributor
Screenshot 2026-05-17 at 2 37 26 PM
@vercel

vercel Bot commented May 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment May 18, 2026 1:57am

Request Review

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
Loading

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

Comment thread frontend/src/components/editor/actions/pair-with-agent-modal.tsx
@mscolnick mscolnick requested a review from manzt May 17, 2026 21:37
@mscolnick mscolnick marked this pull request as ready for review May 17, 2026 21:38
Copilot AI review requested due to automatic review settings May 17, 2026 21:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 prompt AgentTab with its own raw-prompt generator and a TERMINAL_TABS constant; renames getPromptCommandgetTerminalCommand.
  • Restructures the modal so each tab renders its own numbered Step list, and widens the dialog to sm:max-w-2xl.
  • Adds a multiline mode to CommandBlock for rendering the longer prompt with a scrollable <pre>.
@mscolnick mscolnick added the enhancement New feature or request label May 18, 2026
@mscolnick mscolnick enabled auto-merge (squash) May 18, 2026 17:28

@manzt manzt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks great.

@mscolnick mscolnick merged commit 3940013 into main May 18, 2026
33 of 34 checks passed
@mscolnick mscolnick deleted the ms/feature/add-prompt-tab branch May 18, 2026 17:31
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.7-dev43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

3 participants