fix(cli): keep the workspace color when settings are synced from git (#11144)

* fix(cli): keep the workspace color when settings are synced from git

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(cli): name the sync direction consistently in the identity-field comments

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(cli): apply the workspace color from settings.yaml only when the file sets one

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-09-15 14:33:47 +00:00
committed by GitHub
co-authored by Claude Fable 5.1
parent 8b4f6220dc
commit 129c045595
4 changed files with 108 additions and 13 deletions
+13 -6
View File
@@ -214,9 +214,15 @@ export async function pushWorkspaceSettings(
}
// Exclude fields that are never applied here: slack_team_id/slack_name are OAuth-only,
// and name is not applied on pull (see below), so a name-only diff stays a no-op.
// and name is never applied (see below), so a name-only diff stays a no-op. color is
// applied only when the file carries it, so an unset one leaves the comparison too.
const { slack_team_id: _lst, slack_name: _lsn, name: _ln, ...comparableLocal } = localSettings;
const { slack_team_id: _rst, slack_name: _rsn, name: _rn, ...comparableRemote } = settings;
const colorManaged = localSettings.color != null;
if (!colorManaged) {
delete comparableLocal.color;
delete comparableRemote.color;
}
if (isSuperset(comparableLocal, comparableRemote)) {
log.debug(`Workspace settings are up to date`);
return;
@@ -351,10 +357,9 @@ export async function pushWorkspaceSettings(
});
}
// Workspace display name is intentionally not applied on pull: settings.yaml is shared
// across a repo's branches, so applying it would let one workspace's name overwrite
// another's when both sync the same repo. It stays in the file (written on push), but a
// live workspace is only renamed by its owner.
// Workspace display name is intentionally never applied by `sync push`: settings.yaml is
// shared across a repo's branches, so applying it would let one workspace's name overwrite
// another's when both sync the same repo. `sync pull` still records it.
if (localSettings.mute_critical_alerts != settings.mute_critical_alerts) {
log.debug(`Updating mute critical alerts...`);
@@ -366,7 +371,9 @@ export async function pushWorkspaceSettings(
});
}
if (localSettings.color != settings.color) {
// A color is applied only when the file carries one: `sync pull` omits the key for a
// workspace without a color, so an unset key means "not managed by git", never "clear".
if (colorManaged && localSettings.color != settings.color) {
log.debug(`Updating workspace color...`);
await wmill.changeWorkspaceColor({
workspace,