Commit Graph

4612 Commits

Author SHA1 Message Date
Dat H. Pham 3a571ea01b Bump version to v0.23.0 2025-12-19 19:06:55 +07:00
Dat H. Pham 0a8ec3fbc0 fix: add console error to log text selection failed 2025-12-19 19:03:39 +07:00
dab246 6e09d853fd feat(ai-scribe): Fix the English locale file `(intl_en.arb)` is missing all three AI Scribe keys
feat(ai-scribe): Fix async function declared without proper return type annotation.

feat(ai-scribe): Fix Async operations not properly awaited.

feat(ai-scribe): Fix inconsistent capitalization between button labels.

feat(ai-scribe): Fix GenerateAITextFailure check will never match.

feat(ai-scribe): Fix consider validating text input for predefined actions.

feat(ai-scribe): Using a subshell for directory isolation.

feat(ai-scribe): Fix verify the mock usage or document intent.

feat(ai-scribe): Using a more conventional import for Offset.

feat(ai-scribe): Adding error handling for consistency

feat(ai-scribe): Remove `fromJson` and `toJson` of AIResponse

feat(ai-scribe): Using constants for role values.

feat(ai-scribe): Using a more specific import.

feat(ai-scribe): Using Timer for cleaner lifecycle management

feat(ai-scribe): Adding error handling to fromMap() for consistency.

feat(ai-scribe): Disposing the ValueNotifier

feat(ai-scribe): Redundant null check after assignment

feat(ai-scribe): Fix calling `registerSelectionChangeListener` multiple times may be inefficient.

feat(ai-scribe): Safer type handling for JavaScript callback args

feat(ai-scribe): Fix async callbacks not awaited in switch statement.

feat(ai-scribe): Fix binding lifecycle mismatch for GetAIScribeConfigInteractor

feat(ai-scribe): Fix ai prompts

feat(ai-scribe): Fix unawaited async call to `_setupSelectionListener`

feat(ai-scribe): Fix switch cases use top-origin coordinates while `PositionedDirectional(bottom:)`` expects bottom-origin coordinates.

feat(ai-scribe): Adding error handling for selection listener setup.
2025-12-19 19:03:39 +07:00
dab246 6e56a50713 feat(ai-scribe): Load AI scribe config in dashboard 2025-12-19 19:03:39 +07:00
HuyNguyen 256234b3d8 Update environment configuration for composer_controller_test.dart 2025-12-19 19:03:39 +07:00
HuyNguyen 428d95c999 Enable AI Scribe modal based on configuration and availability 2025-12-19 19:03:39 +07:00
Dat H. Pham 25ea472688 Display AI toggle in Composer 2025-12-19 19:03:39 +07:00
Dat H. Pham 3c20c005f6 Display AI Scribe togge in Preference 2025-12-19 19:03:39 +07:00
Dat H. Pham 9a46f6c663 Interactor getAIScribeConfig 2025-12-19 19:03:39 +07:00
Dat H. Pham a915ec9881 AIConfig model 2025-12-19 19:03:39 +07:00
Théo Poizat 68e55a0e22 Improve AI Scribe prompts
- Mutualize some commands
- Avoid unexpected behavior
2025-12-19 19:03:39 +07:00
dab246 a686b5d334 feat(ai-scribe): Adding error handling for async operations 2025-12-19 19:03:39 +07:00
dab246 b3dd6a9e85 feat(ai-scribe): Fix missing HTML entity escaping creates correctness and potential security issues 2025-12-19 19:03:39 +07:00
Théo Poizat c78f6b8a76 Improve text replace in Scribe
- Delete selection content before inserting
- Insert correct HTML
2025-12-19 19:03:39 +07:00
Théo Poizat 1a79445711 Add a method to delete selection content 2025-12-19 19:03:39 +07:00
dab246 088b922b0e feat(ai-scribe): Fix alignment of prompt when AI button at very right of composer or response have long result but at the bottom of composer 2025-12-19 19:03:39 +07:00
dab246 89eb1ecc71 feat(ai-scribe): Fix click on response text of AI, dialog to be disappeared 2025-12-19 19:03:39 +07:00
Théo Poizat 2b6504f8be Unpixelize gradient sparkle 2025-12-19 19:03:39 +07:00
Théo Poizat 9a8989a310 Make the AI Scribe suggestion success selectable text 2025-12-19 19:03:39 +07:00
dab246 57bfb4f88f feat(ai-scribe): Fix when using multiple composer, get multiple overlay icons 2025-12-19 19:03:39 +07:00
dab246 fd33ccf5e4 feat(ai-scribe): Auto hide Replace action when perform prompt in new email without content 2025-12-19 19:03:39 +07:00
dab246 d62b3db985 feat(ai-scribe): Add Enter to send prompt directly and Shift + Enter to add new line 2025-12-19 19:03:39 +07:00
dab246 54ca4595ad feat(ai-scribe): Fix some comments of coderabbit 2025-12-19 19:03:39 +07:00
dab246 863bc115bb feat(ai-scribe): Fix click outside during scribe generating response, scribe be closed 2025-12-19 19:03:39 +07:00
dab246 96b73aa971 feat(ai-scribe): Avoid the prompt being obscured when there is a lot of content. 2025-12-19 19:03:39 +07:00
dab246 3e337d7f3d feat(ai-scribe): Allow scroll the prompt's response is long 2025-12-19 19:03:39 +07:00
dab246 ea8dedda46 feat(ai-scribe): Fix generate ai text is failed 2025-12-19 19:03:39 +07:00
dab246 27393d4cc8 feat(ai-scribe): Add method to collapse selection and insert/replace callback 2025-12-19 19:03:39 +07:00
Théo Poizat 3fe54e1847 Add Intl for Replace text 2025-12-19 19:03:39 +07:00
Théo Poizat 8ed8100e7e Add JS method to collapse selection in both composer
Collapsing a selection means removing it and keep the cursor at the
end. It will be needed by the scribe for "Insert" action where we
want to insert a text at the cursor even if the user selected text.
2025-12-19 19:03:39 +07:00
dab246 af5f316e31 feat(ai-scribe): Optimize imports to avoid having too many lines of code in a single file 2025-12-19 19:03:39 +07:00
dab246 860393fc90 feat(ai-scribe): Improve data & domain layer for ai scribe 2025-12-19 19:03:39 +07:00
dab246 1a1b8f489f feat(ai-scribe): Improve UI for AI Scribe suggestion modal 2025-12-19 19:03:39 +07:00
dab246 582b1ebe97 feat(ai-scribe): reorganize abstractions and update dialog modal UI 2025-12-19 19:03:39 +07:00
dab246 7ddccf2e1c feat(ai-scribe): Fix cannot parsing AI capability from Session 2025-12-19 19:03:39 +07:00
Théo Poizat 63d9a5d740 Strong typing AI exceptions 2025-12-19 19:03:39 +07:00
Théo Poizat 755e24895d Disable AI Scribe if on mobile 2025-12-19 19:03:39 +07:00
Théo Poizat 0075fd64b6 feat: Remove .env file for AI Scribe
It was used at the beginning for configuration purpose but now we
have the JMAP capability, no need anymore.
2025-12-19 19:03:39 +07:00
Théo Poizat 253f22c600 Remove value now unused
No more API key and url needed because everything is managed by the backend.

Also backend does not accept a model parameter for the moment.
2025-12-19 19:03:39 +07:00
Théo Poizat 2c364ea08a Use endpoint from AI capability instead of direct call to LLM 2025-12-19 19:03:39 +07:00
Théo Poizat 2325df616f Create an isAIScribeAvailable method
Check JMAP capability AND if AI is enabled in env.file and use this method everywhere  where we checked env.file
2025-12-19 19:03:39 +07:00
Théo Poizat 8c16bd1fad Add AI capability 2025-12-19 19:03:39 +07:00
Théo Poizat e7405051d1 fixup! Use html parser instead of regex to clean composer input
Improve efficiency and add more tests in convertHtmlContentToTextContent
2025-12-19 19:03:39 +07:00
Théo Poizat a9cfe86a59 Use html parser instead of regex to clean composer input
Before sending input to the LLM, we clean the composer input to
remove html tags. We relied on regex that we not complete enough and
could be bypassed easily. So let's use the html parser available in
Dart instead.

I also added some tests.
2025-12-19 19:03:39 +07:00
Théo Poizat f77580ed44 Fix tests by initializing DotEnv for testing 2025-12-19 19:03:39 +07:00
Théo Poizat 4d8d688afb Fix AI scribe menu going off screen to the top
If it was opened at the top of the composer, it could go off screen to the top.

modalHeight was missing so the calculateModalPosition method could not protect the AI scribe menu to go off screen from the top.
2025-12-19 19:03:39 +07:00
Théo Poizat c7886614cd Add tests to AI scribe calculcateModalPosition 2025-12-19 19:03:39 +07:00
Théo Poizat d1bec5af24 Use ValueNotifier instead of setState in AIScribeBar 2025-12-19 19:03:39 +07:00
Théo Poizat 0b139a41d2 Remove unused categoryKeys 2025-12-19 19:03:39 +07:00
Théo Poizat 77a56ae9b7 Export AI Scribe code from controller to a mixin
Avoid adding too much code in the controller
2025-12-19 19:03:39 +07:00