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:
parent
33917c6042
commit
b043d5ef9e
2 changed files with 38 additions and 5 deletions
|
|
@ -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,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1918,6 +1918,37 @@ void main() {
|
|||
expect(await tester.runAsync(() => tasks().all()), isEmpty);
|
||||
});
|
||||
|
||||
testWidgets("editing a project keeps its Display (the developer's "
|
||||
'review, 4 Nov 2026)', (tester) async {
|
||||
await start(tester, usedBefore: true);
|
||||
final projects = ProjectRepository(projectRows, keys);
|
||||
await tester.runAsync(
|
||||
() => projects.save(
|
||||
const ProjectContent(
|
||||
name: 'Garden',
|
||||
view: ProjectView(layout: ProjectLayout.board),
|
||||
),
|
||||
),
|
||||
);
|
||||
projectRows.bringRemoteChanges();
|
||||
await goTab(tester, 'Browse');
|
||||
await tester.tap(find.text('Garden'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.tap(find.byTooltip('More'));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Edit project'));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.enterText(find.byType(TextField).first, 'Yard');
|
||||
await tester.tap(find.text('Save'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final stored = await tester.runAsync(projects.all);
|
||||
final yard = stored!.singleWhere((p) => !p.inbox).content;
|
||||
expect(yard?.name, 'Yard');
|
||||
expect(yard?.view, const ProjectView(layout: ProjectLayout.board));
|
||||
});
|
||||
|
||||
testWidgets("a project's screen washes in its own colour, as a "
|
||||
"studyset's in Learn; one without keeps Todo's strawberry", (
|
||||
tester,
|
||||
|
|
|
|||
Loading…
Reference in a new issue