@@ -26,14 +26,28 @@ interface Props {
26
26
path : string ;
27
27
style ?: CSSProperties ;
28
28
fontSize ?: number ;
29
+ actions ?: ChatActions ;
30
+ desc ?;
29
31
}
30
32
31
- export default function SideChat ( { project_id, path, style, fontSize } : Props ) {
32
- const actions : ChatActions = useActions ( project_id , path ) ;
33
+ export default function SideChat ( {
34
+ actions : actions0 ,
35
+ project_id,
36
+ path,
37
+ style,
38
+ fontSize,
39
+ desc,
40
+ } : Props ) {
41
+ // This actionsViaContext via useActions is ONLY needed for side chat for non-frame
42
+ // editors, i.e., basically just Sage Worksheets!
43
+ const actionsViaContext = useActions ( project_id , path ) ;
44
+ const actions : ChatActions = actions0 ?? actionsViaContext ;
45
+ const disableFilters = actions0 == null ;
33
46
const messages = useRedux ( [ "messages" ] , project_id , path ) ;
34
47
const [ lastVisible , setLastVisible ] = useState < Date | null > ( null ) ;
35
48
const input : string = useRedux ( [ "input" ] , project_id , path ) ;
36
- const search : string = useRedux ( [ "search" ] , project_id , path ) ;
49
+ const search = desc ?. get ( "data-search" ) ?? "" ;
50
+ const selectedHashtags = desc ?. get ( "data-selectedHashtags" ) ;
37
51
const addCollab : boolean = useRedux ( [ "add_collab" ] , project_id , path ) ;
38
52
const is_uploading = useRedux ( [ "is_uploading" ] , project_id , path ) ;
39
53
const project_map = useTypedRedux ( "projects" , "project_map" ) ;
@@ -142,16 +156,18 @@ export default function SideChat({ project_id, path, style, fontSize }: Props) {
142
156
< AddChatCollab addCollab = { addCollab } project_id = { project_id } />
143
157
</ div >
144
158
) }
145
- < Filter
146
- actions = { actions }
147
- search = { search }
148
- style = { {
149
- margin : 0 ,
150
- ...( messages . size >= 2
151
- ? undefined
152
- : { visibility : "hidden" , height : 0 } ) ,
153
- } }
154
- />
159
+ { ! disableFilters && (
160
+ < Filter
161
+ actions = { actions }
162
+ search = { search }
163
+ style = { {
164
+ margin : 0 ,
165
+ ...( messages . size >= 2
166
+ ? undefined
167
+ : { visibility : "hidden" , height : 0 } ) ,
168
+ } }
169
+ />
170
+ ) }
155
171
< div
156
172
className = "smc-vfill"
157
173
style = { {
@@ -169,6 +185,9 @@ export default function SideChat({ project_id, path, style, fontSize }: Props) {
169
185
scrollToBottomRef = { scrollToBottomRef }
170
186
mode = { "sidechat" }
171
187
setLastVisible = { setLastVisible }
188
+ search = { search }
189
+ selectedHashtags = { selectedHashtags }
190
+ disableFilters = { disableFilters }
172
191
/>
173
192
</ div >
174
193
@@ -184,7 +203,7 @@ export default function SideChat({ project_id, path, style, fontSize }: Props) {
184
203
sendChat ( { reply_to : new Date ( lastVisible ) } ) ;
185
204
} }
186
205
>
187
- Reply (shift+enter)
206
+ < Icon name = "reply" /> Reply (shift+enter)
188
207
</ Button >
189
208
) }
190
209
< Button
@@ -197,7 +216,7 @@ export default function SideChat({ project_id, path, style, fontSize }: Props) {
197
216
disabled = { ! input ?. trim ( ) || is_uploading }
198
217
>
199
218
< Icon name = "paper-plane" />
200
- Start New Conversation
219
+ Start New Thread
201
220
</ Button >
202
221
</ Space >
203
222
</ Tooltip >
0 commit comments