Repository navigation
Feature request: add a project to a workspace from the Projects grid via a right-click menu #708
Copy link
Copy link
Open
Labels
design-approvedDesign agreed by a maintainer; a PR referencing this issue can be reviewedDesign agreed by a maintainer; a PR referencing this issue can be reviewed
Description
Short description
Add a project to a workspace from the Projects grid through a right-click menu (Add to workspace ▸ <workspace>), so the project side can reach the membership it already displays.
What problem does this solve?
A project's workspace is visible from the project side but only editable from the workspace side, and the workspace side is a multi-step detour:
- The Projects grid shows membership read-only. A card renders a
🗂 <name>pill whenProjectCard.workspace_nameis set (packages/dashboard/src/components/Projects/ProjectsGrid.tsx:86-92), populated byworkspace_name_by_identity(packages/dashboard/src-tauri/src/db.rs:5032-5043). - Joining a workspace is only possible inside
WorkspacesPanel: click+ Add member(WorkspacesPanel.tsx:559-572), pick the project from aFilterSelectbuilt byavailableProjectsForWorkspace(WorkspacesPanel.tsx:519-531,workspace-staging.ts:138-146), optionally type a display name, clickAdd(handleStageAddMember,WorkspacesPanel.tsx:135-154). That only stages the change, so it still needsSave changes→applyWorkspaceChanges(WorkspacesPanel.tsx:196-218). - So "put this project I am looking at into its workspace" costs: switch to Workspaces → find the target workspace → Add member → locate the project in a name-only dropdown (no search) → Add → Save.
- Right-clicking a project card does nothing in the app. The card is a plain
<button>with onlyonClick(ProjectsGrid.tsx:70-73), andpackages/dashboard/srccontains nocontextmenuhandler at all, so the right-click menu you get is the webview's own (Reload / back / forward).
Proposed solution
Give project cards a context menu with a workspace submenu:
┌──────────────────────────┐
│ Open project │
│ Add to workspace ▸ │──┐
└──────────────────────────┘ │
┌───────────────────┐ │
│ 🗂 magic-context │◀─────┘
│ 🗂 guizhan-account│
└───────────────────┘
- Left-click keeps opening the project detail; only
onContextMenuis added to the existing card control. - The submenu lists the workspaces from the existing
listWorkspaces()(src/lib/api.ts:94). The workspace the project already belongs to is marked rather than offered again. - Picking a workspace commits immediately through the existing
apply_workspace_changes, with no staging step — there is no workspace form on screen to save. Payload:addMembers: [{ project_path: card.identity, display_name: card.display_name, display_path: card.primary_path }],rename: null,removeMembers: [],setDisplayNames: [], and the workspace's currentshare_categoriespassed through unchanged.
No backend change is needed:
apply_workspace_changesis differential. Share categories are written only when the normalized value differs from the stored one (packages/dashboard/src-tauri/src/workspaces.rs:743-744), andrename: Noneperforms no rename (workspaces.rs:746-753), so an add-only payload cannot disturb the rest of the workspace.- The client already has the membership data it needs:
listWorkspaces()returns each workspace'smembersandshare_categories(WorkspaceListItem,src/lib/types.ts:623-630).
Implementation notes:
- A project can belong to at most one workspace:
CREATE UNIQUE INDEX idx_mc_workspace_member_unique ON mc_workspace_members(project_path)(crates/mc-store/src/lib.rs:716-717), and the backend rejects a project that already belongs elsewhere (workspaces.rs:692-701). The submenu should therefore be a single-choice list, and readMove to workspace ▸(remove + add) when the project already has one. - Home-directory projects cannot be members (
workspaces.rs:653-657,is_user_home_workspace_member,workspaces.rs:841-860). The submenu should be hidden or disabled for them, or the backend error surfaced. The frontend cannot cheaply decide this itself — the home identity isdir:<md5(canonical_home)[..12]>, and the second check canonicalizesdisplay_path, so this likely needs a flag onProjectCard. FloatingLayer(src/components/ConfigEditor/FloatingLayer.tsx) already provides a portalled, viewport-aware layer with Esc and outside-click close, and is the natural container for such a menu (it would probably want to move tosrc/components/shared/).
Alternatives considered
- A hover button on the card. The card is a
<button>element today (ProjectsGrid.tsx:70), so a nested button would be invalid HTML; that option costs a card rework (non-button container plus keyboard semantics) and is a bigger change than adding a context-menu handler. - A workspace selector on the project detail page (
ProjectDetail.tsx) — the same capability, one navigation deeper. - A dedicated
add_workspace_membercommand — unnecessary, because the differentialapply_workspace_changesalready accepts an add-only payload.
Area
Dashboard
Additional context
- Observed on the installed dashboard build 0.20.0 (
/Applications/Magic Context Dashboard.app); UI references read frommaster. - The project card and the project detail header already show which workspace a project is in; the gap is only the entry point from the project side.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
design-approvedDesign agreed by a maintainer; a PR referencing this issue can be reviewedDesign agreed by a maintainer; a PR referencing this issue can be reviewed
Activity
magic-alfonso commentedon Oct 16, 2026
Thanks for the thorough write-up. The analysis matches the source, and we'd welcome a PR for this. A few notes so it lands smoothly:
Add to workspace ▸when the project has no workspace,Move to workspace ▸(remove + add) when it already has one, and the current workspace marked rather than offered.ProjectCardfrom the backend (reusingis_user_home_workspace_member) and disable the submenu with a short reason, rather than letting the save fail.FloatingLayertosrc/components/shared/is fine. Please keep the menu keyboard-accessible (Esc to close, arrow keys if practical) and check it in the light theme.apply_workspace_changeswith the add-only payload, passingshare_categoriesthrough unchanged, and refresh the grid afterwards so the pill updates.Heads-up: workspaces are part of a larger memory redesign we're working on. Standalone installs will keep Magic Context's own workspaces, so this entry point stays useful either way.