refactor(client): adopt EmptyState at inline empty-state sites#1114
Open
NC1107 wants to merge 1 commit into
Open
refactor(client): adopt EmptyState at inline empty-state sites#1114NC1107 wants to merge 1 commit into
NC1107 wants to merge 1 commit into
Conversation
Replace the bespoke Center > Column > Icon + Text placeholders in the new-message composer and the create-group member picker with the shared EmptyState widget so future tweaks (badge size, copy treatment) only need to change one widget. Loosens EmptyState.body to optional so the new-message dropdown can keep its title-only layout. Refs #1100
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.
Summary
The componentization audit (2026-05-22) listed 11+ sites where inline
Center > Column > Icon + Textempty-state trees should be migrated to the canonicalEmptyStatewidget inapps/client/lib/src/widgets/empty_state.dart. After auditing each site, two needed migration; the rest were already migrated or are intentionally compact placeholders that wouldn't fit the illustrated EmptyState's 64 px badge.Refs #1100.
Migrated
apps/client/lib/src/screens/new_message_screen.dart:558— the autocomplete empty-state in the chip-based new-message composer. Title varies by query (No contacts yetvsNo contacts match "$_query"), no body. Replaced the bespokeCenter > Padding > Column > Icon + TextwithEmptyState(icon: Icons.person_search_outlined, title: ...).apps/client/lib/src/screens/create_group_screen.dart:272— the contacts-list empty-state in the create-group member picker. Previous text was'No contacts available.\nAdd contacts first.'split across two visual lines; now title =No contacts available., body =Add contacts first., icon =Icons.person_outlineto match the contacts-screen empty-state. (The original pattern had no icon — adding one is unavoidable becauseEmptyStaterequires it. Picked the icon already used on the sibling contacts screen for consistency.)EmptyState API tweak
EmptyState.bodyis now optional (String?instead ofrequired String). The new-message composer empty-state has only a title in its dropdown, and forcing callers to invent body copy just to satisfy the signature would be worse than allowing the title-only layout. Whenbodyis null the body text and its 8 px gap are skipped; all existing call sites pass a body and render unchanged.Skipped (with reasons)
apps/client/lib/src/screens/contacts_screen.dart:538— already usesEmptyState(no migration needed).apps/client/lib/src/screens/admin/admin_dashboard_screen.dart:101— already usesEmptyState.apps/client/lib/src/screens/discover_groups_screen.dart:486— already usesEmptyState.apps/client/lib/src/screens/home_screen/parts/listeners.dart:110— already usesEmptyState.apps/client/lib/src/screens/saved_messages_screen.dart:72— already usesEmptyState.apps/client/lib/src/widgets/quick_switcher_overlay.dart:244— singleText('No results')inside the cmd-K overlay's result-list area. The overlay is intentionally tight (~480 px wide, list flexes to remaining space); a 64 px illustrated badge would dominate the surface and feel like a different component. Kept as a compact inline placeholder.apps/client/lib/src/widgets/emoji_picker_config.dart:32— thenoRecentsslot of the third-partyemoji_picker_flutterConfig. Plugin expects a small inline widget for the recents tab; an illustratedEmptyStatewould be out of scale and visually break the tab. Kept as a smallText.apps/client/lib/src/screens/voice_lounge/participant_grid.dart:76—_buildPlaceholderis a shared helper also used for the transient'Connecting to voice...'message and for narrow compact-grid layouts. Migrating only the empty case would fork the helper, andEmptyState's badge is the wrong scale for the compact voice-grid tile. Kept as a compact centered text.apps/client/lib/src/widgets/channel_bar.dart:190—_channelStatusLabelreturns aStringfor the channel-bar status row (loading vs empty); it isn't a widget tree at all. Not an empty-state surface in the widget sense.apps/client/lib/src/widgets/channel_bar.dart:1141— a single italicisedText('No one in voice yet')inside the voice-channel peek popover (small floating panel anchored to a channel row). An illustratedEmptyStatewould balloon the popover. Kept as inline copy.Test plan
dart formaton the three changed filesflutter analyze --fatal-infoson the three changed files — no issuesflutter test test/screens/new_message_screen_test.dart test/widgets/create_group_screen_test.dart— 9/9 passflutter test test/screens/home_screen_test.dart test/screens/admin/admin_dashboard_screen_test.dart— 23/23 pass (verifies thebody-optional change doesn't break existingEmptyStatecallers)