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

Spotlight search labs #7116

Merged
merged 24 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b661aa9
parent f40291d408ccfa33bdfc577e29a39ac7baa0f653
t3chguy Nov 10, 2021
bef1f81
Iterate Spotlight
t3chguy Dec 2, 2021
66e1319
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Dec 2, 2021
b58bcaf
delint
t3chguy Dec 2, 2021
255e53c
Tweak edge case styling
t3chguy Dec 2, 2021
2f38591
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Dec 6, 2021
61c7460
Fix dm edge case in roomContextDetailsText
t3chguy Dec 6, 2021
e0c6545
Iterate Recent Searches
t3chguy Dec 6, 2021
5df26b9
Include space-room results properly
t3chguy Dec 6, 2021
6c690b6
Iterate explore public rooms cta
t3chguy Dec 6, 2021
344912e
Iterate spotlight results interactions
t3chguy Dec 6, 2021
181b7f2
Add footer to Spotlight
t3chguy Dec 6, 2021
cceaf9c
Remove redundant bits
t3chguy Dec 6, 2021
602c4fd
Iterate PR
t3chguy Dec 6, 2021
67a732e
add comment
t3chguy Dec 6, 2021
58d320f
Iterate PR based on feedback
t3chguy Dec 7, 2021
f3c88bc
Add jump to start chat dialog cta for spotlight
t3chguy Dec 7, 2021
d2b51e4
Iterate PR based on feedback
t3chguy Dec 9, 2021
5ac7342
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Dec 9, 2021
3cd58b1
Merge branch 'develop' into t3chguy/fix/19530
t3chguy Dec 10, 2021
b903e5b
Merge branch 't3chguy/fix/19530' of github.com:matrix-org/matrix-reac…
t3chguy Dec 10, 2021
935511f
delint
t3chguy Dec 10, 2021
76f6a22
Fix roving tab index order
t3chguy Dec 10, 2021
df9fc89
Remove redundant test
t3chguy Dec 10, 2021
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
Prev Previous commit
Next Next commit
Include space-room results properly
  • Loading branch information
t3chguy committed Dec 6, 2021
commit 5df26b92c9bb1d0a0ac42618945e9fd49fb31b9d
19 changes: 16 additions & 3 deletions src/components/views/dialogs/SpotlightDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,12 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", onFinished }) =>

let content: JSX.Element;
if (results) {
const [people, rooms] = results.reduce((result, room: Room) => {
result[DMRoomMap.shared().getUserIdForRoomId(room.roomId) ? 0 : 1].push(room);
const [people, rooms, spaces] = results.reduce((result, room: Room) => {
if (room.isSpaceRoom()) result[2].push(room);
else if (!DMRoomMap.shared().getUserIdForRoomId(room.roomId)) result[1].push(room);
else result[0].push(room);
return result;
}, [[], []] as [Room[], Room[]]);
}, [[], [], []] as [Room[], Room[], Room[]]);

const resultMapper = (room: Room): JSX.Element => (
<Option
Expand Down Expand Up @@ -255,6 +257,16 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", onFinished }) =>
</div>;
}

let spacesSection: JSX.Element;
if (spaces.length) {
spacesSection = <div className="mx_SpotlightDialog_section mx_SpotlightDialog_results" role="group">
<h4>{ _t("Spaces you're in") }</h4>
<div>
{ spaces.slice(0, SECTION_LIMIT).map(resultMapper) }
</div>
</div>;
}

let spaceRoomsSection: JSX.Element;
if (spaceResults.length) {
spaceRoomsSection = <div className="mx_SpotlightDialog_section mx_SpotlightDialog_results" role="group">
Expand Down Expand Up @@ -290,6 +302,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", onFinished }) =>
content = <>
{ peopleSection }
{ roomsSection }
{ spacesSection }
{ spaceRoomsSection }
{ (results.length + spaceResults.length) === 0 ? _t("No results") : null }
</>;
Expand Down
1 change: 1 addition & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -2700,6 +2700,7 @@
"Command Help": "Command Help",
"Space settings": "Space settings",
"Settings - %(spaceName)s": "Settings - %(spaceName)s",
"Spaces you're in": "Spaces you're in",
"Other rooms in %(spaceName)s": "Other rooms in %(spaceName)s",
"Search for": "Search for",
"Public Rooms": "Public Rooms",
Expand Down