fix(todo): comments handled as Todoist's, and the emoji sheet (ADR 0033, D38)

After the developer's recording of Todoist: the bar opens the comments to
write at once, Show all to read; the heading folds them; Show all and the
latest comment are boxes of their own; a comment shows who wrote it; the
field grows with what wraps, which a long line didn't.

The emoji sheet is written here on emoji_picker_flutter's data: its own
picker has a tab bar on the SDK's Material, which found no localizations
in Todo, so reacting showed an error. Todo gets the compatibility bridge,
as Learn has, since the editor still imports that library.

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-06 22:23:31 +01:00
commit c55e94dd99
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -1,4 +1,3 @@
import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart'
show PointerDeviceKind, kLongPressTimeout;
@ -607,7 +606,7 @@ void main() {
await openComments(tester);
await write(tester, 'First note');
await write(tester, 'Second note');
await tester.tap(find.byTooltip('Close').last);
await tester.tap(find.byKey(commentsBackKey));
await tester.pumpAndSettle();
expect(find.text('Comments 2'), findsOneWidget);
@ -647,8 +646,8 @@ void main() {
expect(find.text('Ask the nurse', findRichText: true), findsNothing);
});
testWidgets("a comment's menu offers every emoji, nothing picked "
'leaving it as it was', (tester) async {
testWidgets("a comment's menu offers the emoji, one picked showing on "
'it; leaving picks none', (tester) async {
await start(tester, usedBefore: true);
await openTask(tester);
await openComments(tester);
@ -658,8 +657,67 @@ void main() {
await tester.pumpAndSettle();
await tester.tap(find.text('Add a reaction'));
await tester.pumpAndSettle();
expect(find.text('Search emoji'), findsOneWidget);
expect(find.text('RECENTLY USED'), findsOneWidget);
expect(find.byType(EmojiPicker), findsOneWidget);
await tester.tap(find.text('👍'));
await tester.pumpAndSettle();
commentRows.bringRemoteChanges();
await tester.pumpAndSettle();
expect(find.text('👍 1'), findsOneWidget);
});
testWidgets('the search finds emoji by their names', (tester) async {
await start(tester, usedBefore: true);
await openTask(tester);
await openComments(tester);
await write(tester, 'Ask the vet');
await tester.tap(find.byTooltip('Comment menu'));
await tester.pumpAndSettle();
await tester.tap(find.text('Add a reaction'));
await tester.pumpAndSettle();
await tester.enterText(find.byType(TextField).last, 'rocket');
await tester.pumpAndSettle();
expect(find.text('🚀'), findsOneWidget);
expect(find.text('RECENTLY USED'), findsNothing);
});
testWidgets('the sheet opened by Show all keeps the keyboard closed, '
'the bar writing at once', (tester) async {
await start(tester, usedBefore: true);
await openTask(tester);
await openComments(tester);
await write(tester, 'First note');
await tester.tap(find.byKey(commentsBackKey));
await tester.pumpAndSettle();
await tester.tap(find.text('Show all'));
await tester.pumpAndSettle();
expect(find.byKey(commentSendKey), findsNothing);
});
testWidgets('the heading folds what shows of the comments', (
tester,
) async {
await start(tester, usedBefore: true);
await openTask(tester);
await openComments(tester);
await write(tester, 'First note');
await tester.tap(find.byKey(commentsBackKey));
await tester.pumpAndSettle();
expect(find.text('Show all'), findsOneWidget);
await tester.ensureVisible(find.byKey(previewHeadingKey));
await tester.pumpAndSettle();
await tester.tap(find.byKey(previewHeadingKey));
await tester.pumpAndSettle();
expect(find.text('Show all'), findsNothing);
expect(find.text('Comments 1'), findsOneWidget);
});
testWidgets('a reaction kept shows on its comment, and a tap takes it '
@ -4047,6 +4105,8 @@ void main() {
await tester.pumpAndSettle();
expect(find.text('Priority 1'), findsOneWidget);
await tester.ensureVisible(find.text('Add sub-task'));
await tester.pumpAndSettle();
await tester.tap(find.text('Add sub-task'));
await tester.pumpAndSettle();
await tester.enterText(find.byType(TextField).last, 'Socks');