Skip to content

[Scribe mobile] Add current text in a card in Scribe mobile#4248

Merged
hoangdat merged 1 commit intoscribe-mobilefrom
feat/scribe-mobile-content-card
Feb 3, 2026
Merged

[Scribe mobile] Add current text in a card in Scribe mobile#4248
hoangdat merged 1 commit intoscribe-mobilefrom
feat/scribe-mobile-content-card

Conversation

@zatteo
Copy link
Member

@zatteo zatteo commented Jan 13, 2026

Context

Because the Scribe mobile is a full screen modal, we do not see the current content (so either the selected text or entire composer text) when selecting our AI actions.

Done

That's why we add here a scrollable card that displays the current content (in green in screenshot).

Screenshot_1768311201 Screenshot_1768311151

Summary by CodeRabbit

  • New Features

    • Added text content display capability to mobile menu interface with a dedicated card component.
  • Style

    • Introduced new visual styling system for content cards, including typography, spacing, sizing, and shadow effects for improved visual consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 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 pull request extends the AIScribe presentation layer by introducing new styling constants and adding content display functionality. Changes include: new shadow, text, and sizing style definitions for a contentCard component in the styles module; propagation of an optional content parameter through the mobile modal manager to the mobile bottom sheet widget; and implementation of a private text card widget builder to render and display this content within the bottom sheet UI. No changes to core action or navigation logic were made.

Possibly related PRs

  • AI scribe UI #4197: Directly extends the same AIScribe styles and modal/bottom-sheet code by introducing the contentCard style and propagating the content parameter through the mobile flow.

Suggested reviewers

  • hoangdat
  • chibenwa
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: adding a scrollable card displaying current text in Scribe mobile, which directly aligns with the PR's primary objective and all file modifications.

✏️ 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-mobile-content-card

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 requested a review from dab246 January 13, 2026 13:46
@zatteo
Copy link
Member Author

zatteo commented Jan 13, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 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: 0

🧹 Nitpick comments (3)
scribe/lib/scribe/ai/presentation/styles/ai_scribe_styles.dart (2)

47-66: First shadow in list has no visual effect.

The first BoxShadow (lines 48-53) with spreadRadius: 0, blurRadius: 0, and offset: Offset(0, 0) renders nothing visible. If this is intentional for layering or future use, consider adding a comment; otherwise, it can be removed.

♻️ Suggested simplification
  static final List<BoxShadow> contentCard = [
-   BoxShadow(
-     color: AppColor.gray424244.withValues(alpha: 0.12),
-     spreadRadius: 0,
-     blurRadius: 0,
-     offset: const Offset(0, 0),
-   ),
    BoxShadow(
      color: Colors.black.withValues(alpha: 0.1),
      spreadRadius: 0,
      blurRadius: 3,
      offset: const Offset(0, 1),
    ),
    BoxShadow(
      color: Colors.black.withValues(alpha: 0.1),
      spreadRadius: 0,
      blurRadius: 2,
      offset: const Offset(0, 2),
    ),
  ];

116-122: Consider reusing existing suggestionContent style.

The contentCard style is identical to suggestionContent (lines 108-114). If they should stay in sync, consider reusing:

static final TextStyle contentCard = suggestionContent;

If they may diverge in the future, keeping them separate is fine.

scribe/lib/scribe/ai/presentation/widgets/mobile/ai_scribe_mobile_actions_bottom_sheet.dart (1)

128-153: Use AIScribeColors.background for consistency.

Line 141 uses hardcoded Colors.white instead of the defined AIScribeColors.background constant. This ensures the color stays consistent if the theme changes.

♻️ Suggested fix
      decoration: BoxDecoration(
-       color: Colors.white,
+       color: AIScribeColors.background,
        borderRadius: BorderRadius.circular(AIScribeSizes.contentCardRadius),
        boxShadow: AIScribeShadows.contentCard,
      ),
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ed5cd8 and e46d791.

📒 Files selected for processing (3)
  • scribe/lib/scribe/ai/presentation/styles/ai_scribe_styles.dart
  • scribe/lib/scribe/ai/presentation/utils/modal/ai_scribe_modal_manager.dart
  • scribe/lib/scribe/ai/presentation/widgets/mobile/ai_scribe_mobile_actions_bottom_sheet.dart
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-09T09:36:45.349Z
Learnt from: dab246
Repo: linagora/tmail-flutter PR: 4194
File: lib/features/manage_account/presentation/manage_account_dashboard_controller.dart:174-176
Timestamp: 2025-12-09T09:36:45.349Z
Learning: In Dart/Flutter projects using GetX, do not wrap getBinding<T>() calls in try/catch since they return null when not found. Only wrap Get.find<T>() calls in try/catch because they throw if a dependency is unavailable. When a binding is optional, consider checking Get.isRegistered<T>() or handling the null/exception path gracefully instead of blindly catching, and document the expectation for failure modes where a dependency may not be registered.

Applied to files:

  • scribe/lib/scribe/ai/presentation/widgets/mobile/ai_scribe_mobile_actions_bottom_sheet.dart
  • scribe/lib/scribe/ai/presentation/styles/ai_scribe_styles.dart
  • scribe/lib/scribe/ai/presentation/utils/modal/ai_scribe_modal_manager.dart
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: analyze-test (server_settings)
  • GitHub Check: analyze-test (default)
  • GitHub Check: analyze-test (contact)
  • GitHub Check: analyze-test (email_recovery)
  • GitHub Check: analyze-test (core)
  • GitHub Check: analyze-test (forward)
  • GitHub Check: analyze-test (fcm)
  • GitHub Check: analyze-test (model)
  • GitHub Check: analyze-test (rule_filter)
  • GitHub Check: Build web version and deploy
🔇 Additional comments (5)
scribe/lib/scribe/ai/presentation/styles/ai_scribe_styles.dart (1)

137-137: LGTM!

The new sizing and spacing constants (contentCardRadius, contentCardMaxHeight, contentCardMargin, contentCardPadding) follow existing naming conventions and patterns in the file.

Also applies to: 155-155, 218-223

scribe/lib/scribe/ai/presentation/widgets/mobile/ai_scribe_mobile_actions_bottom_sheet.dart (2)

6-16: LGTM!

The optional content parameter is properly declared and integrated into the widget constructor.


206-218: LGTM!

The text card is correctly positioned between the header and the menu list, which aligns with the PR objective of showing content above the AI actions.

scribe/lib/scribe/ai/presentation/utils/modal/ai_scribe_modal_manager.dart (2)

94-112: LGTM!

The content parameter is correctly added to showMobileAIScribeMenuModal and properly forwarded to AiScribeMobileActionsBottomSheet.


22-27: LGTM!

The content parameter is consistently propagated to both mobile and desktop modal paths.

@github-actions
Copy link

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

@zatteo
Copy link
Member Author

zatteo commented Jan 13, 2026

Nitpick from coderabbit fixed (one kept as is because it makes more sense to keep contentCard and suggestionContent style separated).

@zatteo zatteo force-pushed the feat/scribe-mobile branch from 7ed5cd8 to c27fe98 Compare January 14, 2026 07:57
@zatteo zatteo changed the title Add current text in a card in Scribe mobile [Scribe mobile] Add current text in a card in Scribe mobile Jan 14, 2026
@zatteo zatteo force-pushed the feat/scribe-mobile-content-card branch from 7dd3f72 to 8aa0343 Compare January 14, 2026 14:57
@zatteo zatteo force-pushed the feat/scribe-mobile branch 2 times, most recently from 8fe0326 to fb2bf94 Compare January 16, 2026 09:13
@dab246
Copy link
Member

dab246 commented Jan 16, 2026

Please rebase it

@dab246
Copy link
Member

dab246 commented Jan 20, 2026

  • What if the content is too long? Should we make it scroll? Or should we leave it as ...
535113018-3610049e-adb0-4e2a-8d5c-ace98290aad3

@zatteo
Copy link
Member Author

zatteo commented Jan 20, 2026

  • What if the content is too long? Should we make it scroll? Or should we leave it as ...
535113018-3610049e-adb0-4e2a-8d5c-ace98290aad3

Actually it is already scrollable even if it is not explicitly shown. Do you think we should make it more explicit?

Screen.Recording.2026-01-20.at.14.35.22.mov

@zatteo zatteo force-pushed the feat/scribe-mobile branch 2 times, most recently from d025cae to 41f6580 Compare February 2, 2026 09:42
Because the Scribe mobile is a full screen modal, we do not see the
current content (so either the selected text or entire composer text)
when selecting our AI actions.

That's why we add here a scrollable card that displays the current
content.
@zatteo zatteo force-pushed the feat/scribe-mobile-content-card branch from df3ed03 to 26abdaf Compare February 2, 2026 10:24
@zatteo zatteo changed the base branch from feat/scribe-mobile to scribe-mobile February 2, 2026 10:24
@hoangdat hoangdat merged commit b26ad5c into scribe-mobile Feb 3, 2026
1 check passed
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.

3 participants