fix: wizardDraftToAppSchema missing icon/label/branding fields#786
fix: wizardDraftToAppSchema missing icon/label/branding fields#786
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…; EditAppPage merges with original app Fixes the bug where editing an app via the wizard would lose icon/label/branding fields, causing the app to disappear from the sidebar and app switcher. Changes: - Added icon, label, branding, active fields to AppSchema interface - Updated wizardDraftToAppSchema to output icon, label, and branding - EditAppPage now merges wizard output with original app config - Added test coverage for icon/label preservation Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…tests Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
@copilot 仔细评估是否已经完成了所有的开发要求 |
…inal app fields Enhances the mock wizard onComplete to include icon field (matching real wizard behavior) and adds a dedicated test verifying: - label, icon, branding are present in saved schema (from wizard) - active is preserved from original app config (not in wizard) Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
已逐条核对 issue 中的全部开发要求,补充了缺失的集成测试,现已全部完成: Issue 要求 vs 实现状态:
受影响文件:
测试结果: 54 文件全部通过,736 passed / 2 skipped (c0d87d9) |
There was a problem hiding this comment.
Pull request overview
Fixes a console bug where editing/saving an app via the AppCreationWizard would persist an incomplete AppSchema, dropping metadata (icon, label, branding) needed for sidebar/app-switcher display.
Changes:
- Extend
AppSchemaand updatewizardDraftToAppSchema()to includelabel,icon, andbranding. - Update
EditAppPageto merge wizard output over the original app config before saving, preserving non-wizard fields (e.g.active,actions,areas). - Add/adjust unit + integration tests to cover round-tripping and merge preservation; update roadmap test counts.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/types/src/app.ts | Adds label/icon/branding/active to AppSchema and maps wizard draft fields into the schema. |
| packages/types/src/tests/app-creation-types.test.ts | Adds assertions and edge cases for icon/label/branding mapping. |
| apps/console/src/pages/EditAppPage.tsx | Saves merged schema to avoid dropping app fields not managed by the wizard. |
| apps/console/src/tests/app-creation-integration.test.tsx | Updates wizard mock output and adds an integration test ensuring merge preserves active. |
| ROADMAP.md | Updates documented test counts and notes about field preservation behavior. |
| @@ -177,6 +187,17 @@ export interface AppSchema extends BaseSchema { | |||
| */ | |||
| favicon?: string; | |||
|
|
|||
| /** | |||
| * Branding configuration | |||
| */ | |||
| branding?: BrandingConfig; | |||
|
|
|||
| /** | |||
| * Whether the application is active (visible in app switcher) | |||
| * @default true | |||
| */ | |||
| active?: boolean; | |||
|
|
|||
There was a problem hiding this comment.
The TypeScript AppSchema now includes label, icon, branding, and active, but the corresponding Zod validator (packages/types/src/zod/app.zod.ts → AppSchema) does not include these fields. Because Zod object schemas strip unknown keys by default, any code that validates/parses an AppSchema via Zod could silently drop these new fields again. Please update the Zod AppSchema to accept these properties (and ideally add a small Zod test case covering them) to keep runtime validation in sync with the TS interface.
Editing an app via the wizard and saving would silently drop
icon,label, andbrandingfields from the persistedAppSchema, causing the app to vanish from the sidebar and app switcher.Root cause
wizardDraftToAppSchema()only mappedtitle,logo,favicon,layout,navigation— omittingicon,label, andbranding.EditAppPagethen overwrote the full app config with this incomplete schema.Changes
packages/types/src/app.ts— Addicon,label,branding,activetoAppSchemainterface. Mapicon,label(fromtitle), andbrandinginwizardDraftToAppSchema().apps/console/src/pages/EditAppPage.tsx— Merge wizard output over original app config ({ ...appToEdit, ...appSchema }) so fields not managed by the wizard (e.g.active,actions,areas) are preserved.packages/types/src/__tests__/app-creation-types.test.ts— Add assertions foricon,label,brandinground-tripping; add edge cases for missing icon and sidebar/app-switcher display.apps/console/src/__tests__/app-creation-integration.test.tsx— Add integration test verifying EditAppPage merge preserves original app fields (active) while including wizard-generated fields (label,icon,branding). Updated mock wizardonCompleteto includeiconmatching real wizard behavior.Testing
wizardDraftToAppSchemafield mapping and edge casesOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.