Skip to content

feat(UI): Instant commands improvements#2550

Open
renefloor wants to merge 9 commits intofeat/design-refreshfrom
feature/commands-attachment
Open

feat(UI): Instant commands improvements#2550
renefloor wants to merge 9 commits intofeat/design-refreshfrom
feature/commands-attachment

Conversation

@renefloor
Copy link
Contributor

@renefloor renefloor commented Mar 19, 2026

Submit a pull request

Linear: FLU-412

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

This adds the instant commands to the attachment picker and updates the autocomplete UI

Screenshots / Videos

Before After
image image
image image
image

Summary by CodeRabbit

  • New Features

    • Added a command picker to the attachment menu for quick access to instant commands.
    • Introduced autocomplete styling options with fixed and floating presentation modes.
    • Enhanced autocomplete overlays with configurable elevation, margins, and border styling.
  • Improvements

    • Redesigned command and mention autocomplete layouts with improved visual hierarchy and spacing.
    • Updated command display to include descriptions for better context.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8df15a6d-4f5b-4c3b-8031-471e8cdbaa4a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/commands-attachment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?.commands is null or empty, the widget renders an empty ListView. 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 tabbedAttachmentPickerBuilder when 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1acb695 and 8d56d3a.

📒 Files selected for processing (8)
  • packages/stream_chat_flutter/lib/src/autocomplete/stream_autocomplete.dart
  • packages/stream_chat_flutter/lib/src/autocomplete/stream_command_autocomplete_options.dart
  • packages/stream_chat_flutter/lib/src/autocomplete/stream_mention_autocomplete_options.dart
  • packages/stream_chat_flutter/lib/src/message_input/attachment_picker/options/options.dart
  • packages/stream_chat_flutter/lib/src/message_input/attachment_picker/options/stream_command_icon.dart
  • packages/stream_chat_flutter/lib/src/message_input/attachment_picker/options/stream_command_picker.dart
  • packages/stream_chat_flutter/lib/src/message_input/attachment_picker/stream_attachment_picker.dart
  • packages/stream_chat_flutter/lib/src/message_input/stream_message_input.dart

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 5.07246% with 131 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.41%. Comparing base (1acb695) to head (61a32d5).
⚠️ Report is 3 commits behind head on feat/design-refresh.

Files with missing lines Patch % Lines
...tachment_picker/options/stream_command_picker.dart 0.00% 36 Missing ⚠️
...ocomplete/stream_mention_autocomplete_options.dart 0.00% 22 Missing ⚠️
...ocomplete/stream_command_autocomplete_options.dart 0.00% 21 Missing ⚠️
...tter/lib/src/autocomplete/stream_autocomplete.dart 9.09% 20 Missing ⚠️
...er/lib/src/message_input/stream_message_input.dart 0.00% 17 Missing ⚠️
...attachment_picker/options/stream_command_icon.dart 0.00% 14 Missing ⚠️
...ut/attachment_picker/stream_attachment_picker.dart 80.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants