Commit Graph

4925 Commits

Author SHA1 Message Date
Théo Poizat ed53929323 fixup! Display Scribe mobile (bottomsheet) only when responsive mobile 2026-03-25 11:52:35 +07:00
Théo Poizat 03a03b9088 Fix Scribe on responsive mobile
- Button was not added in MobileResponsiveAppBar
- Mobile behavior related scripts were not correctly added for web composer
- Mobile behavior related scripts return value was not properly handled for web composer
- In responsive web, bottomsheet modal clicks were intercepted by iframe behind
2026-03-25 11:52:35 +07:00
Théo Poizat 46a12745a5 Ensure replace function respect new lines in every editor 2026-03-25 11:52:35 +07:00
Théo Poizat 17b9d97284 Adjust Scribe context menu to support tablet screens
- Support tap in addition to hover for context menu
- Improve clamping for greater screen sizes to avoid Scribe getting off screen
- Set a padding to 0 to avoid random padding depending on screen sizes
2026-03-25 11:52:35 +07:00
Théo Poizat 7a6a49fc7b Display Scribe mobile (bottomsheet) only when responsive mobile
Previosuly, we display Scribe mobile (bottomsheet) if platform was mobile, so also Android or iOS tablet.

Now we choose to display Scribe mobile relatively to display screens instead of platform to display the desktop Scribe (context menu) for tablets.
2026-03-25 11:52:35 +07:00
Théo Poizat 6540ed29d1 Add current text in a card in Scribe mobile
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.
2026-03-25 11:52:35 +07:00
Théo Poizat 26393c038b Upgrade enough_html_editor
To enjoy the fix from the following PR https://github.com/linagora/enough_html_editor/pull/40
2026-03-25 11:52:35 +07:00
Théo Poizat 40030fe88e Properly escape HTML in every Scribe actions
In recent commits I separated how we could add text in the editor. So
we need to escape HTML in both method that add text:
insertTextInEditor and setTextInEditor.

I had to extract the HTML escape part of
convertTextContentToHtmlContent because when using setTextInEditor we
do not need to convert \n to <br>.
2026-03-25 11:52:35 +07:00
Théo Poizat cf8ed16ed0 Use warning logs instead of error logs for Scribe 2026-03-25 11:52:35 +07:00
Théo Poizat c05a01d92a Move Scribe icon in tablet at left of icons 2026-03-25 11:52:35 +07:00
Théo Poizat b5606626f4 Fix more Scribe mobile issues
- Add getSavedSelection to check saved selection without consuming it
- Distinguish between setText (replace all) and insertText (at cursor) operations
- Fix replace callback to use setText when no selection exists
- Clean up saved selection state after restoration in HTML utils
- Move mobile editor focus and selection restore to appropriate callbacks
2026-03-25 11:52:35 +07:00
Théo Poizat be7f28f270 Fix Scribe mobile issues
- Fix Scribe replace on mobile when opened from menu bar (to be complete
this fix needs this PR https://github.com/Enough-Software/enough_html_editor/pull/37)
- Ensure all mobile editor call are awaited
- Do not clear text if a selection has been restored (which mean we replace a selection)
- Avoid collapseToEnd crash
2026-03-25 11:52:35 +07:00
Théo Poizat abd2453511 Do not display Scribe actions if no content in composer in mobile 2026-03-25 11:52:35 +07:00
Théo Poizat 752f42dc7d Ensure editor is focused before calling insert HTML
enough_html_editor uses execCommand to insert HTML. However
execCommand only works if the contenteditable element is focused. So
inserting or replacing Scribe result do not work if the user did not
click before in the composer.

Here we manually focus the contenteditable element to fix this before
inserting content.
2026-03-25 11:52:35 +07:00
Théo Poizat 84176cb113 Hide keyboard and selection icons when Scribe mobile modal opened
When opening Scribe mobile modal, we now unfocus the composer to hide the keyboard and the selection start and end icons from the OS.

Add new methods to save, restore, and clear text selection in HTML editor. These methods allow preserving and restoring user selection state when opening the Scribe mobile modal so that the "replace" action still works.
2026-03-25 11:52:35 +07:00
Théo Poizat 09fe002d3c Use proper icons and styles for bottomsheet icons in Scribe 2026-03-25 11:52:35 +07:00
Théo Poizat 14f2e557fa Add Scribe mobile
Same features than Scribe desktop but as a full screen modal instead of  a context menu.

Reuse menu and submenu components.
Reuse suggestion components.
Reuse 99% of Scribe desktop style.
2026-03-25 11:52:35 +07:00
Théo Poizat 245dfc714d Display sparkle button in mobile app bar to launch AI Scribe
- Same icon than for desktop
- Displayed only if AI Scribe is enabled
2026-03-25 11:52:35 +07:00
Théo Poizat 089eb7b75f Fix correct grammar icon not present in submenu getIcon 2026-03-25 11:52:35 +07:00
Théo Poizat b28dea732a Fix AI Scribe overlay button display in iOS
The button was never displayed because the selectionchange event listener was loaded when the WebView was not entirely loaded so selectionchange event were never fired.

Now we setup selection listener when the WebView is loaded instead of created.
2026-03-25 11:52:35 +07:00
Théo Poizat 03c70922a0 Fix selection coordinates in mobile
Because the HTML editor is different, we need a different selector to get the editable element.

We also need to add a small offset to the coordinates to avoid positionning the overlay icon above native selection UI in mobile. For example, Android adds a marker at the beginning and the end of the selection and we do not want to display the Scribe overlay icon above this marker.
2026-03-25 11:52:35 +07:00
Théo Poizat 9e601caa86 Enable AI scribe in mobile 2026-03-25 11:52:35 +07:00
Théo Poizat 0f4ed4537e Remove unused localizations arguments in Scribe suggestion 2026-03-25 11:52:35 +07:00
Théo Poizat 5abce414d4 Guard Scribe suggestion loading if interactor is null 2026-03-25 11:52:35 +07:00
Théo Poizat 5bdcff5aba Extract Scribe menu item text and icons in components 2026-03-25 11:52:35 +07:00
Théo Poizat d5a3400bb4 Allow boxShadow to be changed in AIScribeBar
We will need a custom boxShadow for mobile version.
2026-03-25 11:52:35 +07:00
Théo Poizat 4c75ec863d Extract AI Scribe menu item component
Scribe is always composed of menu (aka category) and submenu (aka action) :
- submenu item UI was already in an UI only component. I moved it to items folder.
- menu item UI was mixed in a component with desktop related UX. So I extract the UI to create an UI only component. I moved it also to items folder.
2026-03-25 11:52:35 +07:00
Théo Poizat 08899b1598 Extract AI Scribe suggestion logic
In Scribe desktop, the suggestion is displayed in a popup.
In Scribe mobile, it will be displayed in a full screen modal.

But it share the same logic about loading, success and error.

So here I extract this logic and use it in the AI Scribe desktop to be able to use it later in AI Scribe mobile.
2026-03-25 11:52:35 +07:00
Dat H. Pham 16b1de1b48 Bump version to v0.26.6 2026-03-24 22:19:31 +07:00
Dat Vu 8fff83a735 [HOT-FIX] Download attachment is failed on iOS (#4405) 2026-03-24 22:16:43 +07:00
Dat H. Pham 6a34e27340 Bump version to v0.26.5 2026-03-23 14:02:53 +07:00
Dat Vu 4899002b87 TF-4394 Fix TXT preview is broken (#4396) 2026-03-23 13:47:44 +07:00
Dat Vu 8a9901a0a4 TF-4384 Fix page not found 404 error when refreshing label views (#4390) 2026-03-21 17:23:18 +07:00
Dat H. Pham 8d82eac16f Bump version to v0.26.4-rc01 2026-03-20 10:15:13 +07:00
dab246 651115c304 TF-4368 Auto trigger load more when get all email return < 20 emails 2026-03-20 10:15:13 +07:00
Dat H. Pham 7907df3140 Bump version to v0.26.3-rc01 2026-03-20 10:15:13 +07:00
dab246 2d19bc908d TF-4368 Add more log trace for getAllEmail & forceQueryAllEmailsForWeb 2026-03-20 10:15:13 +07:00
dab246 9854592a4c TF-4368 Add more log trace for load more email 2026-03-20 10:15:13 +07:00
Dat H. Pham 7ecf5d8e53 bump version to v0.26.2-rc01 2026-03-20 10:15:13 +07:00
dab246 cdc7d711f5 TF-4368 Add log to tracing refresh change emails on Sentry 2026-03-20 10:15:13 +07:00
dab246 80c368be62 TF-4368 Add verifying actual merged email IDs, not just count. 2026-03-20 10:15:13 +07:00
dab246 bf1bab478c TF-4368 Add the delete/shrink regression case and assert the requested limit. 2026-03-20 10:15:13 +07:00
dab246 72aceff481 TF-4368 Add named parameters to mock setup for consistency. 2026-03-20 10:15:13 +07:00
dab246 2d45909ad1 TF-4368 Add tearDown for consistency with other test groups. 2026-03-20 10:15:13 +07:00
dab246 23a3e9243e TF-4368 Add unit test for refreshChanges method 2026-03-20 10:15:13 +07:00
dab246 a28d5b3527 TF-4368 Fix cannot scroll in email list 2026-03-20 10:15:13 +07:00
Dat Vu eecdf75f5e TF-4384 Add ADR-0074 Resolve label refresh 404 by introducing explicit labelId (#4387) 2026-03-19 17:13:31 +07:00
dab246 e2c158d633 TF-4373 Add E2E test for test case delete thread to trash on mobile 2026-03-12 15:15:03 +07:00
dab246 bb9dca10de TF-4373 Fix deletion is not working when thread is enabled 2026-03-12 15:15:03 +07:00
dab246 a838912f5c TF-4367 Add test case for Emails with Re\u00A0: / Tr\u00A0:. 2026-03-11 13:33:28 +07:00