refactor(ui): modularize instance shell

Split InstanceShell2 into focused shell modules (drawer chrome/resize, session context/cache, sidebar, right panel tabs/components) to improve maintainability while preserving behavior.
This commit is contained in:
Shantur Rathore
2026-02-11 08:16:44 +00:00
parent 63ffb86ea7
commit 8ce7a9b4ee
21 changed files with 3249 additions and 2643 deletions

View File

@@ -0,0 +1,29 @@
type GlobalPointerDragHandlers = {
onMouseMove: (event: MouseEvent) => void
onMouseUp: (event: MouseEvent) => void
onTouchMove: (event: TouchEvent) => void
onTouchEnd: (event: TouchEvent) => void
}
type GlobalPointerDrag = {
start: () => void
stop: () => void
}
export function useGlobalPointerDrag(handlers: GlobalPointerDragHandlers): GlobalPointerDrag {
const start = () => {
document.addEventListener("mousemove", handlers.onMouseMove)
document.addEventListener("mouseup", handlers.onMouseUp)
document.addEventListener("touchmove", handlers.onTouchMove, { passive: false })
document.addEventListener("touchend", handlers.onTouchEnd)
}
const stop = () => {
document.removeEventListener("mousemove", handlers.onMouseMove)
document.removeEventListener("mouseup", handlers.onMouseUp)
document.removeEventListener("touchmove", handlers.onTouchMove)
document.removeEventListener("touchend", handlers.onTouchEnd)
}
return { start, stop }
}