Paddings and ui fixes
This commit is contained in:
parent
969c64d106
commit
5767158737
3 changed files with 17 additions and 0 deletions
|
|
@ -57,6 +57,7 @@ a {
|
||||||
|
|
||||||
.chat-input-area {
|
.chat-input-area {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
padding: 0 0.75rem 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override CopilotKit's absolute positioning on the input container
|
/* Override CopilotKit's absolute positioning on the input container
|
||||||
|
|
|
||||||
|
|
@ -464,7 +464,9 @@ function ChatContentInner({
|
||||||
// container, which we've overridden to flow in a flex layout).
|
// container, which we've overridden to flow in a flex layout).
|
||||||
// Uses a ref callback so it runs when the element actually mounts.
|
// Uses a ref callback so it runs when the element actually mounts.
|
||||||
const paddingObserver = useRef<MutationObserver | null>(null);
|
const paddingObserver = useRef<MutationObserver | null>(null);
|
||||||
|
const scrollAreaRef = useRef<HTMLDivElement | null>(null);
|
||||||
const scrollAreaCallbackRef = useCallback((node: HTMLDivElement | null) => {
|
const scrollAreaCallbackRef = useCallback((node: HTMLDivElement | null) => {
|
||||||
|
scrollAreaRef.current = node;
|
||||||
if (paddingObserver.current) {
|
if (paddingObserver.current) {
|
||||||
paddingObserver.current.disconnect();
|
paddingObserver.current.disconnect();
|
||||||
paddingObserver.current = null;
|
paddingObserver.current = null;
|
||||||
|
|
@ -487,6 +489,19 @@ function ChatContentInner({
|
||||||
paddingObserver.current = observer;
|
paddingObserver.current = observer;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// Auto-scroll to bottom when messages change or agent is streaming
|
||||||
|
// biome-ignore lint/correctness/useExhaustiveDependencies: JSON.stringify tracks content changes
|
||||||
|
useEffect(() => {
|
||||||
|
const el = scrollAreaRef.current;
|
||||||
|
if (!el) return;
|
||||||
|
// Find the actual scrollable child (CopilotKit's scroll container)
|
||||||
|
const scrollable =
|
||||||
|
el.querySelector("[data-radix-scroll-area-viewport]") ??
|
||||||
|
el.querySelector("[style*='overflow']") ??
|
||||||
|
el;
|
||||||
|
scrollable.scrollTop = scrollable.scrollHeight;
|
||||||
|
}, [JSON.stringify(agent.messages), agent.isRunning]);
|
||||||
|
|
||||||
const sessionContext = chatState.session_context;
|
const sessionContext = chatState.session_context;
|
||||||
const documentFilter = chatState.document_filter;
|
const documentFilter = chatState.document_filter;
|
||||||
const initialContext = chatState.initial_context ?? "";
|
const initialContext = chatState.initial_context ?? "";
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ class ContextModal(ModalScreen): # pragma: no cover
|
||||||
|
|
||||||
#button-row Button {
|
#button-row Button {
|
||||||
margin-left: 1;
|
margin-left: 1;
|
||||||
|
min-width: 10;
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue