Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BREAK] Remove message view mode from User Preferences #27867

Merged
merged 14 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -565,10 +559,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
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/af.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2676,7 +2676,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 Expand Up @@ -2806,4 +2805,4 @@
"registration.component.form.password": "wagwoord",
"registration.component.form.divider": "of",
"registration.component.form.submit": "Indien"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/ar.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -4661,7 +4661,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 Expand Up @@ -4990,4 +4989,4 @@
"onboarding.form.standaloneServerForm.servicesUnavailable": "لن تكون بعض الخدمات متاحة أو ستتطلب إعدادًا يدويًا",
"onboarding.form.standaloneServerForm.publishOwnApp": "لإرسال الإشعارات، تحتاج إلى تجميع تطبيقك الخاص ونشره على Google Play وApp Store",
"onboarding.form.standaloneServerForm.manuallyIntegrate": "تحتاج إلى التكامل مع الخدمات الخارجية يدويًا"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/az.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2676,7 +2676,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 Expand Up @@ -2806,4 +2805,4 @@
"registration.component.form.password": "Şifrə",
"registration.component.form.divider": "və ya",
"registration.component.form.submit": "təqdim"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/be-BY.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2694,7 +2694,6 @@
"Videocall_declined": "Відэазванок Адхілена.",
"View_All": "Прагляд ўсіх удзельнікаў",
"View_Logs": "прагляд часопісаў",
"View_mode": "рэжым прагляду",
"view-broadcast-member-list": "Прагляд Карыстальнікі ў Broadcast нумары",
"view-c-room": "паглядзець канал",
"view-c-room_description": "Дазвол для прагляду грамадскіх каналаў",
Expand Down Expand Up @@ -2824,4 +2823,4 @@
"registration.component.form.password": "пароль",
"registration.component.form.divider": "або",
"registration.component.form.submit": "прадставіць"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/bg.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2671,7 +2671,6 @@
"Videocall_declined": "Отхвърлено видеообаждане.",
"View_All": "Преглед на всички членове",
"View_Logs": "Преглед на регистрационните файлове",
"View_mode": "Режим на преглед",
"view-broadcast-member-list": "Вижте списъка с членовете в стаята за разговори",
"view-c-room": "Преглед на обществения канал",
"view-c-room_description": "Разрешение за преглед на обществени канали",
Expand Down Expand Up @@ -2798,4 +2797,4 @@
"registration.component.form.password": "Парола",
"registration.component.form.divider": "или",
"registration.component.form.submit": "Подайте"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/bs.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2667,7 +2667,6 @@
"Videocall_declined": "Videopoziv odbijen",
"View_All": "Prikaži Sve",
"View_Logs": "Pogledaj izvještaje",
"View_mode": "Pregled",
"view-broadcast-member-list": "Pogledajte popis članova u sobi za emitiranje",
"view-c-room": "Pogledajte javni kanal",
"view-c-room_description": "Dopuštenje za prikaz javnih kanala",
Expand Down Expand Up @@ -2794,4 +2793,4 @@
"registration.component.form.password": "Lozinka",
"registration.component.form.divider": "ili",
"registration.component.form.submit": "Pošalji"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/ca.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -4577,7 +4577,6 @@
"view-omnichannel-contact-center": "Veure centre de contacte Livechat",
"view-omnichannel-contact-center_description": "Permís per veure i interactuar amb el centre de contacte Livechat",
"View_Logs": "Veure registre log",
"View_mode": "Mode de vista",
"View_original": "Veure original",
"View_the_Logs_for": "Veure els registres de: \"__name__\"",
"view-broadcast-member-list": "Veure llista de membres a la sala de transmissió",
Expand Down Expand Up @@ -4794,4 +4793,4 @@
"registration.component.form.password": "Contrasenya",
"registration.component.form.divider": "o",
"registration.component.form.submit": "Envia"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/cs.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3848,7 +3848,6 @@
"Videos": "Videa",
"View_All": "Zobrazit všechny členy",
"View_Logs": "Zobrazit logy",
"View_mode": "Režim zobrazení",
"View_original": "Zobrazit originál",
"View_the_Logs_for": "Zobrazit logy pro: \"__name__\"",
"view-broadcast-member-list": "Zobrazit Seznam uživatelů v místnosti",
Expand Down Expand Up @@ -4031,4 +4030,4 @@
"registration.component.form.password": "Heslo",
"registration.component.form.divider": "nebo",
"registration.component.form.submit": "Odeslat"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/cy.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2669,7 +2669,6 @@
"Videocall_declined": "Gwrthodwyd Galwad Fideo.",
"View_All": "Gweld yr holl Aelodau",
"View_Logs": "Gweld Logiau",
"View_mode": "Modd Gweld",
"view-broadcast-member-list": "Gweld Rhestr Aelodau yn yr Ystafell Ddarlledu",
"view-c-room": "Gweld Sianel Gyhoeddus",
"view-c-room_description": "Caniatâd i weld sianeli cyhoeddus",
Expand Down Expand Up @@ -2797,4 +2796,4 @@
"registration.component.form.password": "Cyfrinair",
"registration.component.form.divider": "neu",
"registration.component.form.submit": "Cyflwyno"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/da.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3870,7 +3870,6 @@
"Videos": "Videoer",
"View_All": "Se alle medlemmer",
"View_Logs": "Se logfiler",
"View_mode": "Visning",
"View_original": "Se oprindelig",
"View_the_Logs_for": "Se logfilerne for: \"__name__\"",
"view-broadcast-member-list": "Se Medlemsliste i Broadcast Room",
Expand Down Expand Up @@ -4054,4 +4053,4 @@
"registration.component.form.password": "Adgangskode",
"registration.component.form.divider": "eller",
"registration.component.form.submit": "Indsend"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/de-AT.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2676,7 +2676,6 @@
"Videocall_declined": "Videoanruf abgelehnt.",
"View_All": "Alle ansehen",
"View_Logs": "Logs anzeigen",
"View_mode": "Ansichts-Modus",
"view-broadcast-member-list": "Zeigen Sie die Mitgliederliste im Broadcast-Raum an",
"view-c-room": "Öffentlichen Kanal anzeigen",
"view-c-room_description": "Berechtigung zum Anzeigen öffentlicher Kanäle",
Expand Down Expand Up @@ -2805,4 +2804,4 @@
"registration.component.form.password": "Passwort",
"registration.component.form.divider": "oder",
"registration.component.form.submit": "Abschicken"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/de-IN.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3048,7 +3048,6 @@
"Videocall_declined": "Videoanruf abgelehnt",
"View_All": "Alle ansehen",
"View_Logs": "Logs anzeigen",
"View_mode": "Ansichts-Modus",
"View_original": "Original anzeigen",
"View_the_Logs_for": "Zeige die Protokolle für \"__name__\" an",
"view-broadcast-member-list": "Die Liste der Mitglieder in Broadcast-Räumen anzeigen",
Expand Down Expand Up @@ -3181,4 +3180,4 @@
"Your_question": "Deine Frage",
"Your_server_link": "Dein Server-Link",
"Your_workspace_is_ready": "Dein Arbeitsbereich ist einsatzbereit 🎉"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/de.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -5123,7 +5123,6 @@
"view-omnichannel-contact-center": "Omnichannel Kontaktverwaltung ansehen",
"view-omnichannel-contact-center_description": "Erlaubnis, mit der Omnichannel Kontaktverwaltung zu arbeiten",
"View_Logs": "Protokolle anzeigen",
"View_mode": "Ansichtsmodus",
"View_original": "Original anzeigen",
"View_the_Logs_for": "Protokolle für \"__name__\" anzeigen",
"view-all-teams": "Alle Teams anzeigen",
Expand Down Expand Up @@ -5504,4 +5503,4 @@
"Theme_light": "Hell",
"Theme_dark": "Dunkel",
"Create_an_account": "Ein Konto erstellen"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/el.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2683,7 +2683,6 @@
"Videocall_declined": "Η κλήση βίντεο απορρίφθηκε.",
"View_All": "Εμφάνιση όλων",
"View_Logs": "Δείτε τα αρχεία καταγραφών",
"View_mode": "λειτουργία προβολής",
"view-broadcast-member-list": "Προβολή Λίστα Μελών στο Δωμάτιο Broadcast",
"view-c-room": "Προβολή δημόσιου καναλιού",
"view-c-room_description": "Άδεια προβολής δημόσιων καναλιών",
Expand Down Expand Up @@ -2814,4 +2813,4 @@
"registration.component.form.password": "Κωδικός",
"registration.component.form.divider": "ή",
"registration.component.form.submit": "Υποβολή"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -5165,7 +5165,6 @@
"view-omnichannel-contact-center": "View Omnichannel Contact Center",
"view-omnichannel-contact-center_description": "Permission to view and interact with the Omnichannel Contact Center",
"View_Logs": "View Logs",
"View_mode": "View Mode",
"View_original": "View Original",
"View_the_Logs_for": "View the logs for: \"__name__\"",
"view-all-teams": "View All Teams",
Expand Down Expand Up @@ -5553,4 +5552,4 @@
"Theme_dark": "Dark",
"Join_your_team": "Join your team",
"Create_an_account": "Create an account"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/eo.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2676,7 +2676,6 @@
"Videocall_declined": "Video Vokis Malakceptita.",
"View_All": "Rigardi ĉiujn membrojn",
"View_Logs": "Vidi Registrojn",
"View_mode": "Rigardi Modo",
"view-broadcast-member-list": "Rigardu Membrolistojn en Broadcast Room",
"view-c-room": "Vidi Publikan Kanalon",
"view-c-room_description": "Permeso por vidi publikajn kanalojn",
Expand Down Expand Up @@ -2807,4 +2806,4 @@
"registration.component.form.password": "Pasvorto",
"registration.component.form.divider": "aŭ",
"registration.component.form.submit": "Afiŝu"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/es.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -4610,7 +4610,6 @@
"view-omnichannel-contact-center": "Ver centro de contactos de Omnichannel",
"view-omnichannel-contact-center_description": "Permiso para ver e interactuar con el centro de contactos de Omnichannel",
"View_Logs": "Ver registros",
"View_mode": "Modo de vista",
"View_original": "Ver original",
"View_the_Logs_for": "Ver registros de: \"__name__\"",
"view-broadcast-member-list": "Ver lista de miembros en la Room de transmisión",
Expand Down Expand Up @@ -4929,4 +4928,4 @@
"onboarding.form.standaloneServerForm.servicesUnavailable": "Algunos servicios no estarán disponibles o requerirán configuración manual",
"onboarding.form.standaloneServerForm.publishOwnApp": "Para enviarte notificaciones push, debes compilar y publicar tu propia aplicación en Google Play y App Store",
"onboarding.form.standaloneServerForm.manuallyIntegrate": "Necesita integrarse manualmente con servicios externos"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/fa.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3007,7 +3007,6 @@
"Videocall_declined": "تماس ویدیویی رد شد",
"View_All": "مشاهده همه",
"View_Logs": "نمایش سیاهههای مربوط",
"View_mode": "شیوه نمایش",
"view-broadcast-member-list": "مشاهده لیست اعضا در اتاق پخش",
"view-c-room": "مشاهده کانال عمومی",
"view-c-room_description": "اجازه مشاهده کانالهای عمومی",
Expand Down Expand Up @@ -3150,4 +3149,4 @@
"registration.component.form.password": "رمز عبور",
"registration.component.form.divider": "یا",
"registration.component.form.submit": "ارسال"
}
}
3 changes: 1 addition & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -5101,7 +5101,6 @@
"view-omnichannel-contact-center": "Näytä Omnichannel Contact Center",
"view-omnichannel-contact-center_description": "Lupa tarkastella Omnichannel Contact Centeriä ja olla vuorovaikutuksessa sen kanssa",
"View_Logs": "Katso lokit",
"View_mode": "Näkymätila",
"View_original": "Näytä alkuperäinen",
"View_the_Logs_for": "Näytä lokit: \"__name__\"",
"view-all-teams": "Näytä kaikki Tiimit",
Expand Down Expand Up @@ -5466,4 +5465,4 @@
"onboarding.form.standaloneServerForm.manuallyIntegrate": "Tarve integroida manuaalisesti ulkoisiin palveluihin",
"Something_Went_Wrong": "Jokin meni pieleen",
"Toolbox_room_actions": "Ensisijaiset huoneen Room toimet"
}
}
Loading