Skip to content

feat: F2b chat search, jump to date, chat list filters - #9

Merged
jsfraz merged 3 commits into
developmentfrom
feature/f2b-search
Nov 17, 2026
Merged

jsfraz merged 3 commits into
developmentfrom
feature/f2b-search

Conversation

@jsfraz

@jsfraz jsfraz commented Nov 17, 2026

Copy link
Copy Markdown
Owner

F2b — search, jump to date and chat list filters. Client only, no contract change.

Stacked on #8. This branch is cut from feature/f2-chat-ux because it reuses the F2a jump/scroll machinery, the pin store and the unread counts. Retarget to development once #8 is merged.

What lands

Search

  • Global search from the Home app bar and per-chat search from the chat "⋯" menu.
  • Local scan of the message box — messages are stored decrypted, so nothing leaves the device and there is no second index to drift. 250 ms debounce, hard cap of 300 hits.
  • Queries match the message text (case-insensitive substring) and the file name of an attachment.
  • Filters: conversation (the sender — the peer in a 1:1 chat), media type (album matches when any attachment does), and an inclusive date range. Tapping an active date chip clears it.
  • Results are newest first with a window of text around the match; the found term is highlighted.
  • Tapping a hit in a chat returns its timestamp and the chat jumps there; a global hit opens the conversation at that message (ChatPage(jumpTo:)).
  • Diacritics are not folded (hledat does not find hľadať).

Jump to date

  • Chat "⋯" menu → date picker → first message of that day (or the first one after it), with a toast when the conversation has nothing that recent.
  • stepRoute is generic now so a page can return a value.

Chat list folders

  • Chips above the list: All / Unread / Pinned, in memory only.
  • The roadmap asks for unread + favourites; favourites arrive with contacts in F7, so pinned stands in and the chips gain a fourth entry then.

Also in this branch (fixes to F2a, committed first)

  • 5197581 street-address detection removed — the heuristic matched ordinary text ("Dnes 3 zprávy") as often as a real address.
  • ddd51e0 shorter fold label ("Zobrazit více").

Verification

  • flutter analyze --no-fatal-infos: no errors, no warnings (only the 5 pre-existing infos in register_page/settings_page).
  • flutter test: 139/139 pass, including the new message_search_test (matching, scope, date bounds, types, albums, ordering cap, snippet window, highlight splitting).
  • Not verified on a device: the search page layout, the date pickers and the filter chips were not exercised in a running build.

@jsfraz
jsfraz changed the base branch from feature/f2-chat-ux to development November 17, 2026 22:18
Messages are stored decrypted, so the search is a local scan of the
message box: the query never reaches the server and there is no second
index that could drift from what is on disk. A 250 ms debounce and a hard
cap of 300 hits keep a one-letter query from walking the whole history
into the list.

Filters: conversation (the sender, which is the peer in a 1:1 chat),
media type (an album matches when any attachment does), and a date range
whose ends are inclusive. Results are newest first with a window of text
around the match; the found term is highlighted, so a hit is obvious even
when the match sits inside formatting markers.

The page is reachable globally from Home and scoped from a chat; the
scoped version returns the picked timestamp instead of opening a page.
The chat app bar gets a menu with "search in this chat" and "jump to
date". Both end in the same jump: the window is widened until the target
is rendered and `Scrollable.ensureVisible` moves to it, which already
backs the reply quote.

A picked day lands on the first message of that day (or the first one
after it), with a toast when the conversation has nothing that recent. A
search hit returns its timestamp from the scoped search page, and a
global hit opens the chat with `jumpTo`, so the result is where the
search said it is.

`stepRoute` is generic now, so it can return a value from the page it
opens.
Folder chips above the chat list: everything, unread, pinned. The filter
lives in memory only, so it cannot go stale against the messages.

The roadmap asks for unread and favourites; favourites arrive with
contacts in F7, so pinned conversations stand in for them and the chips
grow a fourth entry then. No new storage: the counts and the pin set the
list already loads drive the filter.
@jsfraz
jsfraz force-pushed the feature/f2b-search branch from 45d43ce to 4e28dda Compare November 17, 2026 22:18
@jsfraz
jsfraz merged commit 6c92665 into development Nov 17, 2026
1 check passed
@jsfraz
jsfraz deleted the feature/f2b-search branch November 17, 2026 22:20
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