feat(todo): quick add's keys, sub-projects' colours, a task's menu on a right click, and the completed tasks deleted at once

The developer's list of 9 Nov 2026, Todo's part:

- Quick add: the down arrow and Tab move into the description, with its
  cursor (halkyon_editor's fix); Escape closes the projects or labels
  suggested first, then closes quick add, what was typed discarded; the
  project's chip shows the project's colour.
- A project without a colour of its own shows its parent's, the nearest
  ancestor's with one (colorOfProject, TodoCubit.colorOf), wherever a
  project's colour shows; the project editor's "Same colour as its parent"
  keeps it so, and the parent picker shows each project in its colour. A
  project of its own always has one.
- The task pane's x closes it, always; Close left the ⋮ menu.
- A task's row opens its menu on a right click: Mark as done, Date, Move
  to, Labels, Priority, Deadline, Duplicate and Delete, the selection's
  actions for that one task.
- Delete completed tasks, in the ⋮ of the Inbox, Today, Upcoming and a
  project, with Undo: the tasks leave the list at once and are deleted
  once the snack bar goes without its Undo (halkyon_ui's showUndoSnackBar
  gains onKept).

Whats-New: Quick add: the arrow keys and Tab reach the description, and Escape closes it without saving.
Whats-New-De: Schnell hinzufügen: Pfeiltasten und Tab erreichen die Beschreibung, und Escape schließt es, ohne zu speichern.
Whats-New: Sub-projects take their parent's colour unless they have their own.
Whats-New-De: Unterprojekte übernehmen die Farbe ihres übergeordneten Projekts, wenn sie keine eigene haben.
Whats-New: A right click on a task opens its menu, with Move to and more; Delete completed tasks clears a list, with Undo.
Whats-New-De: Ein Rechtsklick auf eine Aufgabe öffnet ihr Menü, mit Verschieben nach und mehr; Erledigte Aufgaben löschen räumt eine Liste auf, mit Rückgängig.
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-09 23:12:43 +01:00
commit 9e1442d89e
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
2 changed files with 810 additions and 78 deletions

View file

@ -2,6 +2,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:halkyon_todo_flutter/src/feature/project/model/project.dart';
import 'package:halkyon_todo_flutter/src/feature/project/model/project_tree.dart';
import 'package:halkyon_todo_flutter/src/feature/project/model/stored_project.dart';
import 'package:halkyon_ui/halkyon_ui.dart';
/// Sub-projects (ADR 0033, D28): Browse lists each under its parent, and a
/// project is never moved under itself or a project below it.
@ -63,4 +64,38 @@ void main() {
['Home', 'Garden', 'Beds', 'Kitchen', 'Work'],
);
});
group('Given sub-projects without a colour of their own (inheriting, as '
"Learn's sub-studysets; the developer's review, 9 Nov 2026),", () {
StoredProject coloured(String id, PaletteColor? color, {String? parent}) =>
StoredProject(
id,
ProjectContent(name: id, color: color, parentId: parent),
);
final family = [
coloured('Home', PaletteColor.fern),
coloured('Garden', null, parent: 'Home'),
coloured('Beds', null, parent: 'Garden'),
coloured('Kitchen', PaletteColor.carrot, parent: 'Home'),
coloured('Plain', null),
coloured('A', null, parent: 'B'),
coloured('B', null, parent: 'A'),
];
test("then each shows its nearest ancestor's colour, at any depth.", () {
expect(colorOfProject(family, 'Garden'), PaletteColor.fern);
expect(colorOfProject(family, 'Beds'), PaletteColor.fern);
});
test("then a colour of its own wins over its parent's.", () {
expect(colorOfProject(family, 'Kitchen'), PaletteColor.carrot);
});
test('then a project of its own without one, a circle of parents and '
"an unknown project show the theme's (none).", () {
expect(colorOfProject(family, 'Plain'), isNull);
expect(colorOfProject(family, 'A'), isNull);
expect(colorOfProject(family, 'missing'), isNull);
});
});
}

View file

@ -174,4 +174,46 @@ void main() {
['other'],
);
});
group('Given done and open tasks (Delete completed tasks; the '
"developer's review, 9 Nov 2026),", () {
final tasks = [
task('open'),
task('done', completed: true),
task('done sub', parent: 'open', completed: true),
task('done elsewhere', project: 'work', completed: true),
task('done today', project: 'work', day: today, completed: true),
task('done yesterday', day: today.plus(-1), completed: true),
task('done next week', day: today.plus(7), completed: true),
task('open today', day: today),
];
List<String> ids(List<OpenTask> found) => [
for (final task in found) task.id,
];
test("then a project's are its done tasks, sub-tasks too.", () {
expect(
ids(completedIn(tasks, projectId: 'inbox')),
unorderedEquals([
'done',
'done sub',
'done yesterday',
'done next week',
]),
);
});
test("then Today's are the done tasks dated today.", () {
expect(ids(completedIn(tasks, from: today, until: today)), [
'done today',
]);
});
test("then Upcoming's are the done tasks dated from today on.", () {
expect(
ids(completedIn(tasks, from: today)),
unorderedEquals(['done today', 'done next week']),
);
});
});
}