fix: floating panel ResizeObserver broken by fragment index shift

Context menu insertion before floatingPanel shifted its fragment index,
causing React to unmount/recreate the DOM element on DM↔space transitions.
The ResizeObserver was left observing the old detached element, so
paddingBottom never adjusted and channels scrolled behind the panel.

- Reorder fragment children so floatingPanel is at index 1 in both views
- Replace useRef with callback ref so ResizeObserver reattaches on remount
- Add stopPropagation to ContextMenu to prevent sidebar menu conflicts
- Restyle sidebar create channel/category buttons (smaller, separated)
This commit is contained in:
Jannis Braun
2026-03-12 02:23:34 +01:00
parent 873215d848
commit 5193d79c39
2 changed files with 122 additions and 27 deletions
@@ -19,6 +19,7 @@ export function ContextMenu({ items, children }: ContextMenuProps) {
const handleContextMenu = (e: React.MouseEvent) => {
e.preventDefault();
e.stopPropagation();
setPosition({ x: e.clientX, y: e.clientY });
setIsOpen(true);
};