mattermost-mobile/app/utils
Felipe Martin 714c3dc769
feat: AI rewrite (#9280)
* feat: ai rewrite

* feat: allow crating content apart from editing it

* feat: feature parity with webapp

* feat: feature parity with webapp

* chore: fixed padding

* map ux to webapp

* refactored ai rewrite logic to separate package

* chore: tests and lint

* Update app/products/ai/rewrite/screens/options/options.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* rewrite post editor animation

* i18n

* ui feedback, centered icon and less top padding

* chore: lint

* Consolidate @ai product into @agents

Move all rewrite functionality from app/products/ai/ into
app/products/agents/ to unify under a single namespace.

- Add rewrite types, store, hooks, components, and screens to agents
- Merge AI client methods into agents client
- Update screen constants (AI_* -> AGENTS_*)
- Update all consumer imports
- Remove AI state from EphemeralStore
- Remove @ai path alias from config
- Delete app/products/ai/ directory

* refactor: load screens from product package

* refactor: move detection logic to the agents pacakge

* refactor: remove "backwards compatibility"

* refactor: move hooks to proper package

* refactor: styles

* refactor: remove unneedd position attribute

* refactor: remove unneeded cancel animation calls

* refactor: "backwards compat"

* refactor: optimize renderContent with useCallback for performance

* refactor: rename variable to avoid confusion

* refactor: update handleRewrite to use async/await for better error handling

* refactor: simplify handleRewrite by always dismissing keyboard

* refactor: use hook, always all keyboard.dismiss

* chore: enhance AgentSelector component with FlatList support

* feat: add rewriteMessage function for AI message rewriting and integrate it into useRewrite hook

* refactor: simplify message length calculation in useHandleSendMessage hook

* refactor: consolidate agent screen constants and integrate with existing screens

* fix: update dependency array in useMemo for isUnrevealedPost to include post expiration metadata

* refactor: remove unused variable to clean up Typing component

* refactor: simplify logic for atDisabled and slashDisabled flags in QuickActions component

* feat: add AIRewriteAction component for AI message rewriting functionality

* revert: thread.ts changes manually

* refactor: integrate useSafeAreaInsets

* refactor: cleanup unused methods

* chore: add comment to clarify casting

* refactor: use_agents

* chore: lint and test

* fix: trim

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-16 16:48:57 +01:00
..
alerts feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
channel Unify Is Read Only logic to avoid code repetition and improve redability (#8720) 2025-04-06 17:50:19 +02:00
deep_link Easy Login (#9261) 2025-11-20 12:38:06 +01:00
document Secure Files and preview PDF inline (#8844) 2025-06-19 15:30:56 +08:00
draft feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
emoji feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
file feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
gallery feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
general Channel banner display (#8735) 2025-04-08 11:15:18 +05:30
images Fix gallery image dimensions (#9247) 2025-11-10 19:18:27 +08:00
markdown Improve markdown code (#9164) 2025-11-04 10:05:56 +01:00
navigation Remove tand prevent double tap (#9078) 2025-08-25 12:03:01 +02:00
notification add unit tests to app/utils/notification (#8140) 2024-08-29 00:04:12 +08:00
permalink add unit tests to app/utils/permalink (#8141) 2024-08-29 00:03:25 +08:00
post Add autotranslations (#9324) 2026-02-10 17:50:39 +01:00
post_list Burn On Read Posts (#9307) 2025-12-11 09:42:16 +05:30
role Add utils/role unit tests (#8266) 2024-10-18 06:30:34 +08:00
scheduled_post Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
search Add utils/search unit tests (#8267) 2024-10-18 06:29:49 +08:00
server feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
snack_bar Add autotranslations (#9324) 2026-02-10 17:50:39 +01:00
svg Gekidou MultiServers second part (#5963) 2022-02-17 10:42:06 -03:00
tap Remove tand prevent double tap (#9078) 2025-08-25 12:03:01 +02:00
theme Improve markdown code (#9164) 2025-11-04 10:05:56 +01:00
thread Better handle threads sync (#8641) 2025-03-19 09:23:22 +01:00
url Agents posts on mobile (#9317) 2025-12-09 03:56:12 -08:00
user Remove tand prevent double tap (#9078) 2025-08-25 12:03:01 +02:00
apps.test.ts fix issues found by sonarqube (#8095) 2024-07-18 09:40:47 +08:00
apps.ts Make attachments and app bindings more robust yet secure (#8570) 2025-03-14 12:02:32 +01:00
bor.test.ts Ensured BoR post actions matches those in webapp (#9362) 2026-02-04 12:18:35 +05:30
bor.ts Ensured BoR post actions matches those in webapp (#9362) 2026-02-04 12:18:35 +05:30
buttonStyles.test.ts Add Report a Problem functionality (#8605) 2025-04-24 11:12:55 +02:00
buttonStyles.ts Standardize tags and chips through the app (#8856) 2025-06-11 10:11:05 +02:00
categories.test.ts Add model mocks to TestHelper (#8715) 2025-03-28 09:40:08 +01:00
categories.ts Add unit tests to Utils buttonStyles and categories (#8015) 2024-06-14 17:11:36 +08:00
config.test.ts Add unit tests to utils config, datetime, error_handling, errors and files (#8018) 2024-06-15 01:29:03 +08:00
config.ts Fix race condition when the same websocket gets initialized twice (#7185) 2023-03-07 19:11:28 +01:00
custom_profile_attribute.ts [MM-62565] DB only custom profile attributes and fields (#8739) 2025-04-09 15:35:27 +02:00
datetime.test.ts Bor create post (#9393) 2026-02-09 17:00:54 +05:30
datetime.ts Bor create post (#9393) 2026-02-09 17:00:54 +05:30
dialog_conversion.test.ts Add DialogRouter for Interactive Dialog to Apps Form migration (#9114) 2026-01-26 08:57:56 -07:00
dialog_conversion.ts Add DialogRouter for Interactive Dialog to Apps Form migration (#9114) 2026-01-26 08:57:56 -07:00
dialog_utils.test.ts Add DialogRouter for Interactive Dialog to Apps Form migration (#9114) 2026-01-26 08:57:56 -07:00
dialog_utils.ts Add DialogRouter for Interactive Dialog to Apps Form migration (#9114) 2026-01-26 08:57:56 -07:00
error_handling.test.ts feat: AI rewrite (#9280) 2026-02-16 16:48:57 +01:00
error_handling.ts Remove tand prevent double tap (#9078) 2025-08-25 12:03:01 +02:00
errors.test.ts [MM-62777] Fix errors being nested. Make MFA code more resilient to this situation (#8531) 2025-01-31 08:31:15 +02:00
errors.ts [MM-62777] Fix errors being nested. Make MFA code more resilient to this situation (#8531) 2025-01-31 08:31:15 +02:00
files.test.ts Secure Files and preview PDF inline (#8844) 2025-06-19 15:30:56 +08:00
files.tsx feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
font_family.test.ts Add Playbooks read-only support for mobile devices (#8978) 2025-07-14 09:21:37 +02:00
font_family.ts added utils unit tests (#8040) 2024-07-05 07:17:09 +08:00
grapheme.test.ts New keyboard library Setup (#9278) 2026-01-13 22:38:35 +05:30
grapheme.ts New keyboard library Setup (#9278) 2026-01-13 22:38:35 +05:30
groups.test.ts added utils unit tests (#8040) 2024-07-05 07:17:09 +08:00
groups.ts [Gekidou] Groups + group-memberships deferred fetch (#6370) 2022-07-07 12:20:06 +02:00
helpers.test.ts feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
helpers.ts feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
integrations.test.ts added utils unit tests (#8040) 2024-07-05 07:17:09 +08:00
integrations.ts Add DialogRouter for Interactive Dialog to Apps Form migration (#9114) 2026-01-26 08:57:56 -07:00
interactive_dialog_adapter.test.ts Add DialogRouter for Interactive Dialog to Apps Form migration (#9114) 2026-01-26 08:57:56 -07:00
interactive_dialog_adapter.ts Add DialogRouter for Interactive Dialog to Apps Form migration (#9114) 2026-01-26 08:57:56 -07:00
intune_errors.ts feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
key_mirror.test.ts added utils unit tests (#8040) 2024-07-05 07:17:09 +08:00
key_mirror.ts MM-35115 [Gekidou] Login flow - Email and Password (#5402) 2021-06-18 00:57:40 -04:00
keyboard.ts New keyboard library Setup (#9278) 2026-01-13 22:38:35 +05:30
log.test.ts Add Report a Problem functionality (#8605) 2025-04-24 11:12:55 +02:00
log.ts Update dependencies (#8721) 2025-04-07 09:30:06 +08:00
mattermost_managed.test.ts added utils unit tests (#8040) 2024-07-05 07:17:09 +08:00
mattermost_managed.ts Upgrade RN as well as update or replace other dependencies (#8011) 2024-06-19 09:33:45 +08:00
message_attachment.test.ts Make attachments and app bindings more robust yet secure (#8570) 2025-03-14 12:02:32 +01:00
message_attachment.ts Make attachments and app bindings more robust yet secure (#8570) 2025-03-14 12:02:32 +01:00
mix.test.ts added utils unit tests (#8040) 2024-07-05 07:17:09 +08:00
mix.ts Remove watermelondb limitation on updating an already updated model (#7067) 2023-02-03 17:11:57 +02:00
opengraph.test.ts MM-59600 Add unit tests to utils/opengraph (#8444) 2025-01-06 15:30:48 -05:00
opengraph.ts MM-59600 Add unit tests to utils/opengraph (#8444) 2025-01-06 15:30:48 -05:00
permalink_sync.test.ts Ability to show attachment if the permalink post contains attachments. (#9101) 2025-09-12 13:44:54 +05:30
permalink_sync.ts Ability to show attachment if the permalink post contains attachments. (#9101) 2025-09-12 13:44:54 +05:30
push_proxy.test.ts added utils unit tests (#8040) 2024-07-05 07:17:09 +08:00
push_proxy.ts capitalize back the alert text 2023-10-18 21:06:12 +02:00
reviews.test.ts added utils unit tests (#8040) 2024-07-05 07:17:09 +08:00
reviews.ts Upgrade RN as well as update or replace other dependencies (#8011) 2024-06-19 09:33:45 +08:00
saml_challenge.ts Mobile-side for MM-65084 (#9115) 2025-09-29 14:29:37 -07:00
security.test.ts feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
security.ts feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
sentry.test.ts Update dependencies and upgrade to RN 0.76.5 (#8421) 2025-01-16 07:11:32 -07:00
sentry.ts Update dependencies and upgrade to RN 0.76.5 (#8421) 2025-01-16 07:11:32 -07:00
share_logs.test.ts Add Report a Problem functionality (#8605) 2025-04-24 11:12:55 +02:00
share_logs.ts Add Report a Problem functionality (#8605) 2025-04-24 11:12:55 +02:00
strings.test.ts added utils unit tests (#8040) 2024-07-05 07:17:09 +08:00
strings.ts added utils unit tests (#8040) 2024-07-05 07:17:09 +08:00
time.test.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
time.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
timezone.test.ts added utils unit tests (#8040) 2024-07-05 07:17:09 +08:00
timezone.ts remove usages of isTimeZoneEnabled (#7769) 2024-01-30 13:22:55 +01:00
types.ts Add model mocks to TestHelper (#8715) 2025-03-28 09:40:08 +01:00
typography.test.ts added utils unit tests (#8040) 2024-07-05 07:17:09 +08:00
typography.ts added utils unit tests (#8040) 2024-07-05 07:17:09 +08:00