Skip to content

Commit

Permalink
[BREAK] Remove message view mode from User Preferences (#27867)
Browse files Browse the repository at this point in the history
Co-authored-by: Yash Rajpal <58601732+yash-rajpal@users.noreply.github.com>
  • Loading branch information
hugocostadev and yash-rajpal committed Feb 9, 2023
1 parent 85e2af9 commit 082c048
Show file tree
Hide file tree
Showing 67 changed files with 13 additions and 522 deletions.
20 changes: 0 additions & 20 deletions apps/meteor/app/lib/server/startup/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,26 +467,6 @@ settingsRegistry.addGroup('Accounts', function () {
public: true,
i18nLabel: 'Enter_Behaviour',
});

this.add('Accounts_Default_User_Preferences_messageViewMode', 0, {
type: 'select',
values: [
{
key: 0,
i18nLabel: 'Normal',
},
{
key: 1,
i18nLabel: 'Cozy',
},
{
key: 2,
i18nLabel: 'Compact',
},
],
public: true,
i18nLabel: 'MessageBox_view_mode',
});
this.add('Accounts_Default_User_Preferences_emailNotificationMode', 'mentions', {
type: 'select',
values: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type CurrentData = {
pushNotifications: string;
enableAutoAway: boolean;
highlights: string;
messageViewMode: number;
hideUsernames: boolean;
hideRoles: boolean;
displayAvatars: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ type Values = {
displayAvatars: boolean;
clockMode: 0 | 1 | 2;
sendOnEnter: 'normal' | 'alternative' | 'desktop';
messageViewMode: 0 | 1 | 2;
};

const PreferencesMessagesSection = ({ onChange, commitRef, ...props }: FormSectionProps): ReactElement => {
Expand All @@ -42,7 +41,6 @@ const PreferencesMessagesSection = ({ onChange, commitRef, ...props }: FormSecti
hideFlexTab: useUserPreference('hideFlexTab'),
clockMode: useUserPreference('clockMode') ?? 0,
sendOnEnter: useUserPreference('sendOnEnter'),
messageViewMode: useUserPreference('messageViewMode'),
displayAvatars: useUserPreference('displayAvatars'),
};

Expand All @@ -62,7 +60,6 @@ const PreferencesMessagesSection = ({ onChange, commitRef, ...props }: FormSecti
displayAvatars,
clockMode,
sendOnEnter,
messageViewMode,
} = values as Values;

const {
Expand All @@ -79,7 +76,6 @@ const PreferencesMessagesSection = ({ onChange, commitRef, ...props }: FormSecti
handleDisplayAvatars,
handleClockMode,
handleSendOnEnter,
handleMessageViewMode,
} = handlers;

const alsoSendThreadMessageToChannelOptions = useMemo(
Expand Down Expand Up @@ -109,15 +105,6 @@ const PreferencesMessagesSection = ({ onChange, commitRef, ...props }: FormSecti
[t],
);

const messageViewModeOptions = useMemo(
(): SelectOption[] => [
[0 as any, t('Normal')], // TO DO: update SelectOption type to accept number as first item
[1, t('Cozy')],
[2, t('Compact')],
],
[t],
);

commitRef.current.messages = commit;

// TODO: Weird behaviour when saving clock mode, and then changing it.
Expand Down Expand Up @@ -275,18 +262,6 @@ const PreferencesMessagesSection = ({ onChange, commitRef, ...props }: FormSecti
),
[handleSendOnEnter, sendOnEnter, sendOnEnterOptions, t],
)}
{useMemo(
() => (
<Field>
<Field.Label>{t('View_mode')}</Field.Label>
<Field.Row>
<Select value={messageViewMode} onChange={handleMessageViewMode} options={messageViewModeOptions} />
</Field.Row>
<Field.Hint>{t('Message_view_mode_info')}</Field.Hint>
</Field>
),
[handleMessageViewMode, messageViewMode, messageViewModeOptions, t],
)}
</FieldGroup>
</Accordion.Item>
);
Expand Down
11 changes: 1 addition & 10 deletions apps/meteor/client/views/room/components/body/RoomBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ const RoomBody = (): ReactElement => {
const hideUsernames = useUserPreference<boolean>('hideUsernames');
const displayAvatars = useUserPreference<boolean>('displayAvatars');
const useLegacyMessageTemplate = useUserPreference<boolean>('useLegacyMessageTemplate') ?? false;
const viewMode = useUserPreference<number>('messageViewMode');

const wrapperRef = useRef<HTMLDivElement | null>(null);
const messagesBoxRef = useRef<HTMLDivElement | null>(null);
Expand Down Expand Up @@ -128,11 +127,6 @@ const RoomBody = (): ReactElement => {

const uploads = useSyncExternalStore(chat.uploads.subscribe, chat.uploads.get);

const messageViewMode = useMemo(() => {
const modes = ['', 'cozy', 'compact'] as const;
return modes[viewMode ?? 0] ?? modes[0];
}, [viewMode]);

const { hasMorePreviousMessages, hasMoreNextMessages, isLoadingMoreMessages } = useRoomMessages();

const allowAnonymousRead = useSetting('Accounts_AllowAnonymousRead') as boolean | undefined;
Expand Down Expand Up @@ -580,10 +574,7 @@ const RoomBody = (): ReactElement => {
/>
))}
</div>
<div
ref={messagesBoxRef}
className={['messages-box', messageViewMode, roomLeader && 'has-leader'].filter(isTruthy).join(' ')}
>
<div ref={messagesBoxRef} className={['messages-box', roomLeader && 'has-leader'].filter(isTruthy).join(' ')}>
<NewMessagesButton visible={hasNewMessages} onClick={handleNewMessageButtonClick} />
<JumpToRecentMessagesBar visible={hasMoreNextMessages} onClick={handleJumpToRecentButtonClick} />
{!canPreview ? (
Expand Down
8 changes: 0 additions & 8 deletions apps/meteor/packages/rocketchat-i18n/i18n/af.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@
"Comment_to_leave_on_closing_session": "Lewer kommentaar om op die sessie te verlaat",
"Common_Access": "Gemeenskaplike toegang",
"Community": "Gemeenskap",
"Compact": "Kompakte",
"Condensed": "verkorte",
"Computer": "rekenaar",
"Confirm_new_password": "Bevestig nuwe wagwoord",
Expand Down Expand Up @@ -795,7 +794,6 @@
"Country_Yemen": "Jemen",
"Country_Zambia": "Zambië",
"Country_Zimbabwe": "Zimbabwe",
"Cozy": "Snoesig",
"Create": "Skep",
"Create_A_New_Channel": "Skep 'n nuwe kanaal",
"Create_new": "Skep 'n nuwe",
Expand Down Expand Up @@ -1750,7 +1748,6 @@
"Message_too_long": "Boodskap te lank",
"Message_VideoRecorderEnabled": "Video-opnemer geaktiveer",
"Message_VideoRecorderEnabledDescription": "Vereis 'video / webm'-lêers om 'n aanvaarde media tipe te wees binne' Lêeroplaaier 'instellings.",
"Message_view_mode_info": "Dit verander die hoeveelheid spasie boodskappe wat op die skerm opgeneem word.",
"messages": "boodskappe",
"Messages": "boodskappe",
"Messages_that_are_sent_to_the_Incoming_WebHook_will_be_posted_here": "Boodskappe wat na die Inkomende WebHook gestuur word, sal hier verskyn.",
Expand Down Expand Up @@ -1838,7 +1835,6 @@
"Node_version": "Node Weergawe",
"None": "Geen",
"Nonprofit": "winsgewende",
"Normal": "Normaal",
"Not_authorized": "Nie gemagtig nie",
"Not_Available": "Nie beskikbaar nie",
"Not_found_or_not_allowed": "Nie gevind of nie toegelaat nie",
Expand Down Expand Up @@ -2459,11 +2455,8 @@
"theme-color-status-offline": "Vanlyn Status Kleur",
"theme-color-status-online": "Aanlyn status kleur",
"theme-color-success-color": "Sukses Kleur",
"theme-color-tertiary-font-color": "Tersiêre Font Kleur",
"theme-color-transparent-dark": "Deursigtige Donker",
"theme-color-transparent-darker": "Deursigtiger Donker",
"theme-color-transparent-light": "Deursigtige Lig",
"theme-color-transparent-lighter": "Deursigtige aansteker",
"theme-color-transparent-lightest": "Deursigtigste Ligste",
"theme-color-unread-notification-color": "Ongelees kennisgewings Kleur",
"theme-custom-css": "Aangepaste CSS",
Expand Down Expand Up @@ -2675,7 +2668,6 @@
"Videocall_declined": "Video-oproep geweier.",
"View_All": "Bekyk alle lede",
"View_Logs": "Bekyk logs",
"View_mode": "Kyk af",
"view-broadcast-member-list": "Kyk na Lede Lys in Uitsaaikamer",
"view-c-room": "Bekyk publieke kanaal",
"view-c-room_description": "Toestemming om publieke kanale te sien",
Expand Down
9 changes: 0 additions & 9 deletions apps/meteor/packages/rocketchat-i18n/i18n/ar.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,6 @@
"Comment": "تعليق",
"Common_Access": "الوصول المشترك",
"Community": "المجتمع",
"Compact": "مدمج",
"Composer_not_available_phone_calls": "الرسائل غير متوافرة في المكالمات الهاتفية",
"Condensed": "مكثف",
"Condition": "حالة",
Expand Down Expand Up @@ -1263,7 +1262,6 @@
"Country_Yemen": "اليمن",
"Country_Zambia": "زامبيا",
"Country_Zimbabwe": "زيمبابوي",
"Cozy": "كوزي",
"Create": "إنشاء",
"Create_Canned_Response": "إنشاء رد مسجَّل",
"Create_channel": "إنشاء Channel",
Expand Down Expand Up @@ -3020,8 +3018,6 @@
"Message_UserId": "معرّف المستخدم",
"Message_VideoRecorderEnabled": "تم تمكين مُسجّل الفيديو",
"Message_VideoRecorderEnabledDescription": "يتطلب أن تكون ملفات \"video/webm\" نوع وسائط مقبولاً ضمن إعدادات \"تحميل الملف\".",
"Message_view_mode_info": "هذا يغير مقدار المساحة التي تشغلها الرسائل على الشاشة.",
"MessageBox_view_mode": "وضع عرض MessageBox",
"messages": "الرسائل",
"Messages": "الرسائل",
"Messages_sent": "تم إرسال الرسائل",
Expand Down Expand Up @@ -3189,7 +3185,6 @@
"Node_version": "إصدار العقدة",
"None": "لا يوجد",
"Nonprofit": "غير ربحية",
"Normal": "عادي",
"Not_authorized": "غير مخول",
"Not_Available": "غير متاح",
"Not_enough_data": "لا توجد بيانات كافية",
Expand Down Expand Up @@ -4289,11 +4284,8 @@
"theme-color-status-offline": "لون الحالة غير متصل",
"theme-color-status-online": "لون الحالة متصل",
"theme-color-success-color": "لون النجاح",
"theme-color-tertiary-font-color": "لون الخط الثلاثي",
"theme-color-transparent-dark": "شفاف داكن",
"theme-color-transparent-darker": "شفاف أدكن",
"theme-color-transparent-light": "شفاف فاتح",
"theme-color-transparent-lighter": "شفاف أفتح",
"theme-color-transparent-lightest": "الشفاف الأفتح",
"theme-color-unread-notification-color": "لون الإشعارات غير المقروءة",
"theme-custom-css": "CSS المخصصة",
Expand Down Expand Up @@ -4658,7 +4650,6 @@
"view-omnichannel-contact-center": "عرض مركز اتصال القناة متعددة الاتجاهات",
"view-omnichannel-contact-center_description": "إذن لعرض مركز اتصال القناة متعددة الاتجاهات والتفاعل معه",
"View_Logs": "عرض السجلات",
"View_mode": "عرض الوضع",
"View_original": "عرض الأصل",
"View_the_Logs_for": "عرض سجلات: \"__name__\"",
"view-broadcast-member-list": "عرض قائمة الأعضاء في Room البث",
Expand Down
8 changes: 0 additions & 8 deletions apps/meteor/packages/rocketchat-i18n/i18n/az.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@
"Comment_to_leave_on_closing_session": "Yekun iclasda buraxın Şərh",
"Common_Access": "Ümumi Erişim",
"Community": "İcma",
"Compact": "Kompakt",
"Condensed": "Kondensasiya edilmişdir",
"Computer": "Kompüter",
"Confirm_new_password": "Yeni Şifrəni təsdiq",
Expand Down Expand Up @@ -795,7 +794,6 @@
"Country_Yemen": "Yəmən",
"Country_Zambia": "Zambiya",
"Country_Zimbabwe": "Zimbabve",
"Cozy": "Rahat",
"Create": "Yaradın",
"Create_A_New_Channel": "Yeni bir kanal yaradın",
"Create_new": "Yeni yaradın",
Expand Down Expand Up @@ -1750,7 +1748,6 @@
"Message_too_long": "Mesaj çox uzun",
"Message_VideoRecorderEnabled": "Video yazma qurğusu aktivdir",
"Message_VideoRecorderEnabledDescription": "'Fayl yüklə' parametrləri daxilində qəbul edilən media növü olmaq üçün 'video / webm' faylları tələb olunur.",
"Message_view_mode_info": "Bu, yer mesajlarının ekranda çəkilməsini azaldır.",
"messages": "Mesajlar",
"Messages": "Mesajlar",
"Messages_that_are_sent_to_the_Incoming_WebHook_will_be_posted_here": "Daxil olan WebHook-a göndərilən mesajlar burada yerləşdiriləcək.",
Expand Down Expand Up @@ -1838,7 +1835,6 @@
"Node_version": "Node Sürüm",
"None": "Yoxdur",
"Nonprofit": "Nonprofit",
"Normal": "Normal",
"Not_authorized": "Səlahiyyətli deyil",
"Not_Available": "Mövcud deyil",
"Not_found_or_not_allowed": "Tapılmadı ya da icazə verilmədi",
Expand Down Expand Up @@ -2459,11 +2455,8 @@
"theme-color-status-offline": "Offline Durumu Rəngi",
"theme-color-status-online": "Online Status Rəng",
"theme-color-success-color": "Müvəffəqiyyət Rəngi",
"theme-color-tertiary-font-color": "Tersiar Font Rəngi",
"theme-color-transparent-dark": "Şəffaf Qara",
"theme-color-transparent-darker": "Şəffaf Darker",
"theme-color-transparent-light": "Şəffaf İşıq",
"theme-color-transparent-lighter": "Şəffaf Çakmak",
"theme-color-transparent-lightest": "Şəffaf Yüngül",
"theme-color-unread-notification-color": "Oxunmamış Bildirişlər Rəngi",
"theme-custom-css": "Xüsusi CSS",
Expand Down Expand Up @@ -2675,7 +2668,6 @@
"Videocall_declined": "Video Çağırıldı.",
"View_All": "Bütün üzvləri bax",
"View_Logs": "Günlükləri bax",
"View_mode": "Görünüş Modu",
"view-broadcast-member-list": "Yayım salonunda üzvlərin siyahısını baxın",
"view-c-room": "İctimai Kanala baxın",
"view-c-room_description": "İctimai kanalları görmək icazəsi",
Expand Down
8 changes: 0 additions & 8 deletions apps/meteor/packages/rocketchat-i18n/i18n/be-BY.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,6 @@
"Comment_to_leave_on_closing_session": "Каментар да Пакінуць на закрыццё сесіі",
"Common_Access": "Агульны доступ",
"Community": "супольнасць",
"Compact": "кампактны",
"Condensed": "згушчаныя",
"Computer": "кампутар",
"Confirm_new_password": "Пацвердзіце новы пароль",
Expand Down Expand Up @@ -814,7 +813,6 @@
"Country_Yemen": "Емен",
"Country_Zambia": "Замбія",
"Country_Zimbabwe": "Зімбабвэ",
"Cozy": "ўтульны",
"Create": "стварыць",
"Create_A_New_Channel": "Стварыць новы канал",
"Create_new": "стварыць новы",
Expand Down Expand Up @@ -1766,7 +1764,6 @@
"Message_too_long": "Занадта доўгае паведамленне",
"Message_VideoRecorderEnabled": "Video Recorder Enabled",
"Message_VideoRecorderEnabledDescription": "Патрабуецца «/ WebM відэа» файлы, каб быць прынятым тыпам носьбіта ў наладах «File Upload».",
"Message_view_mode_info": "Гэта змяняе колькасць касмічных паведамленняў займае на экране.",
"messages": "паведамлення",
"Messages": "паведамлення",
"Messages_that_are_sent_to_the_Incoming_WebHook_will_be_posted_here": "Паведамленні, адпраўленыя на Уваходная WebHook будуць размешчаны тут.",
Expand Down Expand Up @@ -1854,7 +1851,6 @@
"Node_version": "вузел Версія",
"None": "ні",
"Nonprofit": "некамерцыйны",
"Normal": "нармаль",
"Not_authorized": "забаронена",
"Not_Available": "Не даступны",
"Not_found_or_not_allowed": "Не знойдзена ці не дазволена",
Expand Down Expand Up @@ -2477,11 +2473,8 @@
"theme-color-status-offline": "Offline Колер Статус",
"theme-color-status-online": "Інтэрнэт Колер Стан",
"theme-color-success-color": "поспех Колер",
"theme-color-tertiary-font-color": "Троесны колер шрыфта",
"theme-color-transparent-dark": "празрысты Цёмны",
"theme-color-transparent-darker": "празрысты Цямней",
"theme-color-transparent-light": "празрысты святло",
"theme-color-transparent-lighter": "празрыстая запальнічка",
"theme-color-transparent-lightest": "празрысты лёгкі",
"theme-color-unread-notification-color": "Непрачытаных Апавяшчэнні Color",
"theme-custom-css": "прыстасаваныя CSS",
Expand Down Expand Up @@ -2693,7 +2686,6 @@
"Videocall_declined": "Відэазванок Адхілена.",
"View_All": "Прагляд ўсіх удзельнікаў",
"View_Logs": "прагляд часопісаў",
"View_mode": "рэжым прагляду",
"view-broadcast-member-list": "Прагляд Карыстальнікі ў Broadcast нумары",
"view-c-room": "паглядзець канал",
"view-c-room_description": "Дазвол для прагляду грамадскіх каналаў",
Expand Down
8 changes: 0 additions & 8 deletions apps/meteor/packages/rocketchat-i18n/i18n/bg.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@
"Comment_to_leave_on_closing_session": "Коментар за напускане на закрито заседание",
"Common_Access": "Общ достъп",
"Community": "общност",
"Compact": "компактен",
"Condensed": "Condensed",
"Computer": "компютър",
"Confirm_new_password": "Потвърждение на новата парола",
Expand Down Expand Up @@ -795,7 +794,6 @@
"Country_Yemen": "Йемен",
"Country_Zambia": "Замбия",
"Country_Zimbabwe": "Зимбабве",
"Cozy": "Уютен",
"Create": "Създавам",
"Create_A_New_Channel": "Създайте нов канал",
"Create_new": "Създай нов",
Expand Down Expand Up @@ -1747,7 +1745,6 @@
"Message_too_long": "Съобщението е твърде дълго",
"Message_VideoRecorderEnabled": "Видеорекордерът е активиран",
"Message_VideoRecorderEnabledDescription": "Изисква файловете \"видео / уеб\" да бъдат приети типове медии в настройките \"Качване на файлове\".",
"Message_view_mode_info": "Това променя броя на космическите съобщения, които се заемат на екрана.",
"messages": "Съобщения",
"Messages": "Съобщения",
"Messages_that_are_sent_to_the_Incoming_WebHook_will_be_posted_here": "Съобщенията, които се изпращат в Incoming WebHook, ще бъдат публикувани тук.",
Expand Down Expand Up @@ -1835,7 +1832,6 @@
"Node_version": "Версия на възел",
"None": "Нито един",
"Nonprofit": "организации с нестопанска цел",
"Normal": "нормален",
"Not_authorized": "Неоторизиран",
"Not_Available": "Не е наличен",
"Not_found_or_not_allowed": "Не е намерено или не е разрешено",
Expand Down Expand Up @@ -2455,11 +2451,8 @@
"theme-color-status-offline": "Офлайн статус цвят",
"theme-color-status-online": "Цвят на състоянието онлайн",
"theme-color-success-color": "Цвят на успеха",
"theme-color-tertiary-font-color": "Териториален цвят на шрифта",
"theme-color-transparent-dark": "Прозрачно тъмно",
"theme-color-transparent-darker": "Прозрачно тъмно",
"theme-color-transparent-light": "Прозрачна светлина",
"theme-color-transparent-lighter": "Прозрачна запалка",
"theme-color-transparent-lightest": "Прозрачно най-светло",
"theme-color-unread-notification-color": "Непрочетени цветове за известия",
"theme-custom-css": "Персонализиран CSS",
Expand Down Expand Up @@ -2670,7 +2663,6 @@
"Videocall_declined": "Отхвърлено видеообаждане.",
"View_All": "Преглед на всички членове",
"View_Logs": "Преглед на регистрационните файлове",
"View_mode": "Режим на преглед",
"view-broadcast-member-list": "Вижте списъка с членовете в стаята за разговори",
"view-c-room": "Преглед на обществения канал",
"view-c-room_description": "Разрешение за преглед на обществени канали",
Expand Down

0 comments on commit 082c048

Please sign in to comment.