RoomListViewModel: Add functionality to toggle message preview setting (#29511)

* Add setting for showing message previews

* Add hook to track and toggle message preview

* Use hook in view model

* Add tests

* Fix tests

* Fix lint

* Fix typo
This commit is contained in:
R Midhun Suresh
2025-03-17 15:07:14 +00:00
committed by GitHub
parent ff1da50dd9
commit d88776e2dc
6 changed files with 81 additions and 0 deletions
+5
View File
@@ -314,6 +314,7 @@ export interface Settings {
"showImages": IBaseSetting<boolean>;
"showAvatarsOnInvites": IBaseSetting<boolean>;
"RoomList.preferredSorting": IBaseSetting<SortingAlgorithm>;
"RoomList.showMessagePreview": IBaseSetting<boolean>;
"RightPanel.phasesGlobal": IBaseSetting<IRightPanelForRoomStored | null>;
"RightPanel.phases": IBaseSetting<IRightPanelForRoomStored | null>;
"enableEventIndexing": IBaseSetting<boolean>;
@@ -1126,6 +1127,10 @@ export const SETTINGS: Settings = {
supportedLevels: [SettingLevel.DEVICE],
default: SortingAlgorithm.Recency,
},
"RoomList.showMessagePreview": {
supportedLevels: [SettingLevel.DEVICE],
default: false,
},
"RightPanel.phasesGlobal": {
supportedLevels: [SettingLevel.DEVICE],
default: null,