Don't use the minimised width(68px) on the new room list (#29778)
* Don't toggle to the minimised left bar size. * Don't re-style old room list when at the minimum size * Only apply larger minimised with on new room list * Don't tell child views we are minimised for the new room list * move comment to the correct place * address PR comments * Don't wrap search text and add truncation down to a minimum of 50px * Put min-width on the button so that we don't have to hardcode the 50px * Keep the flex display, shrink and truncate just the search text and keep the shortcut * Update snapshots * Add comment for magic value * Make inner search text a span * Add e2e test for smallscreen to test responsiveness * Update snapshots * Forcing an empty commit to fix PR * Change minWidth to 224
This commit is contained in:
@@ -38,4 +38,10 @@ test.describe("Room list panel", () => {
|
|||||||
await expect(roomListView.getByRole("gridcell", { name: "Open room room19" })).toBeVisible();
|
await expect(roomListView.getByRole("gridcell", { name: "Open room room19" })).toBeVisible();
|
||||||
await expect(roomListView).toMatchScreenshot("room-list-panel.png");
|
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");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -28,6 +28,12 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
--collapsedWidth: 68px;
|
--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 {
|
.mx_LeftPanel_wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
font: var(--cpd-font-body-md-regular);
|
font: var(--cpd-font-body-md-regular);
|
||||||
color: var(--cpd-color-text-secondary);
|
color: var(--cpd-color-text-secondary);
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -28,6 +29,17 @@
|
|||||||
kbd {
|
kbd {
|
||||||
font-family: inherit;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -379,13 +379,14 @@ export default class LeftPanel extends React.Component<IProps, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public render(): React.ReactNode {
|
public render(): React.ReactNode {
|
||||||
|
const useNewRoomList = SettingsStore.getValue("feature_new_room_list");
|
||||||
const containerClasses = classNames({
|
const containerClasses = classNames({
|
||||||
mx_LeftPanel: true,
|
mx_LeftPanel: true,
|
||||||
|
mx_LeftPanel_newRoomList: useNewRoomList,
|
||||||
mx_LeftPanel_minimized: this.props.isMinimized,
|
mx_LeftPanel_minimized: this.props.isMinimized,
|
||||||
});
|
});
|
||||||
|
|
||||||
const roomListClasses = classNames("mx_LeftPanel_actualRoomListContainer", "mx_AutoHideScrollbar");
|
const roomListClasses = classNames("mx_LeftPanel_actualRoomListContainer", "mx_AutoHideScrollbar");
|
||||||
const useNewRoomList = SettingsStore.getValue("feature_new_room_list");
|
|
||||||
if (useNewRoomList) {
|
if (useNewRoomList) {
|
||||||
return (
|
return (
|
||||||
<div className={containerClasses}>
|
<div className={containerClasses}>
|
||||||
|
|||||||
@@ -259,9 +259,11 @@ class LoggedInView extends React.Component<IProps, IState> {
|
|||||||
private createResizer(): Resizer<ICollapseConfig, CollapseItem> {
|
private createResizer(): Resizer<ICollapseConfig, CollapseItem> {
|
||||||
let panelSize: number | null;
|
let panelSize: number | null;
|
||||||
let panelCollapsed: boolean;
|
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 = {
|
const collapseConfig: ICollapseConfig = {
|
||||||
// TODO decrease this once Spaces launches as it'll no longer need to include the 56px Community Panel
|
toggleSize,
|
||||||
toggleSize: 206 - 50,
|
|
||||||
onCollapsed: (collapsed) => {
|
onCollapsed: (collapsed) => {
|
||||||
panelCollapsed = collapsed;
|
panelCollapsed = collapsed;
|
||||||
if (collapsed) {
|
if (collapsed) {
|
||||||
@@ -697,10 +699,18 @@ class LoggedInView extends React.Component<IProps, IState> {
|
|||||||
"mx_MatrixChat--with-avatar": this.state.backgroundImage,
|
"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) => {
|
const audioFeedArraysForCalls = this.state.activeCalls.map((call) => {
|
||||||
return <AudioFeedArrayForLegacyCall call={call} key={call.callId} />;
|
return <AudioFeedArrayForLegacyCall call={call} key={call.callId} />;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const shouldUseMinimizedUI = !useNewRoomList && this.props.collapseLhs;
|
||||||
return (
|
return (
|
||||||
<MatrixClientContextProvider client={this._matrixClient}>
|
<MatrixClientContextProvider client={this._matrixClient}>
|
||||||
<div
|
<div
|
||||||
@@ -712,19 +722,19 @@ class LoggedInView extends React.Component<IProps, IState> {
|
|||||||
<ToastContainer />
|
<ToastContainer />
|
||||||
<div className={bodyClasses}>
|
<div className={bodyClasses}>
|
||||||
<div className="mx_LeftPanel_outerWrapper">
|
<div className="mx_LeftPanel_outerWrapper">
|
||||||
<LeftPanelLiveShareWarning isMinimized={this.props.collapseLhs || false} />
|
<LeftPanelLiveShareWarning isMinimized={shouldUseMinimizedUI || false} />
|
||||||
<div className="mx_LeftPanel_wrapper">
|
<div className={leftPanelWrapperClasses}>
|
||||||
<BackdropPanel blurMultiplier={0.5} backgroundImage={this.state.backgroundImage} />
|
<BackdropPanel blurMultiplier={0.5} backgroundImage={this.state.backgroundImage} />
|
||||||
<SpacePanel />
|
<SpacePanel />
|
||||||
<BackdropPanel backgroundImage={this.state.backgroundImage} />
|
<BackdropPanel backgroundImage={this.state.backgroundImage} />
|
||||||
<div
|
<div
|
||||||
className="mx_LeftPanel_wrapper--user"
|
className="mx_LeftPanel_wrapper--user"
|
||||||
ref={this._resizeContainer}
|
ref={this._resizeContainer}
|
||||||
data-collapsed={this.props.collapseLhs ? true : undefined}
|
data-collapsed={shouldUseMinimizedUI ? true : undefined}
|
||||||
>
|
>
|
||||||
<LeftPanel
|
<LeftPanel
|
||||||
pageType={this.props.page_type as PageTypes}
|
pageType={this.props.page_type as PageTypes}
|
||||||
isMinimized={this.props.collapseLhs || false}
|
isMinimized={shouldUseMinimizedUI || false}
|
||||||
resizeNotifier={this.props.resizeNotifier}
|
resizeNotifier={this.props.resizeNotifier}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export function RoomListSearch({ activeSpace }: RoomListSearchProps): JSX.Elemen
|
|||||||
onClick={() => defaultDispatcher.fire(Action.OpenSpotlight)}
|
onClick={() => defaultDispatcher.fire(Action.OpenSpotlight)}
|
||||||
>
|
>
|
||||||
<Flex as="span" justify="space-between">
|
<Flex as="span" justify="space-between">
|
||||||
{_t("action|search")}
|
<span className="mx_RoomListSearch_search_text">{_t("action|search")}</span>
|
||||||
<kbd>{IS_MAC ? "⌘ K" : _t(ALTERNATE_KEY_NAME[Key.CONTROL]) + " K"}</kbd>
|
<kbd>{IS_MAC ? "⌘ K" : _t(ALTERNATE_KEY_NAME[Key.CONTROL]) + " K"}</kbd>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -224,7 +224,11 @@ exports[`<RoomListPanel /> should render the RoomListSearch component when UICom
|
|||||||
class="mx_Flex"
|
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;"
|
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
|
<span
|
||||||
|
class="mx_RoomListSearch_search_text"
|
||||||
|
>
|
||||||
|
Search
|
||||||
|
</span>
|
||||||
<kbd>
|
<kbd>
|
||||||
Ctrl K
|
Ctrl K
|
||||||
</kbd>
|
</kbd>
|
||||||
|
|||||||
@@ -30,7 +30,11 @@ exports[`<RoomListSearch /> should display search and explore buttons 1`] = `
|
|||||||
class="mx_Flex"
|
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;"
|
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
|
<span
|
||||||
|
class="mx_RoomListSearch_search_text"
|
||||||
|
>
|
||||||
|
Search
|
||||||
|
</span>
|
||||||
<kbd>
|
<kbd>
|
||||||
Ctrl K
|
Ctrl K
|
||||||
</kbd>
|
</kbd>
|
||||||
@@ -91,7 +95,11 @@ exports[`<RoomListSearch /> should display the dial button when the PTSN protoco
|
|||||||
class="mx_Flex"
|
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;"
|
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
|
<span
|
||||||
|
class="mx_RoomListSearch_search_text"
|
||||||
|
>
|
||||||
|
Search
|
||||||
|
</span>
|
||||||
<kbd>
|
<kbd>
|
||||||
Ctrl K
|
Ctrl K
|
||||||
</kbd>
|
</kbd>
|
||||||
@@ -173,7 +181,11 @@ exports[`<RoomListSearch /> should hide the explore button when UIComponent.Expl
|
|||||||
class="mx_Flex"
|
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;"
|
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
|
<span
|
||||||
|
class="mx_RoomListSearch_search_text"
|
||||||
|
>
|
||||||
|
Search
|
||||||
|
</span>
|
||||||
<kbd>
|
<kbd>
|
||||||
Ctrl K
|
Ctrl K
|
||||||
</kbd>
|
</kbd>
|
||||||
@@ -213,7 +225,11 @@ exports[`<RoomListSearch /> should hide the explore button when the active space
|
|||||||
class="mx_Flex"
|
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;"
|
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
|
<span
|
||||||
|
class="mx_RoomListSearch_search_text"
|
||||||
|
>
|
||||||
|
Search
|
||||||
|
</span>
|
||||||
<kbd>
|
<kbd>
|
||||||
Ctrl K
|
Ctrl K
|
||||||
</kbd>
|
</kbd>
|
||||||
|
|||||||
Reference in New Issue
Block a user