Skip to content

fix: persist project edits for global/no-ID projects - #31736

Closed
sebaactis wants to merge 1 commit into
anomalyco:devfrom
sebaactis:dev
Closed

fix: persist project edits for global/no-ID projects#31736
sebaactis wants to merge 1 commit into
anomalyco:devfrom
sebaactis:dev

Conversation

@sebaactis

@sebaactis sebaactis commented Jun 10, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #31739

Type of change

  • Bug fix

What does this PR do?

Project edits (name, color, commands) made via the edit dialog don't persist for 'global' projects or projects without a server-side ID. The dialog closes without error, but re-opening shows the original values.

Root cause: When saving via the dialog, the icon color was never synced to the local store. Additionally, enrich() in the layout context always gave precedence to server-side metadata (which contained stale auto-assigned colors) over the local user edits stored in childStore.projectMeta.

Fix (two changes, 16 lines):

  1. dialog-edit-project.tsx: After project.update() to the server, also call project.meta() to sync the icon color to the local store.

  2. layout.tsx (enrich function): Merge childStore.projectMeta on top of server metadata so user edits from the dialog take precedence over stale auto-assigned values.

How did you verify your code works?

  • Built and ran the desktop app from source (Electron + Vite)
  • Opened a 'global' project (no server-side ID), changed its color via edit dialog, saved, re-opened dialog — change persisted
  • Same test with name change
  • Confirmed console showed the save taking the local path (project.id === 'global')
  • Tested with projects that have server-side IDs as well

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Two changes to fix project edits (name, color, commands) not persisting
for 'global' projects or projects without a server-side ID:

1. dialog-edit-project.tsx: After project.update() to the server, also
   call project.meta() to sync the icon color to the local store.
   Previously only the icon override was synced, not the color.

2. layout.tsx enrich(): Merge childStore.projectMeta on top of server
   metadata so user edits from the dialog take precedence over stale
   auto-assigned values. Without this, enriched() would read the old
   server-side icon.color (e.g. auto-assigned lime) and ignore the
   user's new choice (e.g. purple) stored in projectMeta.

Fixes: project color, name, and commands not saving via edit dialog
@sebaactis
sebaactis requested a review from Hona as a code owner June 10, 2026 17:49
Copilot AI review requested due to automatic review settings June 10, 2026 17:49
@sebaactis
sebaactis requested a review from Brendonovich as a code owner June 10, 2026 17:49
@github-actions github-actions Bot added needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Jun 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR ensures locally edited project metadata (e.g., from the edit dialog) takes precedence during layout metadata composition, and synchronizes icon color changes back to the server.

Changes:

  • Merge childStore.projectMeta on top of server/project metadata when composing the effective project object.
  • Persist edited icon color to the server via serverSync().project.meta(...) in the edit dialog.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/app/src/context/layout.tsx Prioritizes local projectMeta fields (name/icon/commands) when building the base project metadata.
packages/app/src/components/dialog-edit-project.tsx Syncs icon color changes to the server when saving from the edit dialog.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +430 to +431
icon: { ...base.icon, ...meta.icon },
commands: { ...base.commands, ...meta.commands },
Comment on lines 90 to +93
serverSync().project.icon(props.project.worktree, store.iconOverride || undefined)
serverSync().project.meta(props.project.worktree, {
icon: { color: store.color || undefined },
})
@github-actions github-actions Bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Jun 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@mHHwwgithub

Copy link
Copy Markdown

Hi maintainers @Hona @Brendonovich, this bug still exists in v1.16.2 (Windows 11). Project name, icon, and color edits are still not persisting after save/restart. This has been reported since Feb 2026 (#14465) and affects many users. The fix in this PR is only 16 lines - could we please get it reviewed and merged? Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: project edits (name, color, commands) don't persist for global/no-ID projects

3 participants