feat(desktop): replace plus dropdown with icon buttons in new workspace modal#2980
Conversation
📝 WalkthroughWalkthroughAdjusted 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
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)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
GitHubIssueLinkCommandwhich usesnormalizeIssueState()to safely convert the state string, this component directly castspr.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
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
apps/desktop/src/renderer/components/Chat/ChatInterface/components/IssueLinkCommand/IssueLinkCommand.tsxapps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/PromptGroup.tsxapps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/GitHubIssueLinkCommand/GitHubIssueLinkCommand.tsxapps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/PRLinkCommand/PRLinkCommand.tsxpackage.json
| "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" | ||
| }, |
There was a problem hiding this comment.
🧩 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 1Repository: 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.
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
+dropdown menu in the new workspace modal prompt input with individual icon buttons (attachment, Linear issue, GitHub issue, PR link)+/×button, persisted via localStorageside="bottom")Test plan
+to toggle expand/collapse, verify state persists across modal reopensSummary 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
Dependencies
@mastra/coreoverride tomastracode-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
Chores