refactor(ui): unify conversation headers and split oversized widgets - #17
Merged
Merged
Conversation
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
This was referenced Sep 21, 2026
ForeverInLaw
force-pushed
the
simplify/core-split
branch
from
September 21, 2026 23:21
a85b855 to
66e4433
Compare
ForeverInLaw
force-pushed
the
simplify/ui-simplify
branch
2 times, most recently
from
September 21, 2026 23:42
7a12881 to
2178b6d
Compare
Behavior-preserving UI consolidation: - One shared ConversationAppBar now carries the AppBar skeleton all three conversation kinds repeated (rail-back leading, mobile search toggle, kebab menu with the attachments filter, peer-status button, desktop leave). group 302→223, dm 168→123, channel 94→35 lines; action order, tooltips, l10n, and Semantics trees byte-identical. - media_viewer 709→393 + media_viewer_stages.dart part (video/audio/ placeholder stages); attachment_card 468→321 + branches part file. Pure widget moves, zero tree changes. - onboard_menu 362→241 + part file for the leaf tiles; the two offer rows in org_section merged into one switch-driven row. - conversation_controller: exhaustive sealed-switch on the target types replaces if-chains; download/cancel attachment sites deduped; every method ≤50 LOC. - voice_composer/voice_message_card share formatVoiceClock and the waveform bucket helper instead of carrying two copies. No handwritten lib file over 400 LOC remains. flutter analyze clean, all 838 widget/unit tests pass.
Six review findings, each validated before fixing: - attachment thumbnail: base64Decode threw during build, escaping Image.memory's errorBuilder and killing the conversation render. Defensive decode now falls through to the broken-image fallback. - conversation header: kind headers reported kToolbarHeight (56) as preferredSize while drawing 54/70px toolbars; Scaffold clamped its slot to the reported height. A PreferredSize wrapper now re-reports the height the AppBar actually draws, rebuilt on breakpoint change. - voice message card: a play tapped during download only queued a file load, never playback. The card now queues the play itself and opens with play:false so the queue is the single autoplay source. - sessions rail: pull-to-refresh only re-read the DM list while the rail renders all kinds plus orgs; it now refreshes every slice (same envelope org_actions uses). - media viewer stages: unawaited player.open rejections escaped the initState try block as unhandled async errors; opens are now awaited inside the stage with a fallback-to-placeholder catch. - voice composer: manual stop, the auto-stop timer and discard could race the recorder teardown; a single-flight guard makes them mutually exclusive. Four focused regression tests added (thumbnail fallback, header slot height at both breakpoints, queued play flow, all-slices refresh). Gates: flutter analyze clean, dart format clean, flutter test 842 passed / 0 failed.
ForeverInLaw
force-pushed
the
simplify/ui-simplify
branch
from
September 22, 2026 01:33
2178b6d to
662f5a1
Compare
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.
User description
Problem
Three conversation headers repeated the same AppBar skeleton (rail-back leading, mobile search toggle, kebab menu, peer-status, leave); several widgets blew past the 400-line file budget (
media_viewer709,attachment_card468,onboard_menu362);conversation_controllerdrove 21 raw if-sites and three copies of the same attachment download/cancel flow.Change
ConversationAppBarcarries the skeleton; each kind passes its specifics. group 302→223, dm 168→123, channel 94→35 lines. Action order, tooltips, l10n, and Semantics trees are byte-identical.media_viewer709→393 + stages part file;attachment_card468→321 + branches part file. Pure widget moves.conversation_controller: exhaustive sealed-switch on the target types replaces if-chains; download/cancel deduped to one site; every method ≤50 LOC.onboard_menu362→241 + part file; org_section's two offer rows merged into one switch-driven row.voice_composer/voice_message_cardshareformatVoiceClockand the waveform bucket helper instead of two copies.No handwritten lib file over 400 LOC remains (generated bridge files exempt).
Verification
flutter analyzeclean, all 838 widget/unit tests passdart format lib testcleanStack: PR 4/6 (on #16).
CodeAnt-AI Description
Unify conversation headers and fix media, voice, invite, and session-rail behavior
What Changed
Impact
✅ Consistent conversation controls across DM, group, and channel screens✅ No clipped or misaligned conversation headers✅ Conversations survive invalid attachment thumbnails✅ Voice playback starts after downloads complete✅ Refreshes show current groups, channels, offers, and organizations💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.