perf(app): stop restyling the whole side panel on every frame of a resize drag

This commit is contained in:
Luke Parker
2026-11-04 12:30:09 +10:00
Unverified
parent fe04656465
commit d49b63142d
2 changed files with 8 additions and 2 deletions
@@ -53,6 +53,12 @@ export function SideRegion(props: {
sidebar: PanelSidebar
present?: boolean
size: Sizing
/**
* The width the contents keep, the side region's open width, which a close keeps as the far end of its travel. Set
* on the content box alone: an inherited custom property on an ancestor restyled every element in the region, the
* review's diffs included, on every frame of a resize drag.
*/
contentWidth: Accessor<string>
drag: PaneDrag
}) {
const layout = useLayout()
@@ -122,7 +128,7 @@ export function SideRegion(props: {
<div
data-slot="session-review-content"
class="h-full flex shrink-0 contain-strict"
style={{ width: "var(--panel-hold-width, var(--session-side-content-width, 100%))" }}
style={{ width: `var(--panel-hold-width, ${props.contentWidth()})` }}
>
<div
ref={stack}
+1 -1
View File
@@ -532,7 +532,6 @@ function SessionScreenContent(props: {
ref={sideContent}
data-slot="session-side-panel-content"
class="absolute inset-y-0 start-0 size-full [contain:layout_style] will-change-[opacity]"
style={{ "--session-side-content-width": screen.side.contentWidth() }}
>
<div data-slot="session-side-region" class="absolute inset-0 min-h-0 overflow-visible">
<Show when={store.sideMounted}>
@@ -544,6 +543,7 @@ function SessionScreenContent(props: {
sidebar={sidebar}
present={sideMotion.present()}
size={screen.size}
contentWidth={screen.side.contentWidth}
drag={drag}
/>
</div>