Add rename workspace functionality (Vibe Kanban) (#1868)
* I've added the rename workspace functionality. Here's a summary of the changes:
## Summary
The backend already had rename workspace support via the `PUT /api/task-attempts/{attemptId}` endpoint with the `name` field. I added the frontend UI to expose this functionality.
### Files Created
1. **`frontend/src/components/ui-new/dialogs/RenameWorkspaceDialog.tsx`**
- New dialog component for renaming workspaces
- Shows the current name (or branch name as fallback)
- Allows user to input a new name
- Handles mutation with proper error handling and cache invalidation
### Files Modified
1. **`frontend/src/components/ui-new/actions/index.ts`**
- Added `PencilSimpleIcon` import
- Added `RenameWorkspaceDialog` import
- Added new `RenameWorkspace` action that shows the rename dialog
2. **`frontend/src/components/ui-new/actions/pages.ts`**
- Added `Actions.RenameWorkspace` to the `workspaceActions` page (at the top of the list)
3. **`frontend/src/i18n/locales/en/common.json`**
- Added translations for the rename workspace dialog under `workspaces.rename`
### How to Use
Users can now rename a workspace by:
1. Clicking the three-dot menu (⋯) on any workspace in the sidebar
2. Selecting "Rename" from the command bar
3. Entering a new name in the dialog
4. Clicking "Rename" to save
* Cleanup script changes for workspace 4eb64331-cc43-43af-849e-3731664e53b9
* Added the missing translations for the rename workspace dialog to all locale files:
- **es** (Spanish)
- **ja** (Japanese)
- **ko** (Korean)
- **zh-Hans** (Simplified Chinese)
- **zh-Hant** (Traditional Chinese)
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
||||
ArrowsClockwiseIcon,
|
||||
CrosshairIcon,
|
||||
DesktopIcon,
|
||||
PencilSimpleIcon,
|
||||
} from '@phosphor-icons/react';
|
||||
import { useDiffViewStore } from '@/stores/useDiffViewStore';
|
||||
import { useUiPreferencesStore } from '@/stores/useUiPreferencesStore';
|
||||
@@ -40,6 +41,7 @@ import { workspaceSummaryKeys } from '@/components/ui-new/hooks/useWorkspaces';
|
||||
import { ConfirmDialog } from '@/components/ui-new/dialogs/ConfirmDialog';
|
||||
import { ChangeTargetDialog } from '@/components/ui-new/dialogs/ChangeTargetDialog';
|
||||
import { RebaseDialog } from '@/components/ui-new/dialogs/RebaseDialog';
|
||||
import { RenameWorkspaceDialog } from '@/components/ui-new/dialogs/RenameWorkspaceDialog';
|
||||
import { CreatePRDialog } from '@/components/dialogs/tasks/CreatePRDialog';
|
||||
import { getIdeName } from '@/components/ide/IdeIcon';
|
||||
import { EditorSelectionDialog } from '@/components/dialogs/tasks/EditorSelectionDialog';
|
||||
@@ -191,6 +193,20 @@ export const Actions = {
|
||||
},
|
||||
},
|
||||
|
||||
RenameWorkspace: {
|
||||
id: 'rename-workspace',
|
||||
label: 'Rename',
|
||||
icon: PencilSimpleIcon,
|
||||
requiresTarget: true,
|
||||
execute: async (ctx, workspaceId) => {
|
||||
const workspace = getWorkspaceFromCache(ctx.queryClient, workspaceId);
|
||||
await RenameWorkspaceDialog.show({
|
||||
workspaceId,
|
||||
currentName: workspace.name || workspace.branch,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
PinWorkspace: {
|
||||
id: 'pin-workspace',
|
||||
label: (workspace?: Workspace) => (workspace?.pinned ? 'Unpin' : 'Pin'),
|
||||
|
||||
Reference in New Issue
Block a user