feat(editor): settings both sides changed on the server ask before anything is overwritten
BRIEF §14.5 asks for an explicit conflict prompt when both sides changed. A save of a server sequence that meets settings someone changed to other values on the server now stops (the change stays pending) and the editor asks: Keep mine saves the editor's values over the server's, Take server (the safe default) shows the server's values as one undoable step, so Ctrl+Z brings the editor's back. Both first take in what only the server changed. Settings changed on one side only still merge silently; a reload after an analysis never merges over a conflicting pending change. The Export "Sync" box moves under Save to so neither is cut in longer languages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
13 files changed
+311
-32
No files matched your search
@@ -157,12 +157,20 @@ public static class SyncText
|
||||
/// What differs, one line per setting or sequence field in project order ("Deflicker window 41 here, 33 on the
|
||||
/// server", "Tags differ"), at most <paramref name="max"/>.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<string> Conflict(SyncEntry entry, int max)
|
||||
public static IReadOnlyList<string> Conflict(SyncEntry entry, int max) => entry is { Local: { } local, Link.ConflictRemote: { } theirs }
|
||||
? Differences(SyncRules.Differences(SyncPayload.Of(local), theirs, 64), max)
|
||||
: [];
|
||||
|
||||
/// <summary>
|
||||
/// One line per setting or sequence field among <paramref name="differences"/> ("Deflicker window 41 here, 33 on the
|
||||
/// server", "Tags differ"), at most <paramref name="max"/>; the editor's settings conflicts read the same.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<string> Differences(IEnumerable<SettingsDifference> differences, int max)
|
||||
{
|
||||
if (entry is not { Local: { } local, Link.ConflictRemote: { } theirs }) return [];
|
||||
ArgumentNullException.ThrowIfNull(differences);
|
||||
var lines = new List<string>();
|
||||
var shown = new HashSet<string>(StringComparer.Ordinal);
|
||||
foreach (var difference in SyncRules.Differences(SyncPayload.Of(local), theirs, 64))
|
||||
foreach (var difference in differences)
|
||||
{
|
||||
var (key, field) = Setting(difference.Path);
|
||||
if (!shown.Add(key)) continue;
|
||||
|
||||
Reference in new issue
Block a user