feat(UI): Instant commands improvements#2550
feat(UI): Instant commands improvements#2550renefloor wants to merge 9 commits intofeat/design-refreshfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/stream_chat_flutter/lib/src/message_input/attachment_picker/options/stream_command_picker.dart (1)
17-73: Consider handling the empty commands case.When
channel.config?.commandsis null or empty, the widget renders an emptyListView. For better UX, consider showing a message or hiding the command picker tab entirely when no commands are available.💡 Optional: Add empty state handling
Widget build(BuildContext context) { final channel = StreamChannel.of(context).channel; final commands = channel.config?.commands ?? const []; + if (commands.isEmpty) { + return OptionDrawer( + margin: EdgeInsets.zero, + child: Center( + child: Text( + 'No commands available', + style: textTheme.body.copyWith(color: colorTheme.textLowEmphasis), + ), + ), + ); + } + final textTheme = StreamChatTheme.of(context).textTheme;Alternatively, filter out the command-picker tab in
tabbedAttachmentPickerBuilderwhen no commands are configured.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/stream_chat_flutter/lib/src/message_input/attachment_picker/options/stream_command_picker.dart` around lines 17 - 73, The current build uses commands = channel.config?.commands ?? const [] and always renders an OptionDrawer with a ListView.builder, which produces an empty list UI when there are no commands; update the StreamCommandPicker build logic to detect when commands is null or empty and show a friendly empty state (e.g., a centered Text using context.translations.noCommandsLabel) or return SizedBox.shrink()/hide the tab instead of the ListView; modify the OptionDrawer/ListView.builder usage (or the parent tabbedAttachmentPickerBuilder) to short-circuit when commands.isEmpty so the command picker is not shown with an empty list.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@packages/stream_chat_flutter/lib/src/autocomplete/stream_command_autocomplete_options.dart`:
- Around line 76-91: The SizedBox in the title Column is using width
(SizedBox(width: 8)) which has no effect for vertical spacing; update the child
between Text widgets in the Column to use SizedBox(height: 8) (or remove it if
no gap is needed) inside the title: Column block so the spacing between
command.name.sentenceCase and command.description is applied correctly in
StreamCommandAutocompleteOptions.
---
Nitpick comments:
In
`@packages/stream_chat_flutter/lib/src/message_input/attachment_picker/options/stream_command_picker.dart`:
- Around line 17-73: The current build uses commands = channel.config?.commands
?? const [] and always renders an OptionDrawer with a ListView.builder, which
produces an empty list UI when there are no commands; update the
StreamCommandPicker build logic to detect when commands is null or empty and
show a friendly empty state (e.g., a centered Text using
context.translations.noCommandsLabel) or return SizedBox.shrink()/hide the tab
instead of the ListView; modify the OptionDrawer/ListView.builder usage (or the
parent tabbedAttachmentPickerBuilder) to short-circuit when commands.isEmpty so
the command picker is not shown with an empty list.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 67f88a4c-766f-406d-886c-9ea326debc99
📒 Files selected for processing (8)
packages/stream_chat_flutter/lib/src/autocomplete/stream_autocomplete.dartpackages/stream_chat_flutter/lib/src/autocomplete/stream_command_autocomplete_options.dartpackages/stream_chat_flutter/lib/src/autocomplete/stream_mention_autocomplete_options.dartpackages/stream_chat_flutter/lib/src/message_input/attachment_picker/options/options.dartpackages/stream_chat_flutter/lib/src/message_input/attachment_picker/options/stream_command_icon.dartpackages/stream_chat_flutter/lib/src/message_input/attachment_picker/options/stream_command_picker.dartpackages/stream_chat_flutter/lib/src/message_input/attachment_picker/stream_attachment_picker.dartpackages/stream_chat_flutter/lib/src/message_input/stream_message_input.dart
packages/stream_chat_flutter/lib/src/autocomplete/stream_command_autocomplete_options.dart
Show resolved
Hide resolved
...stream_chat_flutter/lib/src/message_input/attachment_picker/options/stream_command_icon.dart
Outdated
Show resolved
Hide resolved
...stream_chat_flutter/lib/src/message_input/attachment_picker/options/stream_command_icon.dart
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feat/design-refresh #2550 +/- ##
=======================================================
- Coverage 64.63% 64.41% -0.22%
=======================================================
Files 426 428 +2
Lines 26098 26191 +93
=======================================================
+ Hits 16869 16872 +3
- Misses 9229 9319 +90 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Submit a pull request
Linear: FLU-412
CLA
Description of the pull request
This adds the instant commands to the attachment picker and updates the autocomplete UI
Screenshots / Videos
Summary by CodeRabbit
New Features
Improvements