Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions core/http/react-ui/src/components/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,14 @@ export default function Sidebar({ isOpen, onClose }) {
}, [location.pathname])

const toggleCollapse = () => {
setCollapsed(prev => {
const next = !prev
try { localStorage.setItem(COLLAPSED_KEY, String(next)) } catch (_) { /* ignore */ }
window.dispatchEvent(new CustomEvent('sidebar-collapse', { detail: { collapsed: next } }))
return next
})
// Side effects (persist + broadcast) live in the handler body, never inside
// the setState updater: StrictMode double-invokes updaters in dev, and the
// synchronous sidebar-collapse dispatch re-entered setState from the
// listeners mid-update, so the toggle silently no-op'd in dev builds.
const next = !collapsed
try { localStorage.setItem(COLLAPSED_KEY, String(next)) } catch (_) { /* ignore */ }
setCollapsed(next)
window.dispatchEvent(new CustomEvent('sidebar-collapse', { detail: { collapsed: next } }))
}

const toggleSection = (id) => {
Expand Down
7 changes: 5 additions & 2 deletions core/http/react-ui/src/pages/Talk.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,12 @@ export default function Talk() {
.finally(() => setModelsLoading(false))
}, [])

// Auto-scroll transcript
// Auto-scroll the transcript's own overflow container. scrollIntoView bubbles
// to every scrollable ancestor (incl. the window), which yanked the whole
// page down to the transcript box on mount; scoping to the box avoids it.
useEffect(() => {
transcriptEndRef.current?.scrollIntoView({ behavior: 'smooth' })
const box = transcriptEndRef.current?.parentElement
box?.scrollTo({ top: box.scrollHeight, behavior: 'smooth' })
}, [transcript])

// Mirror Chat.jsx: connect / disconnect client MCP servers as the user toggles them.
Expand Down
Loading