Skip to content

Commit 489c5b9

Browse files
authored
Merge pull request matrix-org#5276 from michel-zimmer/room-directory-clipped-uris
Fix room directory clipping links in the room's topic
2 parents a6246a7 + 58bbbf3 commit 489c5b9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

res/css/structures/_RoomDirectory.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ limitations under the License.
133133
.mx_RoomDirectory_topic {
134134
cursor: initial;
135135
color: $light-fg-color;
136+
display: -webkit-box;
137+
-webkit-box-orient: vertical;
138+
-webkit-line-clamp: 3;
139+
overflow: hidden;
136140
}
137141

138142
.mx_RoomDirectory_alias {

src/components/structures/RoomDirectory.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import GroupStore from "../../stores/GroupStore";
3535
import FlairStore from "../../stores/FlairStore";
3636

3737
const MAX_NAME_LENGTH = 80;
38-
const MAX_TOPIC_LENGTH = 160;
38+
const MAX_TOPIC_LENGTH = 800;
3939

4040
function track(action) {
4141
Analytics.trackEvent('RoomDirectory', action);
@@ -497,6 +497,9 @@ export default class RoomDirectory extends React.Component {
497497
}
498498

499499
let topic = room.topic || '';
500+
// Additional truncation based on line numbers is done via CSS,
501+
// but to ensure that the DOM is not polluted with a huge string
502+
// we give it a hard limit before rendering.
500503
if (topic.length > MAX_TOPIC_LENGTH) {
501504
topic = `${topic.substring(0, MAX_TOPIC_LENGTH)}...`;
502505
}

0 commit comments

Comments
 (0)