Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Redesign room search interface #12677

Merged
merged 54 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6238863
Extract SearchInfo interface and SearchScope enum
t3chguy Jun 24, 2024
8b36baa
Fix in-progress and update behaviour of RoomSearchView
t3chguy Jun 24, 2024
be6665d
Remove search button from legacy header
t3chguy Jun 24, 2024
b56fd5a
Move search from aux panel to room summary card
t3chguy Jun 24, 2024
a705b97
Wire up Cmd/Ctrl F for moved search field
t3chguy Jun 24, 2024
bc0b777
Use cpd space tokens
t3chguy Jun 24, 2024
7540d2b
Remove stale props
t3chguy Jun 24, 2024
7c99eb4
Fix ctrl/cmd f search shortcut
t3chguy Jun 24, 2024
c73f1aa
Tests
t3chguy Jun 24, 2024
1af2376
Tests
t3chguy Jun 24, 2024
e708e33
Update Compound
t3chguy Jun 25, 2024
f733386
Revert the back button for now
t3chguy Jun 25, 2024
55d7e88
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Jun 25, 2024
d7adb29
i18n
t3chguy Jun 25, 2024
1cc908e
Iterate
t3chguy Jun 25, 2024
e55301a
Iterate
t3chguy Jun 25, 2024
3fe4578
Iterate
t3chguy Jun 25, 2024
7c3c017
Iterate
t3chguy Jun 25, 2024
3b9b904
Cancel search on escape
t3chguy Jun 25, 2024
40f1583
Fix missing X
t3chguy Jun 25, 2024
78e7e88
Improve coverage
t3chguy Jun 25, 2024
f9992d9
Extract SearchScope and SearchInfo into Searching
t3chguy Jun 25, 2024
a62daf0
delint
t3chguy Jun 25, 2024
b545979
delint
t3chguy Jun 25, 2024
9950fb2
Fix test
t3chguy Jun 25, 2024
61d2593
Merge branch 't3chguy/extract-searching' of github.com:matrix-org/mat…
t3chguy Jun 25, 2024
b4dfa4f
Switch to icon button for cancel search
t3chguy Jun 25, 2024
d27b464
Iterate
t3chguy Jun 26, 2024
ecbfff6
yarn.lock
t3chguy Jun 26, 2024
f6926fd
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Jun 26, 2024
92fcbf1
Iterate
t3chguy Jun 26, 2024
5cd59bd
lint
t3chguy Jun 26, 2024
8446009
Iterate
t3chguy Jun 26, 2024
f925d30
Iterate
t3chguy Jun 26, 2024
351e206
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Jul 2, 2024
f60c443
Update screenshots
t3chguy Jul 2, 2024
6842bc9
i18n
t3chguy Jul 2, 2024
c5fd194
Update screenshots
t3chguy Jul 2, 2024
3d7baef
Update screenshots
t3chguy Jul 2, 2024
25e38f5
Update locators
t3chguy Jul 2, 2024
4466f2f
Revert screenshots
t3chguy Jul 2, 2024
52cdced
Update screenshots
t3chguy Jul 2, 2024
4985300
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Jul 2, 2024
39d2674
Update snapshots
t3chguy Jul 2, 2024
fb5fe4d
Discard changes to package.json
t3chguy Jul 2, 2024
667da26
i18n
t3chguy Jul 2, 2024
3a5aad0
Snapshots
t3chguy Jul 2, 2024
773d891
Handle narrow viewports
t3chguy Jul 2, 2024
a028426
Iterate
t3chguy Jul 2, 2024
5313665
Improve coverage
t3chguy Jul 2, 2024
aa7caeb
Improve coverage
t3chguy Jul 2, 2024
ba758b5
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Jul 3, 2024
7ef6f10
Iterate
t3chguy Jul 3, 2024
ec6d77e
Revert copy
t3chguy Jul 4, 2024
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
10 changes: 5 additions & 5 deletions playwright/e2e/timeline/timeline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -781,10 +781,10 @@ test.describe("Timeline", () => {

await page.locator(".mx_LegacyRoomHeader").getByRole("button", { name: "Search" }).click();

await expect(page.locator(".mx_SearchBar")).toMatchScreenshot("search-bar-on-timeline.png");
await page.locator(".mx_RoomSummaryCard_search").getByRole("searchbox").fill("Message");
await page.locator(".mx_RoomSummaryCard_search").getByRole("searchbox").press("Enter");

await page.locator(".mx_SearchBar_input").getByRole("textbox").fill("Message");
await page.locator(".mx_SearchBar_input").getByRole("textbox").press("Enter");
await expect(page.locator(".mx_RoomSearchAuxPanel")).toMatchScreenshot("search-aux-panel.png");

for (const locator of await page
.locator(".mx_EventTile:not(.mx_EventTile_contextual) .mx_EventTile_searchHighlight")
Expand Down Expand Up @@ -822,8 +822,8 @@ test.describe("Timeline", () => {
await page.locator(".mx_LegacyRoomHeader").getByRole("button", { name: "Search" }).click();

// Search the string to display both the message and TextualEvent on search results panel
await page.locator(".mx_SearchBar").getByRole("textbox").fill(stringToSearch);
await page.locator(".mx_SearchBar").getByRole("textbox").press("Enter");
await page.locator(".mx_RoomSummaryCard_search").getByRole("searchbox").fill(stringToSearch);
await page.locator(".mx_RoomSummaryCard_search").getByRole("searchbox").press("Enter");

// On search results panel
const resultsPanel = page.locator(".mx_RoomView_searchResultsPanel");
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the bg in the corners changes =(

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the bg in the corners changes =(

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions res/css/_common.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ a:visited {
color: $accent-alt;
}

input[type="text"],
input[type="search"],
input[type="password"] {
:not(.mx_no_textinput):not(.mx_textinput):not(.mx_Field) > input[type="text"],
:not(.mx_no_textinput):not(.mx_textinput):not(.mx_Field) > input[type="search"],
:not(.mx_no_textinput):not(.mx_textinput):not(.mx_Field) > input[type="password"] {
padding: 9px;
font: var(--cpd-font-body-md-semibold);
font-weight: var(--cpd-font-weight-semibold);
Expand Down
2 changes: 1 addition & 1 deletion res/css/_components.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,10 @@
@import "./views/rooms/_RoomListHeader.pcss";
@import "./views/rooms/_RoomPreviewBar.pcss";
@import "./views/rooms/_RoomPreviewCard.pcss";
@import "./views/rooms/_RoomSearchAuxPanel.pcss";
@import "./views/rooms/_RoomSublist.pcss";
@import "./views/rooms/_RoomTile.pcss";
@import "./views/rooms/_RoomUpgradeWarningBar.pcss";
@import "./views/rooms/_SearchBar.pcss";
@import "./views/rooms/_SendMessageComposer.pcss";
@import "./views/rooms/_SpaceScopeHeader.pcss";
@import "./views/rooms/_Stickers.pcss";
Expand Down
23 changes: 5 additions & 18 deletions res/css/views/right_panel/_RoomSummaryCard.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -238,25 +238,12 @@ limitations under the License.
padding: 15px 12px;
}

.mx_RoomSummaryCard_search input {
/* Overriding very broad CSS rules */
border: 0 !important;
margin: 0 !important;
cursor: pointer;
}
.mx_RoomSummaryCard_search {
flex-grow: 1;
min-width: 0;

.mx_RoomSummaryCard_searchBtn {
background: var(--cpd-color-bg-canvas-default);
color: var(--cpd-color-icon-primary);
border: 1px solid var(--cpd-color-gray-400);
border-radius: 50%;
width: 36px;
height: 36px;
padding: var(--cpd-space-2x);
cursor: pointer;

&:hover {
background: var(--cpd-color-bg-subtle-primary);
input[type="search"]::-webkit-search-cancel-button {
display: unset; /* override _common.pcss which inhibits this */
}
}

Expand Down
72 changes: 72 additions & 0 deletions res/css/views/rooms/_RoomSearchAuxPanel.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
Copyright 2024 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_RoomSearchAuxPanel {
/* use `min-height` rather than height, to allow room for the text to wrap if the window is narrow */
min-height: 84px;
display: flex;
align-items: center;
border-color: var(--cpd-color-bg-canvas-default);
border-style: solid;
border-width: 1px 0;
padding: var(--cpd-space-3x);
box-sizing: border-box;
gap: var(--cpd-space-2x);

.mx_RoomSearchAuxPanel_summary {
flex-grow: 1;
display: inherit; /* flex */
gap: var(--cpd-space-2x);
align-items: center;
overflow: hidden;

> svg {
padding: var(--cpd-space-2x);
border-radius: var(--cpd-space-2x);
background-color: var(--cpd-color-bg-subtle-secondary);
color: var(--cpd-color-icon-secondary);
flex-shrink: 0;
}

.mx_RoomSearchAuxPanel_summary_text {
display: flex;
flex-direction: column;
font-size: $font-15px;
line-height: $font-22px;
overflow: hidden;

span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}

.mx_SearchWarning {
display: contents;
font-size: $font-13px;
line-height: $font-20px;
color: var(--cpd-color-text-secondary);
}
}

.mx_RoomSearchAuxPanel_buttons {
display: inherit; /* flex */
gap: var(--cpd-space-6x);
align-items: center;
flex-shrink: 0;
}
}
83 changes: 0 additions & 83 deletions res/css/views/rooms/_SearchBar.pcss

This file was deleted.

9 changes: 6 additions & 3 deletions src/components/structures/RightPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import React from "react";
import React, { ChangeEvent } from "react";
import { Room, RoomState, RoomStateEvent, RoomMember, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { throttle } from "lodash";

Expand Down Expand Up @@ -57,7 +57,8 @@ interface RoomlessProps extends BaseProps {
interface RoomProps extends BaseProps {
room: Room;
permalinkCreator: RoomPermalinkCreator;
onSearchClick?: () => void;
onSearchChange?: (e: ChangeEvent) => void;
onSearchCancel?: () => void;
}

type Props = XOR<RoomlessProps, RoomProps>;
Expand Down Expand Up @@ -296,7 +297,9 @@ export default class RightPanel extends React.Component<Props, IState> {
onClose={this.onClose}
// whenever RightPanel is passed a room it is passed a permalinkcreator
permalinkCreator={this.props.permalinkCreator!}
onSearchClick={this.props.onSearchClick}
onSearchChange={this.props.onSearchChange}
onSearchCancel={this.props.onSearchCancel}
focusRoomSearch={cardState?.focusRoomSearch}
/>
);
}
Expand Down
Loading
Loading