fix(sidebar): drag-release bounce, session-delete terminal cleanup, silent resize

- Sidebar.tsx: useLayoutEffect for the layout-push variables so cleanup+setup
  land in the same pre-paint frame (no full-width flash on drag release);
  applyDrag writes the width only while the panel is open (a closed right
  panel no longer squeezes the conversation when dragging the bottom height);
  flush the final drag frame before stopDragScheduling on all three handles;
  sync centerRect.right on width/corner release so the bottom panel does not
  jump.
- index.ts/pty-manager.ts: close a session's UI terminals immediately on
  session/disposed (they used to linger until reconnectGraceMs expired).
- sidebar.module.css: no highlight on the resize handles while dragging
  (local preference; the corner hover hint stays).
This commit is contained in:
chalei1122-cell
2026-08-16 17:43:29 +08:00
parent 3c196fffc3
commit 165ab03ea6
4 changed files with 77 additions and 16 deletions
+7
View File
@@ -705,6 +705,13 @@ export function apply(ctx: Context, config?: SidebarConfig): void {
wss.close()
agentListWss.close()
}, 'dsh-better-sidebar: teardown')
// Close all UI terminals of a session when the conversation is deleted —
// terminals follow the session, not the reconnect grace. Agent terminals
// are owned by the agent lifecycle and are not touched here.
ctx.on('session/disposed', (session) => {
try { ptyManager.closeSession(session?.id) } catch {}
}, { global: true })
}
/** Push the live agent-terminal list for one session to a connected sidebar view. */