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
+6
View File
@@ -184,6 +184,12 @@ export class PtyManager {
}
}
/** Close every terminal of one session (the conversation was deleted —
* terminals must follow the session, not linger until the grace expires). */
closeSession(sessionId: string): void {
for (const key of this.keysOf(sessionId)) this.close(key)
}
/** Close every terminal (plugin teardown). */
disposeAll(): void {
for (const timer of this.pendingCloses.values()) clearTimeout(timer)