Skip to content

[Scribe] Add toolbar with copy and retry action#4310

Open
zatteo wants to merge 2 commits intofeat/scribe-tabletfrom
feat/scribe-toolbar
Open

[Scribe] Add toolbar with copy and retry action#4310
zatteo wants to merge 2 commits intofeat/scribe-tabletfrom
feat/scribe-toolbar

Conversation

@zatteo
Copy link
Member

@zatteo zatteo commented Feb 4, 2026

Demo

Screen.Recording.2026-02-04.at.15.24.10.mov
Screen.Recording.2026-02-04.at.15.34.34.mov

Summary by CodeRabbit

  • New Features

    • Added a toolbar to the suggestion success interface featuring copy and retry action buttons.
    • Expanded multilingual support with new "copy" and "retry" action labels across Arabic, German, English, French, Italian, Russian, and Vietnamese.
  • Style

    • Updated internal icon styling for consistency.

To be able to reuse this color without loosing a correct semantic name.
@zatteo zatteo requested a review from dab246 February 4, 2026 14:40
@zatteo zatteo requested a review from hoangdat February 4, 2026 14:40
@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 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.

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

  • 🔍 Trigger a full review

Walkthrough

This PR adds a new suggestion success toolbar widget to the AI Scribe module with copy and retry functionality. It includes the new widget export in the public API, introduces localization entries for "copy" and "retry" across multiple languages (Arabic, German, English, French, Italian, Russian, Vietnamese), adds corresponding localization getters in ScribeLocalizations, and updates the suggestion success widget hierarchy to propagate a new onLoadSuggestion callback. Additionally, it renames AIScribeColors.bottomsheetIcon to secondaryIcon and updates related usage in mobile actions.

Possibly related PRs

Suggested labels

feature, ai-scribe, localization, ui

Suggested reviewers

  • hoangdat
  • dab246
  • tddang-linagora
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[Scribe] Add toolbar with copy and retry action' directly and accurately describes the main changes: adding a toolbar widget with copy and retry functionality to the Scribe suggestion UI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/scribe-toolbar

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.

@zatteo zatteo changed the base branch from master to feat/scribe-tablet February 4, 2026 14:40
@zatteo
Copy link
Member Author

zatteo commented Feb 4, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@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

🤖 Fix all issues with AI agents
In
`@scribe/lib/scribe/ai/presentation/widgets/modal/suggestion/ai_scribe_suggestion_success_list_actions.dart`:
- Around line 32-38: The project uses the Row.spacing property (seen in
AiScribeSuggestionSuccessListActions where a Row with spacing: 8 is used), which
requires Flutter 3.10+, so update pubspec.yaml environment to include a Flutter
SDK constraint (for example flutter: ">=3.10.0") alongside the existing dart SDK
constraint to ensure the code compiles with the required Flutter version.
🧹 Nitpick comments (1)
scribe/lib/scribe/ai/presentation/utils/modal/ai_scribe_suggestion_state_mixin.dart (1)

101-111: Guard against overlapping retries to avoid stale suggestions.

With the retry action now wired to loadSuggestion (Line 110), rapid taps can trigger concurrent requests and allow a slower response to overwrite the latest result. Consider serializing or tracking the latest request and ignoring stale responses (or disabling retry while loading).

♻️ Suggested guard against stale responses
 class AiScribeSuggestionStateMixin<T extends StatefulWidget> on State<T> {
+  int _loadRequestId = 0;
   GenerateAITextInteractor? get interactor => _interactor;
   GenerateAITextInteractor? _interactor;
@@
   Future<void> loadSuggestion() async {
+    final requestId = ++_loadRequestId;
     _suggestionState.value = dartz.Right(GenerateAITextLoading());
@@
-    if (!mounted) return;
+    if (!mounted || requestId != _loadRequestId) return;

Comment on lines +32 to +38
return Column(
children: [
if (hasContent)
Flexible(
child: Container(
constraints: const BoxConstraints(minWidth: 67),
height: 36,
child: ConfirmDialogButton(
label: AiScribeSuggestionActions.replace.getLabel(localizations),
textColor: AppColor.primaryMain,
onTapAction: () {
Navigator.of(context).pop();
onSelectAction(
AiScribeSuggestionActions.replace,
suggestionText,
);
},
AiScribeSuggestionSuccessToolbar(suggestionText: suggestionText, onLoadSuggestion: onLoadSuggestion, imagePaths: imagePaths),
Row(
mainAxisAlignment: MainAxisAlignment.end,
spacing: 8,
children: [
Copy link

@coderabbitai coderabbitai bot Feb 4, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check Flutter version constraints in pubspec.yaml files

echo "=== Checking Flutter version constraints ==="
fd -t f 'pubspec.yaml' --exec cat {} \; 2>/dev/null | grep -A 10 'environment:' | head -30

Repository: linagora/tmail-flutter

Length of output: 530


🏁 Script executed:

#!/bin/bash
# Find and read the main pubspec.yaml file
echo "=== Finding pubspec.yaml files ==="
fd -t f 'pubspec.yaml' | head -5

echo -e "\n=== Reading main pubspec.yaml ==="
cat pubspec.yaml 2>/dev/null || echo "Not in root"

echo -e "\n=== Searching for flutter: version constraint ==="
rg -A 5 'flutter:' pubspec.yaml 2>/dev/null | head -30

Repository: linagora/tmail-flutter

Length of output: 10521


Add explicit Flutter version constraint to pubspec.yaml.

The code uses the spacing property on Row (Flutter 3.10+), but pubspec.yaml does not specify a minimum Flutter version. Currently, only the Dart SDK is constrained (>=3.0.0 <4.0.0). Add an explicit Flutter version requirement to ensure compatibility:

environment:
  sdk: ">=3.0.0 <4.0.0"
  flutter: ">=3.10.0"
🤖 Prompt for AI Agents
In
`@scribe/lib/scribe/ai/presentation/widgets/modal/suggestion/ai_scribe_suggestion_success_list_actions.dart`
around lines 32 - 38, The project uses the Row.spacing property (seen in
AiScribeSuggestionSuccessListActions where a Row with spacing: 8 is used), which
requires Flutter 3.10+, so update pubspec.yaml environment to include a Flutter
SDK constraint (for example flutter: ">=3.10.0") alongside the existing dart SDK
constraint to ensure the code compiles with the required Flutter version.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is it relevant? @dab246 @hoangdat

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Member

Choose a reason for hiding this comment

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

It simply warns us to avoid runtime errors when running our project on a Flutter version below 3.10 using spacing in Row/Column. IMO, you can ignore it for now; we'll update it fully when we upgrade to a newer Flutter version.

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

This PR has been deployed to https://linagora.github.io/tmail-flutter/4310.

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