@@ -15,7 +15,7 @@ import {
15
15
useRef ,
16
16
useState ,
17
17
} from "@cocalc/frontend/app-framework" ;
18
- import { Icon , Loading , Tip } from "@cocalc/frontend/components" ;
18
+ import { Icon , Loading } from "@cocalc/frontend/components" ;
19
19
import StaticMarkdown from "@cocalc/frontend/editors/slate/static-markdown" ;
20
20
import { FrameContext } from "@cocalc/frontend/frame-editors/frame-tree/frame-context" ;
21
21
import { hoursToTimeIntervalHuman } from "@cocalc/util/misc" ;
@@ -34,7 +34,7 @@ const FILTER_RECENT_NONE = {
34
34
value : 0 ,
35
35
label : (
36
36
< >
37
- < Icon name = "clock" /> All
37
+ < Icon name = "clock" />
38
38
</ >
39
39
) ,
40
40
} as const ;
@@ -114,10 +114,6 @@ export function ChatRoom({
114
114
on_send ( ) ;
115
115
}
116
116
117
- function button_scroll_to_bottom ( ) : void {
118
- scrollToBottomRef . current ?.( true ) ;
119
- }
120
-
121
117
function render_preview_message ( ) : JSX . Element | undefined {
122
118
if ( ! is_preview ) return ;
123
119
if ( input . length === 0 || preview . length === 0 ) return ;
@@ -152,45 +148,16 @@ export function ChatRoom({
152
148
) ;
153
149
}
154
150
155
- function render_bottom_button ( ) : JSX . Element {
156
- return (
157
- < Button onClick = { button_scroll_to_bottom } >
158
- < Tip
159
- title = {
160
- < FormattedMessage
161
- id = "chatroom.scroll_bottom.tooltip.title"
162
- defaultMessage = { "Newest Messages" }
163
- />
164
- }
165
- tip = {
166
- < span >
167
- < FormattedMessage
168
- id = "chatroom.scroll_bottom.tooltip.tip"
169
- defaultMessage = {
170
- "Scrolls the chat to the bottom showing the newest messages"
171
- }
172
- />
173
- </ span >
174
- }
175
- placement = "left"
176
- >
177
- < Icon name = "arrow-down" /> { " " }
178
- < FormattedMessage
179
- id = "chatroom.scroll_bottom.label"
180
- defaultMessage = { "Newest" }
181
- />
182
- </ Tip >
183
- </ Button >
184
- ) ;
185
- }
186
-
187
151
function render_video_chat_button ( ) {
188
152
if ( project_id == null || path == null ) return ;
189
153
return (
190
154
< VideoChatButton
191
155
project_id = { project_id }
192
156
path = { path }
193
- sendChat = { ( value ) => actions . sendChat ( { input : value } ) }
157
+ sendChat = { ( value ) => {
158
+ actions . sendChat ( { input : value } ) ;
159
+ actions . scrollToBottom ( ) ;
160
+ } }
194
161
/>
195
162
) ;
196
163
}
@@ -213,7 +180,6 @@ export function ChatRoom({
213
180
actions . setFilterRecentH ( 0 ) ;
214
181
setFilterRecentHCustom ( "" ) ;
215
182
} }
216
- style = { { width : 120 } }
217
183
popupMatchSelectWidth = { false }
218
184
onSelect = { ( val : number ) => actions . setFilterRecentH ( val ) }
219
185
options = { [
@@ -302,7 +268,6 @@ export function ChatRoom({
302
268
{ renderFilterRecent ( ) }
303
269
< ButtonGroup style = { { marginLeft : "5px" } } >
304
270
{ render_video_chat_button ( ) }
305
- { render_bottom_button ( ) }
306
271
</ ButtonGroup >
307
272
</ Space >
308
273
) ;
0 commit comments