From 682dec78b77c5c64c401243f136ed0de0834124e Mon Sep 17 00:00:00 2001 From: sandranymark Date: Fri, 4 Jul 2025 16:00:50 +0200 Subject: [PATCH 01/27] testFuselagForms --- .../accessibility/AccessibilityPage.tsx | 52 +-- .../preferences/PreferencesGlobalSection.tsx | 17 +- .../PreferencesHighlightsSection.tsx | 23 +- .../PreferencesLocalizationSection.tsx | 33 +- .../PreferencesMessagesSection.tsx | 355 +++++++----------- .../PreferencesNotificationsSection.tsx | 220 ++++------- .../preferences/PreferencesSoundSection.tsx | 252 ++++++------- .../PreferencesUserPresenceSection.tsx | 42 +-- .../account/profile/AccountProfileForm.tsx | 167 +++----- 9 files changed, 440 insertions(+), 721 deletions(-) diff --git a/apps/meteor/client/views/account/accessibility/AccessibilityPage.tsx b/apps/meteor/client/views/account/accessibility/AccessibilityPage.tsx index 6b5b6a1bccc9c..dcd36503dce1e 100644 --- a/apps/meteor/client/views/account/accessibility/AccessibilityPage.tsx +++ b/apps/meteor/client/views/account/accessibility/AccessibilityPage.tsx @@ -1,12 +1,8 @@ import { css } from '@rocket.chat/css-in-js'; import type { SelectOption } from '@rocket.chat/fuselage'; +import { Accordion, AccordionItem, Box, Button, ButtonGroup } from '@rocket.chat/fuselage'; import { FieldDescription, - Accordion, - AccordionItem, - Box, - Button, - ButtonGroup, Field, FieldGroup, FieldHint, @@ -15,7 +11,7 @@ import { RadioButton, Select, ToggleSwitch, -} from '@rocket.chat/fuselage'; +} from '@rocket.chat/fuselage-forms'; import { ExternalLink, Page, PageHeader, PageScrollableContentWithShadow, PageFooter } from '@rocket.chat/ui-client'; import { useTranslation, useToastMessageDispatch, useEndpoint, useSetting } from '@rocket.chat/ui-contexts'; import { useMutation } from '@tanstack/react-query'; @@ -49,11 +45,7 @@ const AccessibilityPage = () => { ); const pageFormId = useId(); - const fontSizeId = useId(); - const mentionsWithSymbolId = useId(); - const clockModeId = useId(); - const hideUsernamesId = useId(); - const hideRolesId = useId(); + const linkListId = useId(); const { @@ -113,7 +105,7 @@ const AccessibilityPage = () => { return ( - + {t(title)} { {t('Adjustable_layout')} - - {t('Font_size')} - + {t('Font_size')} ( - } /> {t('Adjustable_font_size_description')} - {t('Mentions_with_@_symbol')} + {t('Mentions_with_@_symbol')} ( - - )} + render={({ field: { onChange, value, ref } }) => } /> { - {t('Message_TimeFormat')} + {t('Message_TimeFormat')} ( - )} /> - {t('Show_usernames')} + {t('Show_usernames')} ( - onChange(!(e.target as HTMLInputElement).checked)} - /> + onChange(!(e.target as HTMLInputElement).checked)} /> )} /> @@ -204,17 +185,12 @@ const AccessibilityPage = () => { {displayRolesEnabled && ( - {t('Show_roles')} + {t('Show_roles')} ( - onChange(!(e.target as HTMLInputElement).checked)} - /> + onChange(!(e.target as HTMLInputElement).checked)} /> )} /> diff --git a/apps/meteor/client/views/account/preferences/PreferencesGlobalSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesGlobalSection.tsx index 6bc5468e02007..2fdd22c0c9515 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesGlobalSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesGlobalSection.tsx @@ -1,32 +1,35 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { AccordionItem, Field, FieldGroup, FieldLabel, FieldRow, MultiSelect } from '@rocket.chat/fuselage'; +import { Field, FieldGroup, FieldLabel, FieldRow, Select, FieldDescription, FieldLabelInfo } from '@rocket.chat/fuselage-forms'; +import { AccordionItem } from '@rocket.chat/fuselage'; import { useUserPreference } from '@rocket.chat/ui-contexts'; -import { useId } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; +// import { useId } from 'react'; const PreferencesGlobalSection = () => { const { t } = useTranslation(); + // const multiSelectId = useId(); + const userDontAskAgainList = useUserPreference<{ action: string; label: string }[]>('dontAskAgainList') || []; const options: SelectOption[] = userDontAskAgainList.map(({ action, label }) => [action, label]); const { control } = useFormContext(); - const dontAskAgainListId = useId(); return ( + - - {t('Dont_ask_me_again_list')} - + {t('Dont_ask_me_again_list')} + + You can use this field to enter multi-line text ( - + - )} - /> - - - + + {t('Language')} + + - )} - /> - - - {t('Accounts_Default_User_Preferences_alsoSendThreadToChannel_Description')} - - - - - {t('Message_TimeFormat')} - - - {t('Go_to_accessibility_and_appearance')} - - - - - {t('Use_Emojis')} - ( - - )} - /> - - - - - {t('Convert_Ascii_Emojis')} - ( - - )} - /> - - - - - {t('Auto_Load_Images')} - ( - - )} - /> - - - - - {t('Save_Mobile_Bandwidth')} - ( - - )} - /> - - - - - {t('Collapse_Embedded_Media_By_Default')} - ( - - )} - /> - - - - - {t('Hide_usernames')} - - - {t('Go_to_accessibility_and_appearance')} - - - - - {t('Hide_roles')} - - - {t('Go_to_accessibility_and_appearance')} - - - - - {t('Hide_flextab')} - ( - - )} - /> - - - - - {t('Display_avatars')} - ( - - )} - /> - - - - - {t('Enter_Behaviour')} - - - ( - + )} + /> + + {t('Accounts_Default_User_Preferences_alsoSendThreadToChannel_Description')} + + + {t('Message_TimeFormat')} + {t('Go_to_accessibility_and_appearance')} + + + + {t('Use_Emojis')} + You can use this field to enter multi-line text + } + /> + + + + + {t('Convert_Ascii_Emojis')} + } + /> + + + + + {t('Auto_Load_Images')} + You can use this field to enter multi-line text + } + /> + + + + + {t('Save_Mobile_Bandwidth')} + You can use this field to enter multi-line text + } + /> + + + + + {t('Collapse_Embedded_Media_By_Default')} + You can use this field to enter multi-line text + } + /> + + + + {t('Hide_usernames')} + You can use this field to enter multi-line text + {t('Go_to_accessibility_and_appearance')} + + + {t('Hide_roles')} + You can use this field to enter multi-line text + {t('Go_to_accessibility_and_appearance')} + + + + {t('Hide_flextab')} + You can use this field to enter multi-line text + } + /> + + + + + {t('Display_avatars')} + You can use this field to enter multi-line text + } + /> + + + + {t('Enter_Behaviour')} + You can use this field to enter multi-line text + + } + /> + + + + {t('Notification_Push_Default_For')} + + )} - - - - - {t('Notification_RequireInteraction')} - ( - - )} - /> - - {t('Only_works_with_chrome_version_greater_50')} - - - - {t('Notification_Desktop_Default_For')} - - - ( - - )} + render={({ field: { ref, value, onChange } }) => } /> + )} + {showMobileRinging && ( - - {t('Email_Notification_Mode')} - + {t('VideoConf_Mobile_Ringing')} ( - { - onChange(value); - customSound.play(String(value), { volume: notificationsSoundVolume / 100 }); - }} - /> - )} - /> - - - - - {t('New_Message_Notification')} - - - ( - { + onChange(value); + customSound.play(String(value), { volume: notificationsSoundVolume / 100 }); + }} + /> + )} + /> + + + + {t('New_Message_Notification')} + + ( + + )} /> From 3774675ee8b0f3eb3610ce02a0a92e556ea30413 Mon Sep 17 00:00:00 2001 From: gabriellsh Date: Tue, 15 Jul 2025 18:25:16 -0300 Subject: [PATCH 03/27] review --- .../PreferencesHighlightsSection.tsx | 19 +- .../PreferencesLocalizationSection.tsx | 24 +- .../PreferencesMessagesSection.tsx | 270 +++++++++--------- .../PreferencesNotificationsSection.tsx | 158 +++++----- .../preferences/PreferencesSoundSection.tsx | 213 +++++++------- .../PreferencesUserPresenceSection.tsx | 36 +-- .../account/profile/AccountProfileForm.tsx | 6 +- 7 files changed, 364 insertions(+), 362 deletions(-) diff --git a/apps/meteor/client/views/account/preferences/PreferencesHighlightsSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesHighlightsSection.tsx index 46c609596c3f9..7fae2b4e1f4e8 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesHighlightsSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesHighlightsSection.tsx @@ -1,6 +1,5 @@ -import { Field, FieldLabel, FieldRow, FieldHint, TextAreaInput } from '@rocket.chat/fuselage-forms'; import { AccordionItem } from '@rocket.chat/fuselage'; - +import { Field, FieldGroup, FieldLabel, FieldRow, FieldHint, TextAreaInput } from '@rocket.chat/fuselage-forms'; import { useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; @@ -10,13 +9,15 @@ const PreferencesHighlightsSection = () => { return ( - - {t('Highlights_List')} - - - - {t('Highlights_How_To')} - + + + {t('Highlights_List')} + + + + {t('Highlights_How_To')} + + ); }; diff --git a/apps/meteor/client/views/account/preferences/PreferencesLocalizationSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesLocalizationSection.tsx index 312b1ada448ff..215969464bd31 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesLocalizationSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesLocalizationSection.tsx @@ -1,6 +1,6 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { Field, FieldLabel, FieldRow, Select } from '@rocket.chat/fuselage-forms'; import { AccordionItem } from '@rocket.chat/fuselage'; +import { Field, FieldGroup, FieldLabel, FieldRow, Select } from '@rocket.chat/fuselage-forms'; import { useLanguages } from '@rocket.chat/ui-contexts'; import { useMemo } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; @@ -16,16 +16,18 @@ const PreferencesLocalizationSection = () => { return ( - - {t('Language')} - - } + /> + + + ); }; diff --git a/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx index 6dba760ee6189..f11d8236974c5 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx @@ -1,6 +1,6 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { Field, FieldHint, FieldLabel, FieldLink, FieldRow, Select, ToggleSwitch, FieldDescription } from '@rocket.chat/fuselage-forms'; import { AccordionItem } from '@rocket.chat/fuselage'; +import { Field, FieldGroup, FieldHint, FieldLabel, FieldLink, FieldRow, Select, ToggleSwitch } from '@rocket.chat/fuselage-forms'; import { useMemo } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; @@ -29,145 +29,135 @@ const PreferencesMessagesSection = () => { return ( - - - {t('Unread_Tray_Icon_Alert')} - You can use this field to enter multi-line text - } - /> - - - - - {t('Always_show_thread_replies_in_main_channel')} - You can use this field to enter multi-line text - } - /> - - {t('Accounts_Default_User_Preferences_showThreadsInMainChannel_Description')} - - - {t('Also_send_thread_message_to_channel_behavior')} - You can use this field to enter multi-line text - - ( - } - /> - - {t('Enter_Behaviour_Description')} - + + + + {t('Unread_Tray_Icon_Alert')} + } + /> + + + + + {t('Always_show_thread_replies_in_main_channel')} + } + /> + + {t('Accounts_Default_User_Preferences_showThreadsInMainChannel_Description')} + + + {t('Also_send_thread_message_to_channel_behavior')} + + ( + } + /> + + {t('Enter_Behaviour_Description')} + + ); }; diff --git a/apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx index d9c84d961de69..5c69aaecd2c62 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx @@ -1,7 +1,7 @@ import type { INotificationDesktop } from '@rocket.chat/core-typings'; import type { SelectOption } from '@rocket.chat/fuselage'; import { AccordionItem, Button } from '@rocket.chat/fuselage'; -import { Field, FieldHint, FieldLabel, FieldRow, Select, ToggleSwitch } from '@rocket.chat/fuselage-forms'; +import { Field, FieldGroup, FieldHint, FieldLabel, FieldRow, Select, ToggleSwitch } from '@rocket.chat/fuselage-forms'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useSetting, useUserPreference, useUser } from '@rocket.chat/ui-contexts'; import { useCallback, useEffect, useId, useMemo, useState } from 'react'; @@ -93,106 +93,108 @@ const PreferencesNotificationsSection = () => { return ( - - {t('Desktop_Notifications')} - - {notificationsPermission === 'denied' && t('Desktop_Notifications_Disabled')} - {notificationsPermission === 'granted' && ( - - )} - {notificationsPermission !== 'denied' && notificationsPermission !== 'granted' && ( - - )} - - - - - {t('Notification_RequireInteraction')} - } - /> - - {t('Only_works_with_chrome_version_greater_50')} - - - {t('Notification_Desktop_Default_For')} - - } - /> - - - - {t('Email_Notification_Mode')} - - ( - } /> - )} - {showMobileRinging && ( + {t('Notification_Push_Default_For')} - {t('VideoConf_Mobile_Ringing')} } + render={({ field: { value, onChange } }) => + )} /> + + {canChangeEmailNotification && t('You_need_to_verifiy_your_email_address_to_get_notications')} + {!canChangeEmailNotification && t('Email_Notifications_Change_Disabled')} + - )} + {showNewLoginEmailPreference && ( + + + {t('Receive_Login_Detection_Emails')} + } + /> + + {t('Receive_Login_Detection_Emails_Description')} + + )} + {showCalendarPreference && ( + + + {t('Notify_Calendar_Events')} + } + /> + + + )} + {showMobileRinging && ( + + + {t('VideoConf_Mobile_Ringing')} + } + /> + + + )} + ); }; diff --git a/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx index 0c99b65ae1c69..6170cf896f46b 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx @@ -1,8 +1,7 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { Field, FieldHint, FieldLabel, FieldRow, Select, ToggleSwitch } from '@rocket.chat/fuselage-forms'; import { AccordionItem, Slider } from '@rocket.chat/fuselage'; -import type { TranslationKey } from '@rocket.chat/ui-contexts'; -import { useCustomSound, useTranslation } from '@rocket.chat/ui-contexts'; +import { Field, FieldGroup, FieldHint, FieldLabel, FieldRow, Select, ToggleSwitch } from '@rocket.chat/fuselage-forms'; +import { type TranslationKey, useCustomSound, useTranslation } from '@rocket.chat/ui-contexts'; import { Controller, useFormContext } from 'react-hook-form'; const PreferencesSoundSection = () => { @@ -15,109 +14,111 @@ const PreferencesSoundSection = () => { return ( - - {t('Master_volume')} - {t('Master_volume_hint')} - - } - /> - - - - {t('Notification_volume')} - {t('Notification_volume_hint')} - - ( - { - const soundVolume = (notificationsSoundVolume * masterVolume) / 100; - customSound.play(newMessageNotification, { volume: soundVolume / 100 }); - onChange(value); - }} - /> - )} - /> - - - - {t('Call_ringer_volume')} - {t('Call_ringer_volume_hint')} - - ( - { - const soundVolume = (voipRingerVolume * masterVolume) / 100; - customSound.play('telephone', { volume: soundVolume / 100 }); - onChange(value); - }} - /> - )} - /> - - - - {t('New_Room_Notification')} - - ( - { - onChange(value); - customSound.play(String(value), { volume: notificationsSoundVolume / 100 }); - }} - /> - )} - /> - - - - - {t('Mute_Focused_Conversations')} - } - /> - - + + + {t('Master_volume')} + {t('Master_volume_hint')} + + } + /> + + + + {t('Notification_volume')} + {t('Notification_volume_hint')} + + ( + { + const soundVolume = (notificationsSoundVolume * masterVolume) / 100; + customSound.play(newMessageNotification, { volume: soundVolume / 100 }); + onChange(value); + }} + /> + )} + /> + + + + {t('Call_ringer_volume')} + {t('Call_ringer_volume_hint')} + + ( + { + const soundVolume = (voipRingerVolume * masterVolume) / 100; + customSound.play('telephone', { volume: soundVolume / 100 }); + onChange(value); + }} + /> + )} + /> + + + + {t('New_Room_Notification')} + + ( + { + onChange(value); + customSound.play(String(value), { volume: notificationsSoundVolume / 100 }); + }} + /> + )} + /> + + + + + {t('Mute_Focused_Conversations')} + } + /> + + + ); }; diff --git a/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx index 82d5d5510ccdc..01ea46a3e92bc 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx @@ -1,5 +1,5 @@ -import { Field, FieldLabel, FieldRow, ToggleSwitch } from '@rocket.chat/fuselage-forms'; import { AccordionItem, NumberInput } from '@rocket.chat/fuselage'; +import { Field, FieldGroup, FieldLabel, FieldRow, ToggleSwitch } from '@rocket.chat/fuselage-forms'; import { useId } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; @@ -12,22 +12,24 @@ const PreferencesUserPresenceSection = () => { return ( - - - {t('Enable_Auto_Away')} - } - /> - - - - {t('Idle_Time_Limit')} - - - - + + + + {t('Enable_Auto_Away')} + } + /> + + + + {t('Idle_Time_Limit')} + + + + + ); }; diff --git a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx index 3876d74722d13..ec108093d00dc 100644 --- a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx +++ b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx @@ -153,7 +153,9 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle control={control} name='name' rules={{ required: requireName && t('Required_field', { field: t('Name') }) }} - render={({ field }) => } + render={({ field }) => ( + + )} /> {errors.name && {errors.name.message}} @@ -173,6 +175,7 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle render={({ field }) => ( } error={errors.username?.message} @@ -278,6 +281,7 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle render={({ field }) => ( } From 73325f2815dc4c45b06dfcd8eb70f8b73ba8fd45 Mon Sep 17 00:00:00 2001 From: gabriellsh Date: Wed, 30 Jul 2025 13:13:37 -0300 Subject: [PATCH 04/27] remove id --- .../account/preferences/PreferencesUserPresenceSection.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx index 01ea46a3e92bc..6b7ea39b0b5c0 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx @@ -1,6 +1,5 @@ import { AccordionItem, NumberInput } from '@rocket.chat/fuselage'; import { Field, FieldGroup, FieldLabel, FieldRow, ToggleSwitch } from '@rocket.chat/fuselage-forms'; -import { useId } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; @@ -8,8 +7,6 @@ const PreferencesUserPresenceSection = () => { const { t } = useTranslation(); const { register, control } = useFormContext(); - const idleTimeLimit = useId(); - return ( @@ -26,7 +23,7 @@ const PreferencesUserPresenceSection = () => { {t('Idle_Time_Limit')} - + From 9b8575c6cfba3811b905cea75c94c28f34fb6eac Mon Sep 17 00:00:00 2001 From: gabriellsh Date: Wed, 30 Jul 2025 13:14:35 -0300 Subject: [PATCH 05/27] update import --- .../account/preferences/PreferencesUserPresenceSection.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx index 6b7ea39b0b5c0..a8a859500ad3e 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx @@ -1,5 +1,5 @@ -import { AccordionItem, NumberInput } from '@rocket.chat/fuselage'; -import { Field, FieldGroup, FieldLabel, FieldRow, ToggleSwitch } from '@rocket.chat/fuselage-forms'; +import { AccordionItem } from '@rocket.chat/fuselage'; +import { Field, FieldGroup, FieldLabel, FieldRow, ToggleSwitch, NumberInput } from '@rocket.chat/fuselage-forms'; import { Controller, useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; From a81e433d972fce1ba746dab05864a5f3057f4e5d Mon Sep 17 00:00:00 2001 From: juliajforesti Date: Wed, 18 Mar 2026 13:23:28 -0300 Subject: [PATCH 06/27] feat: use `NumberInput` from fuselage-forms in `PreferencesUserPresenceSection` --- .../preferences/PreferencesUserPresenceSection.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx index a8a859500ad3e..f6fb4d7988b7f 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'; const PreferencesUserPresenceSection = () => { const { t } = useTranslation(); - const { register, control } = useFormContext(); + const { control } = useFormContext(); return ( @@ -23,7 +23,11 @@ const PreferencesUserPresenceSection = () => { {t('Idle_Time_Limit')} - + } + /> From 6b8c030fbd9933958a9c85600a98a8245a5c45aa Mon Sep 17 00:00:00 2001 From: juliajforesti Date: Thu, 19 Mar 2026 10:38:48 -0300 Subject: [PATCH 07/27] chore: use `Slider` from `fuselage-forms` --- .../views/account/preferences/PreferencesSoundSection.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx index 6170cf896f46b..a4fa3f123f3a4 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx @@ -1,6 +1,6 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { AccordionItem, Slider } from '@rocket.chat/fuselage'; -import { Field, FieldGroup, FieldHint, FieldLabel, FieldRow, Select, ToggleSwitch } from '@rocket.chat/fuselage-forms'; +import { AccordionItem } from '@rocket.chat/fuselage'; +import { Field, FieldGroup, FieldHint, FieldLabel, FieldRow, Select, ToggleSwitch, Slider } from '@rocket.chat/fuselage-forms'; import { type TranslationKey, useCustomSound, useTranslation } from '@rocket.chat/ui-contexts'; import { Controller, useFormContext } from 'react-hook-form'; @@ -38,7 +38,7 @@ const PreferencesSoundSection = () => { value={value} minValue={0} maxValue={100} - onChange={(value: number) => { + onChange={(value) => { const soundVolume = (notificationsSoundVolume * masterVolume) / 100; customSound.play(newMessageNotification, { volume: soundVolume / 100 }); onChange(value); @@ -60,7 +60,7 @@ const PreferencesSoundSection = () => { value={value} minValue={0} maxValue={100} - onChange={(value: number) => { + onChange={(value) => { const soundVolume = (voipRingerVolume * masterVolume) / 100; customSound.play('telephone', { volume: soundVolume / 100 }); onChange(value); From 6af5b951dc2eec197bf83845acf9bcc8b47a8a12 Mon Sep 17 00:00:00 2001 From: juliajforesti Date: Thu, 19 Mar 2026 10:39:02 -0300 Subject: [PATCH 08/27] chore: use `MultiSelect` from `fuselage-forms` --- .../account/preferences/PreferencesGlobalSection.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/meteor/client/views/account/preferences/PreferencesGlobalSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesGlobalSection.tsx index 6bc5468e02007..fcd75cd258dcd 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesGlobalSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesGlobalSection.tsx @@ -1,7 +1,7 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { AccordionItem, Field, FieldGroup, FieldLabel, FieldRow, MultiSelect } from '@rocket.chat/fuselage'; +import { AccordionItem } from '@rocket.chat/fuselage'; +import { Field, FieldGroup, FieldLabel, FieldRow, MultiSelect } from '@rocket.chat/fuselage-forms'; import { useUserPreference } from '@rocket.chat/ui-contexts'; -import { useId } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; @@ -12,21 +12,18 @@ const PreferencesGlobalSection = () => { const options: SelectOption[] = userDontAskAgainList.map(({ action, label }) => [action, label]); const { control } = useFormContext(); - const dontAskAgainListId = useId(); return ( - - {t('Dont_ask_me_again_list')} - + {t('Dont_ask_me_again_list')} ( - + )} /> From e145a9955ea3c7ace9b5c1aa49048ea8496c48f3 Mon Sep 17 00:00:00 2001 From: juliajforesti Date: Tue, 24 Mar 2026 16:26:27 -0300 Subject: [PATCH 09/27] chore: add type definitions to form fields in `PreferencesSoundSection` --- .../account/preferences/PreferencesSoundSection.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx index a4fa3f123f3a4..a86976ba5db88 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx @@ -9,7 +9,14 @@ const PreferencesSoundSection = () => { const customSound = useCustomSound(); const soundsList: SelectOption[] = customSound.list?.map((value) => [value._id, t(value.name as TranslationKey)]) || []; - const { control, watch } = useFormContext(); + const { control, watch } = useFormContext<{ + newMessageNotification: string; + notificationsSoundVolume: number; + masterVolume: number; + voipRingerVolume: number; + newRoomNotification: string; + muteFocusedConversations: boolean; + }>(); const { newMessageNotification, notificationsSoundVolume = 100, masterVolume = 100, voipRingerVolume = 100 } = watch(); return ( From b14967f2b55abdd236247581c46e4262a6f8bed5 Mon Sep 17 00:00:00 2001 From: juliajforesti Date: Thu, 26 Mar 2026 14:32:34 -0300 Subject: [PATCH 10/27] chore: only add `required` field prop when `requireName` is truthy --- .../views/account/profile/AccountProfileForm.tsx | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx index ec108093d00dc..475431811f83b 100644 --- a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx +++ b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx @@ -137,17 +137,9 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle /> - + - {t('Name')} + {t('Name')} ): ReactEle {t('Email')} Date: Fri, 27 Mar 2026 16:03:47 -0300 Subject: [PATCH 11/27] chore: apply fuselage-forms in `omnichannel` account preferences --- .../PreferencesConversationTranscript.tsx | 39 +++++++------------ .../omnichannel/PreferencesGeneral.tsx | 8 ++-- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/apps/meteor/client/views/account/omnichannel/PreferencesConversationTranscript.tsx b/apps/meteor/client/views/account/omnichannel/PreferencesConversationTranscript.tsx index 35b7b55cafa16..5173985d675e1 100644 --- a/apps/meteor/client/views/account/omnichannel/PreferencesConversationTranscript.tsx +++ b/apps/meteor/client/views/account/omnichannel/PreferencesConversationTranscript.tsx @@ -1,6 +1,6 @@ -import { AccordionItem, Box, Field, FieldGroup, FieldLabel, FieldRow, FieldHint, Tag, ToggleSwitch } from '@rocket.chat/fuselage'; +import { AccordionItem, Tag } from '@rocket.chat/fuselage'; +import { Field, FieldGroup, FieldLabel, FieldRow, FieldHint, ToggleSwitch } from '@rocket.chat/fuselage-forms'; import { useTranslation, usePermission, useSetting } from '@rocket.chat/ui-contexts'; -import { useId } from 'react'; import { useFormContext } from 'react-hook-form'; import { useHasLicenseModule } from '../../../hooks/useHasLicenseModule'; @@ -17,40 +17,31 @@ const PreferencesConversationTranscript = () => { const canSendTranscriptEmail = canSendTranscriptEmailPermission && !alwaysSendEmailTranscript; const cantSendTranscriptPDF = !canSendTranscriptPDF || !hasLicense; - const omnichannelTranscriptPDF = useId(); - const omnichannelTranscriptEmail = useId(); - return ( - - - {t('Omnichannel_transcript_pdf')} - - {!hasLicense && {t('Premium')}} - {!canSendTranscriptPDF && hasLicense && {t('No_permission')}} - - + + {t('Omnichannel_transcript_pdf')} + {!hasLicense && ( + + {t('Premium')} + + )} + {!canSendTranscriptPDF && hasLicense && {t('No_permission')}} - + {t('Accounts_Default_User_Preferences_omnichannelTranscriptPDF_Description')} - - - {t('Omnichannel_transcript_email')} - {!canSendTranscriptEmailPermission && ( - - {t('No_permission')} - - )} - + + {t('Omnichannel_transcript_email')} + {!canSendTranscriptEmailPermission && {t('No_permission')}} - + {t('Accounts_Default_User_Preferences_omnichannelTranscriptEmail_Description')} diff --git a/apps/meteor/client/views/account/omnichannel/PreferencesGeneral.tsx b/apps/meteor/client/views/account/omnichannel/PreferencesGeneral.tsx index ade5f3435715b..786c1053f25e2 100644 --- a/apps/meteor/client/views/account/omnichannel/PreferencesGeneral.tsx +++ b/apps/meteor/client/views/account/omnichannel/PreferencesGeneral.tsx @@ -1,5 +1,4 @@ -import { Field, FieldGroup, FieldHint, FieldLabel, FieldRow, ToggleSwitch } from '@rocket.chat/fuselage'; -import { useId } from 'react'; +import { Field, FieldGroup, FieldHint, FieldLabel, FieldRow, ToggleSwitch } from '@rocket.chat/fuselage-forms'; import type { ReactElement } from 'react'; import { useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; @@ -7,14 +6,13 @@ import { useTranslation } from 'react-i18next'; export const PreferencesGeneral = (): ReactElement => { const { t } = useTranslation(); const { register } = useFormContext(); - const omnichannelHideAfterClosing = useId(); return ( - {t('Omnichannel_hide_conversation_after_closing')} - + {t('Omnichannel_hide_conversation_after_closing')} + {t('Omnichannel_hide_conversation_after_closing_description')} From 492ad98f2932e79eeb8390cbae5a79dc8c3ed6a1 Mon Sep 17 00:00:00 2001 From: juliajforesti Date: Fri, 27 Mar 2026 16:04:02 -0300 Subject: [PATCH 12/27] chore: add id associations for accessibility in `PreferencesMessagesSection` links --- .../PreferencesMessagesSection.tsx | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx index f11d8236974c5..afd1cd61a6908 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx @@ -1,13 +1,20 @@ import type { SelectOption } from '@rocket.chat/fuselage'; import { AccordionItem } from '@rocket.chat/fuselage'; import { Field, FieldGroup, FieldHint, FieldLabel, FieldLink, FieldRow, Select, ToggleSwitch } from '@rocket.chat/fuselage-forms'; -import { useMemo } from 'react'; +import { useId, useMemo } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; const PreferencesMessagesSection = () => { const { t } = useTranslation(); const { control } = useFormContext(); + // Remove id associations after `FieldLink` is added to fuselage-forms + const messageTimeFormatLabelId = useId(); + const messageTimeFormatLinkId = useId(); + const hideUsernamesLabelId = useId(); + const hideUsernamesLinkId = useId(); + const hideRolesLabelId = useId(); + const hideRolesLinkId = useId(); const alsoSendThreadMessageToChannelOptions = useMemo( (): SelectOption[] => [ @@ -65,8 +72,10 @@ const PreferencesMessagesSection = () => { {t('Accounts_Default_User_Preferences_alsoSendThreadToChannel_Description')} - {t('Message_TimeFormat')} - {t('Go_to_accessibility_and_appearance')} + {t('Message_TimeFormat')} + + {t('Go_to_accessibility_and_appearance')} + @@ -119,12 +128,16 @@ const PreferencesMessagesSection = () => { - {t('Hide_usernames')} - {t('Go_to_accessibility_and_appearance')} + {t('Hide_usernames')} + + {t('Go_to_accessibility_and_appearance')} + - {t('Hide_roles')} - {t('Go_to_accessibility_and_appearance')} + {t('Hide_roles')} + + {t('Go_to_accessibility_and_appearance')} + From f966cbcd7f7e862010ecc65dc8eda111053cc9b3 Mon Sep 17 00:00:00 2001 From: juliajforesti Date: Fri, 27 Mar 2026 16:13:46 -0300 Subject: [PATCH 13/27] chore: apply `Select` from `fuselage-forms` in `AccountIntegrationsPage` --- .../account/integrations/AccountIntegrationsPage.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx b/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx index eb62c25d8077f..e3295f9faa490 100644 --- a/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx +++ b/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx @@ -1,6 +1,6 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { SelectLegacy, Box, Button, Field, FieldLabel, FieldRow, FieldError } from '@rocket.chat/fuselage'; -import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; +import { Box, Button } from '@rocket.chat/fuselage'; +import { Select, Field, FieldLabel, FieldRow, FieldError } from '@rocket.chat/fuselage-forms'; import { Page, PageHeader, PageScrollableContentWithShadow } from '@rocket.chat/ui-client'; import { useToastMessageDispatch } from '@rocket.chat/ui-contexts'; import { useId, useMemo } from 'react'; @@ -37,9 +37,9 @@ const AccountIntegrationsPage = () => { }, }); - const handleSubmitForm = useEffectEvent(({ accountSelected }: { accountSelected: string }) => { + const handleSubmitForm = ({ accountSelected }: { accountSelected: string }) => { removeMutation.mutate({ accountSelected }); - }); + }; const accountSelectedId = useId(); @@ -55,7 +55,7 @@ const AccountIntegrationsPage = () => { control={control} name='accountSelected' rules={{ required: t('Required_field', { field: t('WebDAV_Accounts') }) }} - render={({ field }) => } + render={({ field }) => } /> - {t('Notification_Desktop_Default_For')} + {t('Notification_Desktop_show_voice_calls')} } - /> + - )} + render={({ field }) => } - /> + } - /> + - )} + render={({ field: { value, ...field } }) => } + render={({ field }) => } + render={({ field }) => - )} + render={({ field }) => { onChange(value); @@ -102,9 +98,9 @@ const PreferencesSoundSection = () => { ( + render={({ field: { onChange, ...field } }) => (