mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-06-09 19:45:17 +02:00
fix: keep overflow menu open when toggling items inside it
Toggling an in-menu item (code mode, agent, search, perm) updated state that was in the collapse-reset deps, resetting collapseLevel to 0 and unmounting the '...' trigger mid-interaction. Drop the in-place toggles from the reset deps so the menu stays open on click.
This commit is contained in:
parent
c0ebfc3ef2
commit
c8a015106d
1 changed files with 6 additions and 2 deletions
|
|
@ -313,10 +313,14 @@ function ChatInputInner({
|
|||
return () => ro.disconnect()
|
||||
}, [])
|
||||
|
||||
// …or when the set/labels of items changes (these all affect item widths).
|
||||
// …or when the *set* of items changes (an item appears/disappears, or the model
|
||||
// name width changes). Deliberately excludes the in-place toggles (searchEnabled,
|
||||
// permissionMode, codeModeEnabled, codingAgent): those fire from the overflow menu
|
||||
// for items already inside it, so resetting here would unmount the open menu. The
|
||||
// no-dep effect below still re-collapses if any toggle happens to widen the row.
|
||||
useLayoutEffect(() => {
|
||||
setCollapseLevel(0)
|
||||
}, [workDir, searchEnabled, searchAvailable, codeModeEnabled, codeModeFeatureEnabled, codingAgent, permissionMode, lockedModel, activeModelKey])
|
||||
}, [workDir, searchAvailable, codeModeFeatureEnabled, lockedModel, activeModelKey])
|
||||
|
||||
// After each render, if the left group still overflows, collapse one more step.
|
||||
// Runs before paint, so the intermediate (overflowing) state is never visible.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue