fix(search): sort search results by received date descending #520

Merged
guettlibot merged 6 commits from issue-509-fix-search-result-sorting into main 2026-06-07 02:24:25 +00:00
6 Commits
Author SHA1 Message Date
Thomas SharedInboxandClaude Sonnet 4.6 6c96bd97f3 fix(tests): suppress ink_sparkle shader crash in crash screen and about screen
CrashScreen creates its own MaterialApp which was loading InkSparkle
on first tap. Also fixes about_screen_test._buildScreen to use a
themed MaterialApp with NoSplash.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 04:03:30 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 2bc24887dc fix(tests): suppress ink_sparkle shader crash in software rendering
Integration tests under software rendering (LIBGL_ALWAYS_SOFTWARE=1)
crash with an INVALID_ARGUMENT error when the Material 3 ink_sparkle
ripple shader is compiled. Disable it via splashFactory: NoSplash.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 04:00:07 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 cf2bfa383b fix(search): fix _toFtsQuery to split on non-word chars instead of stripping
The old implementation stripped non-word chars within tokens, causing
'searchable-{timestamp}' to become 'searchable{timestamp}*'. FTS5
tokenizes on hyphens so the merged token never matched.

Fix: split on [^\w]+ so each FTS token is queried separately.

Also add timeout: Timeout.none to chaos_monkey_test to prevent Dart's
30s default timeout from killing the 60s+ test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 03:55:35 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 a438d80e67 fix(ci): fix YAML parse errors in deploy, firebase-tests, website workflows
The multi-line python3 -c blocks had unindented Python code that
terminated YAML block scalars. Inline as one-liners.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 03:50:48 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 cc88491cec fix(ci): fix YAML parse error in Print runner wait time step
The multi-line python3 -c block had unindented Python code that
terminated the YAML block scalar, causing a preExecutionError on every
CI run. Inline the Python as a one-liner.

Also apply dart format to email_repository_impl.dart and fix
avoid_redundant_argument_values lint in email_repository_impl_test.dart.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 03:36:13 +02:00
guettlibotandClaude Sonnet 4.6 55e731ade9 fix(search): sort search results by received date descending
Previously searchEmails and searchEmailsGlobal used FTS5's `ORDER BY
rank` (relevance ordering), making results appear in a seemingly random
order rather than newest-first like the normal email list view. After
merging the FTS results with note-search results the combined list was
also never re-sorted.

Change the SQL to ORDER BY e.received_at DESC and add an in-memory sort
on the merged list so the final result is always newest-first,
consistent with the rest of the app.

Closes #509

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 00:56:35 +00:00