feat(ui): add new messages indicator button

This commit is contained in:
Shakker
2026-02-02 16:17:09 +00:00
parent 2af977f947
commit 13db0489c8
2 changed files with 19 additions and 0 deletions

View File

@@ -480,6 +480,8 @@ export function renderApp(state: AppViewState) {
onAbort: () => void state.handleAbortChat(),
onQueueRemove: (id) => state.removeQueuedMessage(id),
onNewSession: () => state.handleSendChat("/new", { restoreDraft: true }),
showNewMessages: state.chatNewMessagesBelow,
onScrollToBottom: () => state.scrollToBottom(),
// Sidebar props for tool output viewing
sidebarOpen: state.sidebarOpen,
sidebarContent: state.sidebarContent,

View File

@@ -53,6 +53,9 @@ export type ChatProps = {
// Image attachments
attachments?: ChatAttachment[];
onAttachmentsChange?: (attachments: ChatAttachment[]) => void;
// Scroll control
showNewMessages?: boolean;
onScrollToBottom?: () => void;
// Event handlers
onRefresh: () => void;
onToggleFocusMode: () => void;
@@ -340,6 +343,20 @@ export function renderChat(props: ChatProps) {
: nothing
}
${
props.showNewMessages
? html`
<button
class="chat-new-messages"
type="button"
@click=${props.onScrollToBottom}
>
New messages ${icons.arrowDown}
</button>
`
: nothing
}
<div class="chat-compose">
${renderAttachmentPreview(props)}
<div class="chat-compose__row">