[PR #1639] [MERGED] Stop the connections sidebar squishing during panel resize #5172

Closed
opened 2026-10-22 04:13:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1639
Author: @Romuromylus
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @Romuromylus

Base: refactor ← Head: fix/connections-resize-lag


📝 Commits (1)

  • 14b4b00 Stop the connections sidebar squishing during panel resize

📊 Changes

6 files changed (+54 additions, -4 deletions)

View changed files

📝 src/app/shell/AppShell.tsx (+4 -1)
📝 src/features/shell/connections/components/ConnectionsPanel.tsx (+18 -2)
📝 src/features/shell/settings/components/settings/TTSConfigCard.tsx (+1 -1)
📝 src/shared/stores/ui.store.test.ts (+24 -0)
📝 src/shared/stores/ui.store.ts (+2 -0)
📝 src/shared/stores/ui/model.ts (+5 -0)

📄 Description

Why this change

The connections right panel was the only right-side panel that lagged and squished while dragging the panel resizer. Two independent causes, both unique to it:

  1. transition-all on inner cards. The ConnectionRow and TTSConfigCard root divs used transition-all, which animates width. Every connection card therefore ran a width transition on every resize frame.
  2. framer-motion Reorder layout animation. ConnectionsPanel is the only right-side panel using Reorder. Each Reorder.Item defaults to layout=true and runs a layout-projection measure/animate on every width change, producing the squish/squash.

The AppShell <aside> already disables transition-[width] during drag, so the container was fine; the jank was entirely these two inner sources.

What changed

  • ConnectionsPanel.tsx / TTSConfigCard.tsx: swap the two transition-all root classes to transition-colors. The only animated effect on either element is a hover/expand color change, so behavior is preserved while the per-frame width animation is gone.
  • ui/model.ts + ui.store.ts: add a transient rightPanelResizing flag and setter, beside the existing transient centerCompact. Intentionally not added to partializeUiState, so it is never persisted.
  • AppShell.tsx: set the flag on right-panel drag start and clear it in the shared finishResize teardown (covering mouseup and the window-blur path).
  • ConnectionsPanel.tsx (folder rows): read the flag and pass layout=false to Reorder.Item while resizing, suppressing the per-item layout projection. layout is omitted from ReorderItemProps's public type even though the runtime forwards it, so it goes through a loosely-typed spread (commented). Drag-to-reorder is unchanged because the reorder measurement is independent of the layout flag.

Verification

  • pnpm exec tsc -b clean (validates the new store field and the typed-omit spread).
  • New ui.store.test.ts cases pass: flag defaults to false, toggles via its setter, and is absent from partializeUiState (never persisted).
  • Playwright boot repro: the app mounts with the new wiring and a transition-colors element does not animate all; no error from the new symbols.

Manual

The perceived smoothness (framer-motion layout suppression) and drag-to-reorder-after-resize are visual/interaction behaviors not capturable by an assertion; verified by driving the connections panel in the browser tier. Worth a quick look on a real display.

Risk

layout={false} is passed via a loosely-typed spread because framer-motion 12 omits layout from ReorderItemProps while still forwarding it at runtime; a future framer-motion major could change that forwarding (noted in a code comment). Mobile is unaffected (the resize gesture returns early on mobile, so the flag never sets).

Linked issue

Closes #1586.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1639 **Author:** [@Romuromylus](https://github.com/Romuromylus) **Created:** 5/30/2026 **Status:** ✅ Merged **Merged:** 5/30/2026 **Merged by:** [@Romuromylus](https://github.com/Romuromylus) **Base:** `refactor` ← **Head:** `fix/connections-resize-lag` --- ### 📝 Commits (1) - [`14b4b00`](https://github.com/Pasta-Devs/Marinara-Engine/commit/14b4b00a9695c441b9d4eaeddfa9d7ea8b77f8eb) Stop the connections sidebar squishing during panel resize ### 📊 Changes **6 files changed** (+54 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/app/shell/AppShell.tsx` (+4 -1) 📝 `src/features/shell/connections/components/ConnectionsPanel.tsx` (+18 -2) 📝 `src/features/shell/settings/components/settings/TTSConfigCard.tsx` (+1 -1) 📝 `src/shared/stores/ui.store.test.ts` (+24 -0) 📝 `src/shared/stores/ui.store.ts` (+2 -0) 📝 `src/shared/stores/ui/model.ts` (+5 -0) </details> ### 📄 Description ## Why this change The connections right panel was the only right-side panel that lagged and squished while dragging the panel resizer. Two independent causes, both unique to it: 1. **`transition-all` on inner cards.** The `ConnectionRow` and `TTSConfigCard` root divs used `transition-all`, which animates `width`. Every connection card therefore ran a width transition on every resize frame. 2. **framer-motion `Reorder` layout animation.** `ConnectionsPanel` is the only right-side panel using `Reorder`. Each `Reorder.Item` defaults to `layout=true` and runs a layout-projection measure/animate on every width change, producing the squish/squash. The AppShell `<aside>` already disables `transition-[width]` during drag, so the container was fine; the jank was entirely these two inner sources. ## What changed - `ConnectionsPanel.tsx` / `TTSConfigCard.tsx`: swap the two `transition-all` root classes to `transition-colors`. The only animated effect on either element is a hover/expand color change, so behavior is preserved while the per-frame width animation is gone. - `ui/model.ts` + `ui.store.ts`: add a transient `rightPanelResizing` flag and setter, beside the existing transient `centerCompact`. Intentionally **not** added to `partializeUiState`, so it is never persisted. - `AppShell.tsx`: set the flag on right-panel drag start and clear it in the shared `finishResize` teardown (covering mouseup and the window-blur path). - `ConnectionsPanel.tsx` (folder rows): read the flag and pass `layout=false` to `Reorder.Item` while resizing, suppressing the per-item layout projection. `layout` is omitted from `ReorderItemProps`'s public type even though the runtime forwards it, so it goes through a loosely-typed spread (commented). Drag-to-reorder is unchanged because the reorder measurement is independent of the layout flag. ## Verification - `pnpm exec tsc -b` clean (validates the new store field and the typed-omit spread). - New `ui.store.test.ts` cases pass: flag defaults to `false`, toggles via its setter, and is absent from `partializeUiState` (never persisted). - Playwright boot repro: the app mounts with the new wiring and a `transition-colors` element does not animate `all`; no error from the new symbols. ## Manual The perceived smoothness (framer-motion layout suppression) and drag-to-reorder-after-resize are visual/interaction behaviors not capturable by an assertion; verified by driving the connections panel in the browser tier. Worth a quick look on a real display. ## Risk `layout={false}` is passed via a loosely-typed spread because framer-motion 12 omits `layout` from `ReorderItemProps` while still forwarding it at runtime; a future framer-motion major could change that forwarding (noted in a code comment). Mobile is unaffected (the resize gesture returns early on mobile, so the flag never sets). ## Linked issue Closes #1586. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:13:55 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5172
No description provided.