Skip to content

feat(desktop): replace plus dropdown with icon buttons in new workspace modal#2980

Merged
Kitenite merged 5 commits into
mainfrom
icon-buttons-instead-dropdown
Mar 29, 2026
Merged

feat(desktop): replace plus dropdown with icon buttons in new workspace modal#2980
Kitenite merged 5 commits into
mainfrom
icon-buttons-instead-dropdown

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Mar 29, 2026

Summary

  • Replaces the + dropdown menu in the new workspace modal prompt input with individual icon buttons (attachment, Linear issue, GitHub issue, PR link)
  • Each button has a tooltip for discoverability
  • Adds expand/collapse toggle with +/× button, persisted via localStorage
  • Changes all link command popovers to open downward (side="bottom")

Test plan

  • Open new workspace modal, verify icon buttons appear with tooltips
  • Click + to toggle expand/collapse, verify state persists across modal reopens
  • Click each icon button and verify the correct popover/dialog opens downward
  • Verify attachments, Linear issues, GitHub issues, and PR links all still work

Summary by cubic

Replaced the “+” dropdown in the New Workspace modal with four quick icon buttons (attach file, link Linear issue, link GitHub issue, link PR). Added a global Cmd/Ctrl+Enter hotkey to create from anywhere in the modal, and standardized link popovers to open downward.

  • New Features

    • Icon buttons with tooltips for attachment, Linear issue, GitHub issue, and PR link.
    • Cmd/Ctrl+Enter submits workspace creation from any field; footer hint updated to {modKey}↵.
    • Expand/collapse toggle (+/×) for prompt tools; state persists via localStorage.
    • Link popovers align start, side bottom for consistent positioning.
  • Dependencies

    • Updated @mastra/core override to mastracode-v0.4.0-superset.15 (1.8.0-superset.2); lockfile refreshed.

Written for commit 93f9999. Summary will update on new commits.

Summary by CodeRabbit

  • UI Updates

    • Replaced a dropdown with inline icon buttons for quick access to attachments and link actions.
    • Adjusted popover positioning across link/issue/PR controls for improved placement and visibility.
    • Streamlined keyboard behavior in the new workspace modal: global Enter+modifier now triggers create; per-field handlers removed; hint text updated.
  • Chores

    • Updated an internal dependency resolution to a newer release.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 29, 2026

📝 Walkthrough

Walkthrough

Adjusted popover anchor placement in three components, replaced a dropdown plus-menu with inline attachment buttons and moved modal-level Enter+modifier create handling to a global listener, and updated a package resolution URL.

Changes

Cohort / File(s) Summary
Popover positioning adjustments
apps/desktop/src/renderer/components/Chat/ChatInterface/components/IssueLinkCommand/IssueLinkCommand.tsx, apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/GitHubIssueLinkCommand/GitHubIssueLinkCommand.tsx, apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx
Changed PopoverContent props: align from "end" to "start" and side from "top" to "bottom" in each component (no other behavior changes).
PromptGroup UI & keyboard handling
apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/PromptGroup.tsx
Replaced the PlusMenu dropdown with a new AttachmentButtons component rendering four inline PromptInputButtons (file attach, issue link, GitHub issue link, PR link) with direct click handlers and tooltips. Moved Enter+modifier create handling from per-field onKeyDown to a modal-scoped global keyboard listener; updated UI hint text.
Dependency update
package.json
Updated resolutions for @mastra/core to mastracode-v0.4.0-superset.15 and mastra-core-1.8.0-superset.2.tgz (replaced previous superset.12 / .1 tarball).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User as User
  participant Modal as NewWorkspaceModal
  participant Buttons as AttachmentButtons
  participant IssueCmd as IssueLinkCommand
  participant FileSys as FileDialog

  User ->> Modal: Opens modal
  User ->> Modal: Presses Meta/Ctrl + Enter
  Modal ->> Modal: Global key listener invokes handleCreate
  User ->> Buttons: Click "Attach file"
  Buttons ->> FileSys: openFileDialog()
  User ->> Buttons: Click "Link issue"
  Buttons ->> IssueCmd: openIssueLinkCommand(anchorRef)
  IssueCmd ->> IssueCmd: Show Popover (align=start, side=bottom)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hooray—popovers hop to bottom and start,
Buttons now bustle, each playing its part,
One listener listens, Enter makes things new,
A file dialog pops and issues come into view,
I nibble a carrot and celebrate the view! 🍃

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: replacing the plus dropdown with icon buttons in the new workspace modal. It is concise, clear, and specific enough for quick understanding.
Description check ✅ Passed The pull request description is well-structured and comprehensive, covering all required template sections with clear details about changes, testing approach, and implementation notes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch icon-buttons-instead-dropdown

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/PromptGroup.tsx (1)

136-178: Add accessible labels to icon-only buttons.

The icon buttons rely solely on tooltips for labeling, but tooltips aren't accessible to all users. Screen readers may not convey the button purpose.

♿ Add aria-labels for accessibility
 <TooltipTrigger asChild>
   <PromptInputButton
     className={`${PILL_BUTTON_CLASS} w-[22px]`}
     onClick={() => attachments.openFileDialog()}
+    aria-label="Add attachment"
   >
     <PaperclipIcon className="size-3.5" />
   </PromptInputButton>
 </TooltipTrigger>

Apply similarly to the other three buttons with their respective labels: "Link Linear issue", "Link GitHub issue", "Link pull request".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/PromptGroup.tsx`
around lines 136 - 178, The icon-only PromptInputButton elements (the Paperclip
button that calls attachments.openFileDialog, and the three buttons using
onOpenIssueLink, onOpenGitHubIssue, onOpenPRLink) need accessible labels: add an
aria-label prop to each PromptInputButton with descriptive text ("Add
attachment", "Link Linear issue", "Link GitHub issue", "Link pull request") so
screen readers can announce the button purpose while keeping the existing
tooltip behavior.
apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx (1)

138-139: Consider adding state normalization for type safety (pre-existing code).

Unlike GitHubIssueLinkCommand which uses normalizeIssueState() to safely convert the state string, this component directly casts pr.state as PRState. If the API returns an unexpected value, this could cause issues.

💡 Optional: Add state normalization
+// Normalize PR state to valid PRState type
+const normalizePRState = (state: string): PRState =>
+  ["open", "closed", "merged"].includes(state.toLowerCase())
+    ? (state.toLowerCase() as PRState)
+    : "open";
+
 // In the JSX:
 <PRIcon
-  state={pr.state as PRState}
+  state={normalizePRState(pr.state)}
   className="size-3.5 shrink-0"
 />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx`
around lines 138 - 139, The PRLinkCommand component currently casts pr.state as
PRState when rendering <PRIcon>, which is unsafe if the API returns unexpected
values; replace the cast with a normalized value by converting pr.state via a
normalization helper (either reuse the existing normalizeIssueState() or add a
normalizePRState(state: string): PRState) and pass the normalized result to
PRIcon (e.g., state={normalizePRState(pr.state)}), ensuring the helper maps
unknown/invalid strings to a safe default PRState.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Around line 48-52: The package resolutions contain inconsistent release tags:
"mastracode" and "@mastra/memory" reference tag mastracode-v0.4.0-superset.12
while "@mastra/core" points to mastracode-v0.4.0-superset.15; confirm whether
this was intentional and, if not, align the "@mastra/core" resolution to use the
same tag as "mastracode" and "@mastra/memory" (or update all three to the
intended unified tag) within the "resolutions" block, and if this dependency
change is unrelated to the UI icon/tooltip work, move these resolution edits
into a separate PR to keep changes scoped.

---

Nitpick comments:
In
`@apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx`:
- Around line 138-139: The PRLinkCommand component currently casts pr.state as
PRState when rendering <PRIcon>, which is unsafe if the API returns unexpected
values; replace the cast with a normalized value by converting pr.state via a
normalization helper (either reuse the existing normalizeIssueState() or add a
normalizePRState(state: string): PRState) and pass the normalized result to
PRIcon (e.g., state={normalizePRState(pr.state)}), ensuring the helper maps
unknown/invalid strings to a safe default PRState.

In
`@apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/PromptGroup.tsx`:
- Around line 136-178: The icon-only PromptInputButton elements (the Paperclip
button that calls attachments.openFileDialog, and the three buttons using
onOpenIssueLink, onOpenGitHubIssue, onOpenPRLink) need accessible labels: add an
aria-label prop to each PromptInputButton with descriptive text ("Add
attachment", "Link Linear issue", "Link GitHub issue", "Link pull request") so
screen readers can announce the button purpose while keeping the existing
tooltip behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 39b9145c-b01d-4256-87bd-96df36d9c92a

📥 Commits

Reviewing files that changed from the base of the PR and between 6837adc and 487431c.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • apps/desktop/src/renderer/components/Chat/ChatInterface/components/IssueLinkCommand/IssueLinkCommand.tsx
  • apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/PromptGroup.tsx
  • apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/GitHubIssueLinkCommand/GitHubIssueLinkCommand.tsx
  • apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsx
  • package.json

Comment thread package.json
Comment on lines 48 to 52
"resolutions": {
"mastracode": "https://github.com/superset-sh/mastra/releases/download/mastracode-v0.4.0-superset.12/mastracode-0.4.0-superset.12.tgz",
"@mastra/core": "https://github.com/superset-sh/mastra/releases/download/mastracode-v0.4.0-superset.12/mastra-core-1.8.0-superset.1.tgz",
"@mastra/core": "https://github.com/superset-sh/mastra/releases/download/mastracode-v0.4.0-superset.15/mastra-core-1.8.0-superset.2.tgz",
"@mastra/memory": "https://github.com/superset-sh/mastra/releases/download/mastracode-v0.4.0-superset.12/mastra-memory-1.5.2-superset.1.tgz"
},
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.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify the new `@mastra/core` tarball URL is accessible.

# Test: Check if the GitHub release asset exists. Expect: HTTP 200 or redirect.
curl -sI "https://github.com/superset-sh/mastra/releases/download/mastracode-v0.4.0-superset.15/mastra-core-1.8.0-superset.2.tgz" | head -n 1

Repository: superset-sh/superset

Length of output: 75


Clarify the version tag inconsistency in Mastra package resolutions.

The @mastra/core resolution now references release tag mastracode-v0.4.0-superset.15 while mastracode and @mastra/memory still use superset.12. Confirm whether these packages are intended to use different release tags or if this is a version alignment issue.

Additionally, this dependency update appears unrelated to the PR's stated objectives (UI icon buttons and tooltips). Consider isolating unrelated changes into separate PRs for clearer review history.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 48 - 52, The package resolutions contain
inconsistent release tags: "mastracode" and "@mastra/memory" reference tag
mastracode-v0.4.0-superset.12 while "@mastra/core" points to
mastracode-v0.4.0-superset.15; confirm whether this was intentional and, if not,
align the "@mastra/core" resolution to use the same tag as "mastracode" and
"@mastra/memory" (or update all three to the intended unified tag) within the
"resolutions" block, and if this dependency change is unrelated to the UI
icon/tooltip work, move these resolution edits into a separate PR to keep
changes scoped.

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.

No issues found across 6 files

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 29, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch
  • ✅ Electric Fly.io app

Thank you for your contribution! 🎉

@Kitenite Kitenite merged commit cfe9de9 into main Mar 29, 2026
12 of 15 checks passed
@Kitenite Kitenite deleted the icon-buttons-instead-dropdown branch March 29, 2026 05:45
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