Repository navigation
feat(app): drag-and-drop between groups + session management UI controls - #2039
Conversation
Drag-and-drop: - Sessions can be dragged onto group headers to reassign them (HTML5 DnD) - Each group separator and an 'Ungrouped' zone act as drop targets - Visual highlight on drag-over (ring + bg accent) - Root sessions (depth 0) are draggable in both grouped and ungrouped views UI control actions (auto-discovered by the opencode plugin + openwork-ui-mcp): - session.pin — toggle pin on a session - session.archive — archive/unarchive a session - session.group.create — create a new group in a workspace - session.group.move — move a session to a group (or ungrouped) - session.group.remove — remove a group (sessions become ungrouped) - session.group.list — list groups + assignments for a workspace This enables natural language workflows like: 'create a Done folder for this workspace' 'move this task to the Done folder when you're done' 'remove the Backlog group'
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
5 issues found across 3 files
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="apps/app/src/react-app/domains/session/control/session-control-actions.ts">
<violation number="1" location="apps/app/src/react-app/domains/session/control/session-control-actions.ts:244">
P2: `session.archive` does not validate the required `archived` boolean and silently treats missing input as `false` (unarchive).</violation>
<violation number="2" location="apps/app/src/react-app/domains/session/control/session-control-actions.ts:265">
P3: Don't disable this action solely on selectedWorkspaceId; it already accepts workspaceId and can validate at التنفيذ time. As written, callers cannot remove a group in another workspace when no workspace is selected.</violation>
<violation number="3" location="apps/app/src/react-app/domains/session/control/session-control-actions.ts:265">
P3: Don't disable this action solely on selectedWorkspaceId; it already accepts workspaceId and can validate at التنفيذ time. As written, callers cannot create a group in another workspace when no workspace is selected.</violation>
</file>
<file name="apps/app/src/react-app/domains/session/sidebar/app-sidebar.tsx">
<violation number="1" location="apps/app/src/react-app/domains/session/sidebar/app-sidebar.tsx:1206">
P2: The ungrouped drop zone is hidden when empty, preventing drag-and-drop moves back to ungrouped.</violation>
<violation number="2" location="apps/app/src/react-app/domains/session/sidebar/app-sidebar.tsx:1268">
P2: Native HTML5 dragging should not be enabled for rows that are still used by `Reorder.Group`, or ungrouped-session reordering becomes fragile.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| disabled: !opencodeClient, | ||
| execute: async (args) => { | ||
| const sessionId = stringArg(args, "sessionId"); | ||
| const archived = booleanArg(args, "archived"); |
There was a problem hiding this comment.
P2: session.archive does not validate the required archived boolean and silently treats missing input as false (unarchive).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/app/src/react-app/domains/session/control/session-control-actions.ts, line 244:
<comment>`session.archive` does not validate the required `archived` boolean and silently treats missing input as `false` (unarchive).</comment>
<file context>
@@ -202,4 +204,143 @@ export function useSessionControlActions(input: UseSessionControlActionsInput) {
+ disabled: !opencodeClient,
+ execute: async (args) => {
+ const sessionId = stringArg(args, "sessionId");
+ const archived = booleanArg(args, "archived");
+ if (!sessionId) return { ok: false, error: "sessionId is required" };
+ if (!opencodeClient) return { ok: false, error: "OpenCode client is not connected" };
</file context>
| const archived = booleanArg(args, "archived"); | |
| const archivedValue = objectArgs(args).archived; | |
| if (archivedValue !== true && archivedValue !== false) return { ok: false, error: "archived must be true or false" }; | |
| const archived = archivedValue; |
| {ungroupedRows.length > 0 ? ( | ||
| <> | ||
| <SessionGroupSeparator label={t("session_management.ungrouped")} groupId={null} workspaceId={workspaceId} /> | ||
| {ungroupedRows.map(renderRow)} | ||
| </> | ||
| ) : null} |
There was a problem hiding this comment.
P2: The ungrouped drop zone is hidden when empty, preventing drag-and-drop moves back to ungrouped.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/app/src/react-app/domains/session/sidebar/app-sidebar.tsx, line 1206:
<comment>The ungrouped drop zone is hidden when empty, preventing drag-and-drop moves back to ungrouped.</comment>
<file context>
@@ -1172,7 +1203,12 @@ function GroupedSessionList({ sessionRows, groups, assignments, pinnedIds, tree,
);
})}
- {ungroupedRows.length > 0 ? ungroupedRows.map(renderRow) : null}
+ {ungroupedRows.length > 0 ? (
+ <>
+ <SessionGroupSeparator label={t("session_management.ungrouped")} groupId={null} workspaceId={workspaceId} />
</file context>
| {ungroupedRows.length > 0 ? ( | |
| <> | |
| <SessionGroupSeparator label={t("session_management.ungrouped")} groupId={null} workspaceId={workspaceId} /> | |
| {ungroupedRows.map(renderRow)} | |
| </> | |
| ) : null} | |
| <> | |
| <SessionGroupSeparator label={t("session_management.ungrouped")} groupId={null} workspaceId={workspaceId} /> | |
| {ungroupedRows.map(renderRow)} | |
| </> |
| }; | ||
|
|
||
| const dragProps = depth === 0 ? { | ||
| draggable: true, |
There was a problem hiding this comment.
P2: Native HTML5 dragging should not be enabled for rows that are still used by Reorder.Group, or ungrouped-session reordering becomes fragile.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/app/src/react-app/domains/session/sidebar/app-sidebar.tsx, line 1268:
<comment>Native HTML5 dragging should not be enabled for rows that are still used by `Reorder.Group`, or ungrouped-session reordering becomes fragile.</comment>
<file context>
@@ -1228,13 +1264,21 @@ function SessionMenuItem({
};
+ const dragProps = depth === 0 ? {
+ draggable: true,
+ onDragStart: (e: React.DragEvent) => {
+ e.dataTransfer.setData(SESSION_DRAG_TYPE, session.id);
</file context>
| { name: "label", type: "string", required: true, description: "Group name (e.g. 'Done', 'In progress', 'Backlog')." }, | ||
| { name: "workspaceId", type: "string", required: false, description: "Workspace ID. Defaults to the selected workspace." }, | ||
| ], | ||
| disabled: !selectedWorkspaceId, |
There was a problem hiding this comment.
P3: Don't disable this action solely on selectedWorkspaceId; it already accepts workspaceId and can validate at التنفيذ time. As written, callers cannot remove a group in another workspace when no workspace is selected.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/app/src/react-app/domains/session/control/session-control-actions.ts, line 265:
<comment>Don't disable this action solely on selectedWorkspaceId; it already accepts workspaceId and can validate at التنفيذ time. As written, callers cannot remove a group in another workspace when no workspace is selected.</comment>
<file context>
@@ -202,4 +204,143 @@ export function useSessionControlActions(input: UseSessionControlActionsInput) {
+ { name: "label", type: "string", required: true, description: "Group name (e.g. 'Done', 'In progress', 'Backlog')." },
+ { name: "workspaceId", type: "string", required: false, description: "Workspace ID. Defaults to the selected workspace." },
+ ],
+ disabled: !selectedWorkspaceId,
+ execute: (args) => {
+ const label = stringArg(args, "label");
</file context>
| disabled: !selectedWorkspaceId, | |
| disabled: false, |
| { name: "label", type: "string", required: true, description: "Group name (e.g. 'Done', 'In progress', 'Backlog')." }, | ||
| { name: "workspaceId", type: "string", required: false, description: "Workspace ID. Defaults to the selected workspace." }, | ||
| ], | ||
| disabled: !selectedWorkspaceId, |
There was a problem hiding this comment.
P3: Don't disable this action solely on selectedWorkspaceId; it already accepts workspaceId and can validate at التنفيذ time. As written, callers cannot create a group in another workspace when no workspace is selected.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/app/src/react-app/domains/session/control/session-control-actions.ts, line 265:
<comment>Don't disable this action solely on selectedWorkspaceId; it already accepts workspaceId and can validate at التنفيذ time. As written, callers cannot create a group in another workspace when no workspace is selected.</comment>
<file context>
@@ -202,4 +204,143 @@ export function useSessionControlActions(input: UseSessionControlActionsInput) {
+ { name: "label", type: "string", required: true, description: "Group name (e.g. 'Done', 'In progress', 'Backlog')." },
+ { name: "workspaceId", type: "string", required: false, description: "Workspace ID. Defaults to the selected workspace." },
+ ],
+ disabled: !selectedWorkspaceId,
+ execute: (args) => {
+ const label = stringArg(args, "label");
</file context>
| disabled: !selectedWorkspaceId, | |
| disabled: false, |
Drag-and-drop between groups
Sessions can now be dragged onto group headers (or the "Ungrouped" zone) to reassign them. Uses native HTML5 DnD — no new dependencies.
draggable+onDragStartsetting the session IDonDragOver/onDropSession management UI control actions
Seven new control actions, auto-discovered by the opencode plugin and
openwork-ui-mcp:session.pinsession.archivesession.group.createsession.group.movesession.group.removesession.group.listThis enables natural language workflows like:
No changes needed in
openwork-extensions-preview.ts,openwork-ui-mcp, ormain.mjs— they are generic and automatically surface whatever actions are registered.Tests run
Diff
+191/-5 across 3 files (i18n, control actions, sidebar).