File tree Expand file tree Collapse file tree 8 files changed +46
-10
lines changed
MessageInput/AttachmentSelector
TextareaComposer/SuggestionList Expand file tree Collapse file tree 8 files changed +46
-10
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export const Badge = ({
2020 children,
2121 className,
2222 size = 'md' ,
23- variant = 'primary ' ,
23+ variant = 'default ' ,
2424 ...spanProps
2525} : BadgeProps ) => (
2626 < span
Original file line number Diff line number Diff line change 111111 box-shadow : var (--light-elevation-2 );
112112 }
113113
114+ & ::after {
115+ border-radius : inherit ;
116+ }
117+
114118 & .str-chat__button--size-lg {
115119 padding-block : var (--button-padding-y-lg );
116120 padding-inline : var (--button-padding-x-with-label-lg );
Original file line number Diff line number Diff line change @@ -59,9 +59,11 @@ export const CommandsMenu = () => {
5959 const channelConfig = messageComposer . channel . getConfig ( ) ;
6060 const commands = useMemo < ( CommandResponse & { name : string } ) [ ] > (
6161 ( ) =>
62- ( channelConfig ?. commands ?? [ ] ) . filter (
63- ( command ) : command is CommandResponse & { name : string } => ! ! command . name ,
64- ) ,
62+ ( channelConfig ?. commands ?? [ ] )
63+ . filter (
64+ ( command ) : command is CommandResponse & { name : string } => ! ! command . name ,
65+ )
66+ . sort ( ( a , b ) => ( a . name ?? '' ) . localeCompare ( b . name ?? '' ) ) ,
6567 [ channelConfig ] ,
6668 ) ;
6769
Original file line number Diff line number Diff line change @@ -299,6 +299,16 @@ const MessageListWithContext = (props: MessageListWithContextProps) => {
299299 threadList = { threadList }
300300 />
301301 </ div >
302+ < NewMessageNotification
303+ newMessageCount = { channelUnreadUiState ?. unread_messages }
304+ showNotification = { hasNewMessages || hasMoreNewer }
305+ />
306+ < ScrollToLatestMessageButton
307+ isMessageListScrolledToBottom = { isMessageListScrolledToBottom }
308+ isNotAtLatestMessageSet = { hasMoreNewer }
309+ onClick = { scrollToBottomFromNotification }
310+ threadList = { threadList }
311+ />
302312 </ DialogManagerProvider >
303313 </ MessageListMainPanel >
304314 < MessageListNotifications notifications = { notifications } />
Original file line number Diff line number Diff line change 1010 align-items : center ;
1111}
1212
13+ .str-chat__message-list-main-panel {
14+ --str-chat__message-list-scroll-max-width : calc (
15+ var (--str-chat__message-composer-max-width ) +
16+ var (--str-chat__message-composer-padding )
17+ );
18+ }
19+
1320.str-chat__message-list {
1421 @include utils .scrollable ;
1522 display : flex ;
2431 .str-chat__message-list-scroll {
2532 @include utils .message-list-spacing ;
2633 /* Max container 800px, 16px padding → 768px readable content; matches composer width + padding */
27- max-width : calc (
28- var (--str-chat__message-composer-max-width ) +
29- var (--str-chat__message-composer-padding )
30- );
34+ max-width : var (--str-chat__message-list-scroll-max-width );
3135 .str-chat__ul {
3236 list-style : none ;
3337 padding : 0 ;
Original file line number Diff line number Diff line change 33 width : 40px ;
44 position : absolute ;
55 inset-block-end : var (--spacing-md );
6- inset-inline-end : var (--spacing-md );
6+ inset-inline-end : max (
7+ var (--spacing-md ),
8+ calc ((100% - var (--str-chat__message-list-scroll-max-width )) / 2 + var (--spacing-md ))
9+ );
710 z-index : 2 ;
811 border-radius : var (--radius-max );
912 background-color : var (--background-elevation-elevation-1 );
Original file line number Diff line number Diff line change 55// Layout
66.str-chat__virtual-list {
77 @include utils .scrollable ;
8+ --str-chat__message-list-scroll-max-width : calc (
9+ var (--str-chat__message-composer-max-width ) +
10+ var (--str-chat__message-composer-padding )
11+ );
812 position : relative ;
913 flex : 1 ;
1014 -webkit-overflow-scrolling : touch ; /* enable smooth scrolling on ios */
Original file line number Diff line number Diff line change @@ -118,7 +118,15 @@ export const SuggestionList = ({
118118
119119 const contextMenuItems = useMemo < ContextMenuItemComponent [ ] > ( ( ) => {
120120 if ( ! component ) return [ ] ;
121- return ( items ?? [ ] ) . map ( ( item , i ) => {
121+ const sortedItems =
122+ suggestions ?. searchSource . type === 'commands'
123+ ? [ ...( items ?? [ ] ) ] . sort ( ( a , b ) =>
124+ String ( ( a as { name ?: string } ) . name ?? '' ) . localeCompare (
125+ String ( ( b as { name ?: string } ) . name ?? '' ) ,
126+ ) ,
127+ )
128+ : ( items ?? [ ] ) ;
129+ return sortedItems . map ( ( item , i ) => {
122130 const Item : ContextMenuItemComponent = ( {
123131 closeMenu : _ , // eslint-disable-line @typescript-eslint/no-unused-vars
124132 openSubmenu : __ , //eslint-disable-line @typescript-eslint/no-unused-vars
@@ -141,6 +149,7 @@ export const SuggestionList = ({
141149 focusedItemIndex ,
142150 setFocusedItemIndex ,
143151 AutocompleteSuggestionItem ,
152+ suggestions ?. searchSource . type ,
144153 ] ) ;
145154
146155 const ItemsWrapper = useCallback (
You can’t perform that action at this time.
0 commit comments