fix: wire onRenameProject through EntryShell to DesignsTab (#1882)

Fixes #1790

## Problem

Project rename does not take effect in Open Design 0.8.0. After entering
a new name and clicking OK, the project keeps its old name.

## Root Cause

The onRenameProject callback was broken in the prop chain:

App.tsx ──(handleRenameProject)──▶ EntryView ✅
EntryView ──(onRenameProject missing)──▶ EntryShell ❌
EntryShell ──(onRename not in Props)──▶ DesignsTab ❌
DesignsTab.commitRename() → onRename?.() → silent no-op ❌

EntryView received onRenameProject from App but never forwarded it to
EntryShell. Since EntryShell is what renders DesignsTab, DesignsTab
never received the onRename callback. Because the prop is typed optional
(onRename?:), the confirm handler's onRename?.(id, trimmed) call
silently no-ops — no error, no rename.

This was introduced when EntryShell was added to the 0.8.0 codebase as
an intermediate shell layer and the rename prop was missed during the
handoff.

## Solution

Wire the callback through the missing links:

1. EntryView.tsx: Pass onRenameProject={onRenameProject} to EntryShell
2. EntryShell.tsx:
   - Add onRenameProject to Props interface
   - Destructure it in function params
   - Pass onRename={onRenameProject} to DesignsTab

Now the callback chain is complete and project renames work correctly.

## Testing

Verified that:
- Project rename dialog accepts new name
- Clicking OK successfully renames the project
- Project list reflects the new name immediately
- No console errors or warnings

## Impact

3 lines changed across 2 files. Low risk — only restores the missing
prop forwarding, does not change any rename logic or validation.
This commit is contained in:
Nicholas-Xiong
2026-05-17 14:57:11 +08:00
committed by GitHub
parent 7766582f0b
commit d54d3412d6
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -221,6 +221,7 @@ interface Props {
onOpenProject: (id: string) => void;
onOpenLiveArtifact: (projectId: string, artifactId: string) => void;
onDeleteProject: (id: string) => void;
onRenameProject: (id: string, name: string) => void;
onChangeDefaultDesignSystem: (id: string) => void;
onPersistComposioKey: (composio: AppConfig['composio']) => Promise<void> | void;
onOpenSettings: (
@@ -270,6 +271,7 @@ export function EntryShell({
onOpenProject,
onOpenLiveArtifact,
onDeleteProject,
onRenameProject,
onChangeDefaultDesignSystem,
onPersistComposioKey,
onOpenSettings,
@@ -743,6 +745,7 @@ export function EntryShell({
onOpen={onOpenProject}
onOpenLiveArtifact={onOpenLiveArtifact}
onDelete={onDeleteProject}
onRename={onRenameProject}
/>
</div>
)
+1
View File
@@ -340,6 +340,7 @@ export function EntryView({
onOpenProject={onOpenProject}
onOpenLiveArtifact={onOpenLiveArtifact}
onDeleteProject={onDeleteProject}
onRenameProject={onRenameProject}
onChangeDefaultDesignSystem={onChangeDefaultDesignSystem}
onPersistComposioKey={onPersistComposioKey}
onOpenSettings={onOpenSettings}