Skip to content

Fix design system selection persistence#621

Merged
mrcfps merged 1 commit intonexu-io:mainfrom
Sid-Qin:codex/fix-design-system-project-create
May 6, 2026
Merged

Fix design system selection persistence#621
mrcfps merged 1 commit intonexu-io:mainfrom
Sid-Qin:codex/fix-design-system-project-create

Conversation

@Sid-Qin
Copy link
Copy Markdown
Contributor

@Sid-Qin Sid-Qin commented May 6, 2026

Summary

  • Default the New Project design-system picker to the configured default design system when that system exists in the catalog.
  • Preserve explicit user changes, including choosing None, instead of reapplying the default after interaction.
  • Keep image/video/audio project creation from inheriting a hidden design-system selection.

Root cause

The New Project panel received defaultDesignSystemId but initialized selectedDsIds to an empty array. As a result, structured project surfaces displayed None — freeform and created projects with designSystemId: null unless the user manually reselected a design system.

User impact

New prototype, deck, template, and other structured projects now visibly start with the configured default design system and persist that selection into project creation. Media surfaces remain design-system-free because their picker is hidden.

Testing

  • pnpm --filter @open-design/web test
  • pnpm --filter @open-design/web typecheck
  • pnpm --filter @open-design/web build
  • pnpm guard
  • pnpm typecheck
  • git diff --check

Closes #603

@lefarcen lefarcen self-requested a review May 6, 2026 03:57
@lefarcen lefarcen added the feature New feature or enhancement label May 6, 2026
Copy link
Copy Markdown
Contributor

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Sid-Qin! Thanks for this PR — the design system default logic is much clearer now. 👍

Found a couple of edge cases that could affect live-artifact projects and catalog changes while the panel is mounted. See inline below.

Comment thread apps/web/src/components/NewProjectPanel.tsx
Comment thread apps/web/src/components/NewProjectPanel.tsx
Copy link
Copy Markdown
Contributor

@mrcfps mrcfps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sid-Qin I reviewed the New Project panel changes for default design-system initialization, the touched-state behavior that preserves explicit user choices, the media-surface nulling path, and the new component/helper coverage. The implementation looks consistent with the PR goal, and the helper extraction plus tests make the behavior easier to maintain. Thanks for tightening up this project-creation flow — nice work! 🙌

Generated by Looper 0.5.6 · runner=reviewer · agent=opencode

@alchemistklk
Copy link
Copy Markdown
Contributor

@Sid-Qin Thanks for the update. Before this can be treated as merge-ready, please resolve all remaining review conversations on this PR.

There are still two unresolved threads in apps/web/src/components/NewProjectPanel.tsx:

  1. Live-artifact projects still skip design-system defaults because showDesignSystemPicker does not include live-artifact.
  2. Selected design-system IDs are not pruned/validated against the current designSystems catalog, so a stale hidden ID can still be submitted after catalog changes.

Please either address both points in code and then resolve the conversations, or reply in-thread if you believe a conversation should be closed without a code change.

@mrcfps mrcfps merged commit 4c82e48 into nexu-io:main May 6, 2026
1 check passed
@lefarcen
Copy link
Copy Markdown
Contributor

lefarcen commented May 6, 2026

Hi @Sid-Qin! 🎉

Thanks for your contribution — this PR has been merged and the design system selection persistence fix is now live.

The implementation now properly defaults the picker to the configured design system and preserves user choices across project creation.

Thanks for making open-design better!
— open-design team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selected design system is not persisting after the project is created.

4 participants