diff --git a/playwright/e2e/left-panel/room-list-panel/room-list-panel.spec.ts b/playwright/e2e/left-panel/room-list-panel/room-list-panel.spec.ts index 2ffbc608c2..0073ba8957 100644 --- a/playwright/e2e/left-panel/room-list-panel/room-list-panel.spec.ts +++ b/playwright/e2e/left-panel/room-list-panel/room-list-panel.spec.ts @@ -38,4 +38,10 @@ test.describe("Room list panel", () => { await expect(roomListView.getByRole("gridcell", { name: "Open room room19" })).toBeVisible(); await expect(roomListView).toMatchScreenshot("room-list-panel.png"); }); + + test("should respond to small screen sizes", { tag: "@screenshot" }, async ({ page }) => { + await page.setViewportSize({ width: 575, height: 600 }); + const roomListPanel = page.getByTestId("room-list-panel"); + await expect(roomListPanel).toMatchScreenshot("room-list-panel-smallscreen.png"); + }); }); diff --git a/playwright/snapshots/left-panel/room-list-panel/room-list-panel.spec.ts/room-list-panel-smallscreen-linux.png b/playwright/snapshots/left-panel/room-list-panel/room-list-panel.spec.ts/room-list-panel-smallscreen-linux.png new file mode 100644 index 0000000000..591c749cd8 Binary files /dev/null and b/playwright/snapshots/left-panel/room-list-panel/room-list-panel.spec.ts/room-list-panel-smallscreen-linux.png differ diff --git a/res/css/structures/_LeftPanel.pcss b/res/css/structures/_LeftPanel.pcss index c76fd5da02..c1886b6b80 100644 --- a/res/css/structures/_LeftPanel.pcss +++ b/res/css/structures/_LeftPanel.pcss @@ -28,6 +28,12 @@ Please see LICENSE files in the repository root for full details. --collapsedWidth: 68px; } +.mx_LeftPanel_newRoomList { + /* Thew new rooms list is not designed to be collapsed to just icons. */ + /* 224 + 68(spaces bar) was deemed by design to be a good minimum for the left panel. */ + --collapsedWidth: 224px; +} + .mx_LeftPanel_wrapper { display: flex; flex-direction: row; diff --git a/res/css/views/rooms/RoomListPanel/_RoomListSearch.pcss b/res/css/views/rooms/RoomListPanel/_RoomListSearch.pcss index 8a97086df8..f6f98e1efe 100644 --- a/res/css/views/rooms/RoomListPanel/_RoomListSearch.pcss +++ b/res/css/views/rooms/RoomListPanel/_RoomListSearch.pcss @@ -21,6 +21,7 @@ flex: 1; font: var(--cpd-font-body-md-regular); color: var(--cpd-color-text-secondary); + min-width: 0; span { flex: 1; @@ -28,6 +29,17 @@ kbd { font-family: inherit; } + + /* Shrink and truncate the search text */ + white-space: nowrap; + overflow: hidden; + .mx_RoomListSearch_search_text { + min-width: 0; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: start; + } } } diff --git a/src/components/structures/LeftPanel.tsx b/src/components/structures/LeftPanel.tsx index 3686d52bca..3bd2518c8a 100644 --- a/src/components/structures/LeftPanel.tsx +++ b/src/components/structures/LeftPanel.tsx @@ -379,13 +379,14 @@ export default class LeftPanel extends React.Component { } public render(): React.ReactNode { + const useNewRoomList = SettingsStore.getValue("feature_new_room_list"); const containerClasses = classNames({ mx_LeftPanel: true, + mx_LeftPanel_newRoomList: useNewRoomList, mx_LeftPanel_minimized: this.props.isMinimized, }); const roomListClasses = classNames("mx_LeftPanel_actualRoomListContainer", "mx_AutoHideScrollbar"); - const useNewRoomList = SettingsStore.getValue("feature_new_room_list"); if (useNewRoomList) { return (
diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index cf68f85b4c..b4f65b9871 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -259,9 +259,11 @@ class LoggedInView extends React.Component { private createResizer(): Resizer { let panelSize: number | null; let panelCollapsed: boolean; + const useNewRoomList = SettingsStore.getValue("feature_new_room_list"); + // TODO decrease this once Spaces launches as it'll no longer need to include the 56px Community Panel + const toggleSize = useNewRoomList ? 224 : 206 - 50; const collapseConfig: ICollapseConfig = { - // TODO decrease this once Spaces launches as it'll no longer need to include the 56px Community Panel - toggleSize: 206 - 50, + toggleSize, onCollapsed: (collapsed) => { panelCollapsed = collapsed; if (collapsed) { @@ -697,10 +699,18 @@ class LoggedInView extends React.Component { "mx_MatrixChat--with-avatar": this.state.backgroundImage, }); + const useNewRoomList = SettingsStore.getValue("feature_new_room_list"); + + const leftPanelWrapperClasses = classNames({ + mx_LeftPanel_wrapper: true, + mx_LeftPanel_newRoomList: useNewRoomList, + }); + const audioFeedArraysForCalls = this.state.activeCalls.map((call) => { return ; }); + const shouldUseMinimizedUI = !useNewRoomList && this.props.collapseLhs; return (
{
- -
+ +
diff --git a/src/components/views/rooms/RoomListPanel/RoomListSearch.tsx b/src/components/views/rooms/RoomListPanel/RoomListSearch.tsx index 6809841075..26f0ff8bae 100644 --- a/src/components/views/rooms/RoomListPanel/RoomListSearch.tsx +++ b/src/components/views/rooms/RoomListPanel/RoomListSearch.tsx @@ -55,7 +55,7 @@ export function RoomListSearch({ activeSpace }: RoomListSearchProps): JSX.Elemen onClick={() => defaultDispatcher.fire(Action.OpenSpotlight)} > - {_t("action|search")} + {_t("action|search")} {IS_MAC ? "⌘ K" : _t(ALTERNATE_KEY_NAME[Key.CONTROL]) + " K"} diff --git a/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/RoomListPanel-test.tsx.snap b/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/RoomListPanel-test.tsx.snap index 6536e9cc19..45e56a3cb0 100644 --- a/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/RoomListPanel-test.tsx.snap +++ b/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/RoomListPanel-test.tsx.snap @@ -224,7 +224,11 @@ exports[` should render the RoomListSearch component when UICom class="mx_Flex" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: start; --mx-flex-justify: space-between; --mx-flex-gap: 0; --mx-flex-wrap: nowrap;" > - Search + + Search + Ctrl K diff --git a/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/RoomListSearch-test.tsx.snap b/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/RoomListSearch-test.tsx.snap index 5efa931a3b..e52842ba3a 100644 --- a/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/RoomListSearch-test.tsx.snap +++ b/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/RoomListSearch-test.tsx.snap @@ -30,7 +30,11 @@ exports[` should display search and explore buttons 1`] = ` class="mx_Flex" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: start; --mx-flex-justify: space-between; --mx-flex-gap: 0; --mx-flex-wrap: nowrap;" > - Search + + Search + Ctrl K @@ -91,7 +95,11 @@ exports[` should display the dial button when the PTSN protoco class="mx_Flex" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: start; --mx-flex-justify: space-between; --mx-flex-gap: 0; --mx-flex-wrap: nowrap;" > - Search + + Search + Ctrl K @@ -173,7 +181,11 @@ exports[` should hide the explore button when UIComponent.Expl class="mx_Flex" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: start; --mx-flex-justify: space-between; --mx-flex-gap: 0; --mx-flex-wrap: nowrap;" > - Search + + Search + Ctrl K @@ -213,7 +225,11 @@ exports[` should hide the explore button when the active space class="mx_Flex" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: start; --mx-flex-justify: space-between; --mx-flex-gap: 0; --mx-flex-wrap: nowrap;" > - Search + + Search + Ctrl K