mirror of
https://github.com/nexu-io/open-design.git
synced 2026-10-27 09:51:12 +01:00
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:
@@ -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>
|
||||
)
|
||||
|
||||
@@ -340,6 +340,7 @@ export function EntryView({
|
||||
onOpenProject={onOpenProject}
|
||||
onOpenLiveArtifact={onOpenLiveArtifact}
|
||||
onDeleteProject={onDeleteProject}
|
||||
onRenameProject={onRenameProject}
|
||||
onChangeDefaultDesignSystem={onChangeDefaultDesignSystem}
|
||||
onPersistComposioKey={onPersistComposioKey}
|
||||
onOpenSettings={onOpenSettings}
|
||||
|
||||
Reference in New Issue
Block a user