fix(todo): editing a project keeps its Display

Edit project built the project anew from its name, colour and position,
so saving it reset its Display (layout, grouping, sorting, filters) to
the first one. It now changes the name and colour of the project as it
is.

Whats-New: Editing a project no longer resets its Display.
Whats-New-De: Ein Projekt zu bearbeiten setzt seine Anzeige nicht mehr zurück.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-04 20:36:00 +01:00
commit b043d5ef9e
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -19,11 +19,13 @@ Future<ProjectContent?> editProject(
color: current?.color ?? PaletteColor.cobalt,
);
return switch (named) {
(:final name, :final color) => ProjectContent(
name: name,
color: color,
position: current?.position ?? 0,
),
// The rest kept as it is: building it anew had reset the project's
// Display (the developer's review, 4 Nov 2026).
(:final name, :final color) =>
(current ?? ProjectContent(name: name)).copyWith(
name: name,
color: () => color,
),
null => null,
};
}