Repository navigation
feat: F2 chat UX — rendering, navigation, chat list - #8
Merged
Merged
Conversation
Messages are still plain UTF-8 on the wire, so any older client keeps reading them. A reply is the only case that needs structure: it carries a `whisperMsg: 3` text envelope with the quoted sender, timestamp and a preview, which keeps the quote readable after the original is deleted locally. Rendering moves from one linkified Text span to a small parser: bold, italic, strike, inline mono, fenced code blocks and spoilers that stay covered until tapped. Links open in the browser, phone numbers and addresses (`Street 12, City`) copy on tap. Emoji-only messages drop the bubble and read large, long messages fold behind "Show full". No new dependency. `LinkifiedText` goes away; `FormattedText` replaces it.
The message list is no longer reversed. Slivers group it by calendar day, so each day gets a pinned header that doubles as the date separator, and the "new messages" divider can be a real widget. The anchor is captured before the chat marks everything read, so a divider exists at all; opening the chat scrolls to it, which also gives "jump to first unread". With a normal axis the window has to be grown without moving the screen: both the local window and a fetched history page measure maxScrollExtent before and after and shift the offset by the delta. The chat still lands on the newest message at open, follows new messages while at the bottom, and re-anchors when the keyboard opens. Long-press now starts a multi-select (copy, forward, delete for me) and double-tap or a horizontal swipe quotes the message in the composer. The single-message sheet, which used to hang off the long-press, stays reachable from the selection bar while exactly one message is picked, so save/resend are not lost. Forwarding takes a list now.
The chat list only bolded a row when its newest message was unread, which hides a conversation that got a second unread message. Rows now carry the count of unread incoming messages, derived from the `read` flags in one pass over the message box, so no new state can drift from them. Pin and delete are swipe actions that always spring back: the gesture opens the action, it never removes a row on its own. Pin state is local only (the phase adds nothing to the server) and lives in a small `conversations` box keyed by the other side's id, which F2b can extend with archived/muted without a schema change. Pinned chats sort first, so the cache sorts once and the notifier keeps that order instead of sorting again by timestamp.
A phone number is something the user taps, so it now carries the same solid underline as a URL instead of a dotted one. Addresses keep their dotted underline: a tap only copies them. E-mail addresses were not detected at all, so they rendered as plain text. They are now one of the tappable entities (opening the mail client) and are underlined the same way.
The `Street 12, City` heuristic matched ordinary text ("Dnes 3 zprávy")
about as often as a real address, and copying an address on tap is not
worth that noise. Phone numbers and e-mails stay tappable.
"Zobrazit více" fits the bubble; the previous wording wrapped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
F2 — Chat UX (F2a), client only. Nothing in this PR touches the server or the API contract.
Extracted from Feature roadmap → F2. Deferred by agreement, to be picked up as F2b: search in chat history, global search with sender/date/type filters, jump to date, chat folders/filters.
What lands
Rendering
whisperMsg: 3text envelope carries the quoted sender, timestamp and a 160-char preview. Plain messages stay raw UTF-8, so an older client still reads them.**bold**,*italic*,~~strike~~, inline mono, fenced code blocks,||spoiler||(tap to reveal).Street 12, Cityaddresses copy on tap.Navigation
Chat list
readflags in one pass (no new state that can drift).conversationsHive box keyed by peer id (F2b can extend it with archived/muted).Notes
LinkifiedTextis replaced byFormattedText.PrivateMessagegains Hive fields 16–18 (quoted sender/timestamp/preview); the adapter was regenerated withbuild_runner.maxScrollExtent, and the chat re-anchors on new messages and on keyboard open.CHANGELOG.md(release notes are generated frompubspec.yaml), so the phase entry is this description rather than a file.Verification
flutter analyze --no-fatal-infos: no errors, no warnings (only pre-existing infos inregister_page/settings_page).flutter test: 122/122 pass, including newmessage_format_test,text_envelope_test,chat_bubble_testandconversation_meta_test.