Skip to content

feat(search): avatar and a language-aware date on each hit - #12

Merged
jsfraz merged 1 commit into
developmentfrom
feature/search-result-row
Nov 17, 2026
Merged

jsfraz merged 1 commit into
developmentfrom
feature/search-result-row

Conversation

@jsfraz

@jsfraz jsfraz commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Search results now lead with the peer's avatar (same letter avatar as the chat list) and the date line uses the chat list label instead of a raw MMM d HH:mm.

Underneath that, dates were never language-aware: intl's date data was never initialized, so every DateFormat ran in English regardless of the app language, and any explicit locale (as in devices_page) would have thrown.

  • Date patterns and month names are loaded for en and cs at startup.
  • Intl.defaultLocale follows the selected language, so chat rows, bubbles, sticky day headers, the search results and the device list all match the UI language.
  • The chat-list date label moved to lib/utils/chat_date.dart and is shared by the chat list and the search results; the pure helper takes the localized "Today"/"Yesterday" labels and a testable now.
  • New chat_date_test covers the five branches.

Verification: flutter analyze --no-fatal-infos clean (5 pre-existing infos elsewhere), flutter test 140/140. Not verified on a device.

A result row was text and a raw "MMM d HH:mm", which reads foreign in a
Czech UI and gives no anchor to the conversation. It now leads with the
peer's avatar, like the chat list, and the date line is the chat list
label: Today, Yesterday, then the weekday, then the date.

That label was a private method on the chat list item, so it moved to
`chatDateLabel` and both call sites use it. It also had one real bug
behind it: nothing initialized the intl date data, so every DateFormat
ran in English whatever the app language was, and any explicit locale
(`devices_page` passes one) would throw. Date patterns and month names
are now loaded for en and cs at startup, and `Intl.defaultLocale`
follows the selected language, so rows, bubbles, day headers and the
device list all speak the same language as the rest of the UI.
@jsfraz
jsfraz merged commit fe8281e into development Nov 17, 2026
1 check passed
@jsfraz
jsfraz deleted the feature/search-result-row branch November 17, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant