Skip to content

Commit 644d106

Browse files
committed
fix: close CSS gaps in SDK layout and fix ChannelList dialog portal
Several SDK components were missing layout properties that consumers had to work around (e.g. min-height: 0 on flex children, width: 100% on headers and main-panel-inner). Additionally, the ChannelList's DialogManagerProvider rendered its portal destination outside the .str-chat element, causing context menus to lose theme styles. - Add min-height: 0 to .str-chat__chat-view, __chat-view__channels, and __channel (flex overflow fix) - Add width: 100% to header-layout mixin and .str-chat__main-panel-inner - Add scrollbar-gutter: stable to scrollable-y mixin - Remove incorrect height: auto override on thread's main-panel-inner - Move DialogManagerProvider inside .str-chat div in ChannelList - Remove now-redundant overrides from vite example
1 parent 86ada37 commit 644d106

7 files changed

Lines changed: 14 additions & 81 deletions

File tree

examples/vite/src/index.scss

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,7 @@ body {
6161
width: 100%;
6262
}
6363

64-
.str-chat__chat-view,
65-
.str-chat__chat-view-channels,
66-
.str-chat__channel,
67-
.str-chat__window {
68-
min-height: 0;
69-
}
70-
7164
.str-chat__chat-view {
72-
height: 100%;
7365
container-type: inline-size;
7466
}
7567

@@ -179,74 +171,20 @@ body {
179171
min-width: 0;
180172
}
181173

182-
.str-chat__chat-view-channels {
183-
height: 100%;
184-
gap: 0;
185-
}
186-
187-
.str-chat__channel-list {
188-
height: 100%;
189-
}
190-
191-
.str-chat__main-panel {
192-
height: 100%;
193-
align-items: stretch;
194-
}
195-
196-
.str-chat__main-panel-inner {
197-
width: 100%;
198-
height: 100%;
199-
max-width: none;
200-
}
201-
202-
.str-chat__window {
203-
height: 100%;
204-
}
205-
206174
.app-loading-screen__window {
207175
width: 100%;
208176
}
209177

210-
.str-chat__channel-header,
211-
.str-chat__thread-header {
212-
width: 100%;
213-
max-width: none;
214-
}
215-
216178
.str-chat__list,
217179
.str-chat__virtual-list {
218180
display: block;
219-
scrollbar-gutter: stable;
220181
scrollbar-width: thin;
221182
}
222183

223-
.str-chat__message-input {
224-
width: 100%;
225-
//max-width: none;
226-
}
227-
228184
.str-chat__tooltip {
229185
z-index: 10;
230186
}
231187

232-
/* Threads view: thread detail takes all space (higher specificity than channel 360px rules). */
233-
.str-chat__chat-view .str-chat__chat-view__threads {
234-
.str-chat__dropzone-root--thread,
235-
.str-chat__thread-container {
236-
flex: 1 1 auto;
237-
min-width: 0;
238-
max-width: none;
239-
width: 100%;
240-
}
241-
}
242-
243-
.str-chat__thread-list-container .str-chat__thread-container {
244-
flex: 1 1 auto;
245-
min-width: 0;
246-
width: 100%;
247-
max-width: none;
248-
}
249-
250188
@media (max-width: 767px) {
251189
.app-chat-resize-handle {
252190
display: none;

src/components/Channel/styling/Channel.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
height: 100%;
55
display: flex;
66
flex-direction: column;
7+
min-height: 0;
78
position: relative;
89

910
.str-chat__container {

src/components/ChannelList/ChannelList.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,11 @@ const UnMemoizedChannelList = (props: ChannelListProps) => {
341341

342342
const showChannelList = !searchIsActive;
343343
return (
344-
<DialogManagerProvider id={`channel-list-dialog-manager-${stableId}`}>
345-
<ChannelListContextProvider
346-
value={{ channels, hasNextPage, loadNextPage, setChannels }}
347-
>
348-
<div className={className} ref={channelListRef}>
344+
<ChannelListContextProvider
345+
value={{ channels, hasNextPage, loadNextPage, setChannels }}
346+
>
347+
<div className={className} ref={channelListRef}>
348+
<DialogManagerProvider id={`channel-list-dialog-manager-${stableId}`}>
349349
<ChannelListHeader />
350350
{showChannelSearch && <Search />}
351351
{showChannelList && (
@@ -374,9 +374,9 @@ const UnMemoizedChannelList = (props: ChannelListProps) => {
374374
</ChannelListUI>
375375
)}
376376
<NotificationList panel='channel-list' />
377-
</div>
378-
</ChannelListContextProvider>
379-
</DialogManagerProvider>
377+
</DialogManagerProvider>
378+
</div>
379+
</ChannelListContextProvider>
380380
);
381381
};
382382

src/components/ChatView/styling/ChatView.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
display: flex;
1919
width: 100%;
2020
height: 100%;
21+
min-height: 0;
2122
position: relative;
2223

2324
.str-chat__chat-view__selector {
@@ -136,6 +137,7 @@
136137
display: flex;
137138
flex-grow: 1;
138139
min-width: 0;
140+
min-height: 0;
139141
position: relative;
140142
}
141143

src/components/MessageList/styling/MessageList.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
// Layout
44
.str-chat__main-panel-inner {
5+
width: 100%;
56
height: 100%;
67
display: flex;
78
flex-direction: column;

src/components/Thread/styling/Thread.scss

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,3 @@
3939
width: 100%;
4040
}
4141

42-
.str-chat__thread {
43-
.str-chat__main-panel-inner {
44-
height: auto;
45-
}
46-
}
47-
48-
.str-chat__thread--virtualized {
49-
.str-chat__main-panel-inner {
50-
height: 100%;
51-
}
52-
}

src/styling/_utils.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
overflow-x: hidden;
7878
overflow-y: auto;
7979
overscroll-behavior: contain;
80+
scrollbar-gutter: stable;
8081
}
8182

8283
@mixin modal {
@@ -104,6 +105,7 @@
104105
@mixin header-layout {
105106
display: flex;
106107
align-items: center;
108+
width: 100%;
107109
padding: var(--spacing-md);
108110
gap: var(--spacing-sm);
109111
height: var(--str-chat__channel-header-height);

0 commit comments

Comments
 (0)