mirror of
https://github.com/stablyai/orca.git
synced 2026-10-13 00:02:54 +00:00
3.0 KiB
3.0 KiB
Right Sidebar Header Drag Region
Problem
Right sidebar header blank space does not drag the window.
- In top mode, the header row (
right-sidebar/index.tsx, current line ~313) has no-webkit-app-region: drag. - In side mode, the title row (
right-sidebar/index.tsx, current line ~332) has no-webkit-app-region: drag. - The app already uses draggable titlebar surfaces elsewhere (
.titlebar,.titlebar-leftinmain.css), so this is an inconsistency.
Current Behavior (Verified)
ActivityBarButtonrenders plain<button>elements with nono-dragclass.- Close button is already safe because
.sidebar-togglesets-webkit-app-region: no-drag. - Top-mode activity bar context menu is currently bound to the full header row via
ContextMenuTrigger. - Side-mode activity bar context menu is bound to the side icon strip, not the side-mode title row.
Constraints That Matter
-webkit-app-region: dragis required for Electron window drag hit-testing.- Interactive descendants inside a drag region must be
-webkit-app-region: no-drag, or click behavior becomes unreliable. - Do not depend on blank-space right-click inside a drag region for opening menus; attach context-menu trigger to a guaranteed
no-dragtarget. - No visual/layout changes; keep existing Windows inset behavior (
right-sidebar-header-inset,right-sidebar-header-side-inset,side-activity-bar-windows-inset).
Design
- Add utility classes in
src/renderer/src/assets/main.css:.right-sidebar-header-drag { -webkit-app-region: drag; user-select: none; }.right-sidebar-header-no-drag { -webkit-app-region: no-drag; }
- Apply
.right-sidebar-header-dragto both header wrappers:- top activity-bar row
- side-mode title row
- Apply
.right-sidebar-header-no-dragto all interactive header descendants:ActivityBarButtonroot button- top-mode icon-row wrapper that owns context-menu trigger
- close button is already covered by
.sidebar-toggle(keep as-is)
- Move top-mode
ContextMenuTriggerfrom the whole header row to ano-dragtarget (icon-row wrapper). Do not bind it to the drag surface. - Keep side-mode context-menu wiring on the side icon strip unchanged.
Validation
- Top mode: blank area drags window.
- Top mode: tab icons click reliably; close button click remains reliable.
- Top mode: context menu opens from icon row (not blank drag area).
- Side mode: title/blank area drags; close button remains clickable.
- Left-edge resize handle remains usable (
z-10, absolute overlay). - Windows: overlay controls do not cover close button/icons after insets.
- Sidebar closed (
width: 0,overflow-hidden): no leaked hit targets.
Concurrency / Consistency
- Multi-window safe: renderer-local CSS/DOM only, no shared mutable state.
- Store updates (
activityBarPosition,rightSidebarTab,rightSidebarOpen) are safe: drag/no-drag is static class wiring on re-rendered elements. - No IPC or async cross-process dependency, so no invalidation races introduced.