Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
fix resizing issue (#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroHryshyn authored Jan 3, 2024
1 parent a460fcc commit b1f0371
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
12 changes: 10 additions & 2 deletions intuita-webview/src/main/CodemodRuns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ export const CodemodRuns = (
<ResizablePanel
collapsible
minSize={0}
defaultSize={props.panelGroupSettings['0,0']?.[0] ?? 50}
defaultSize={
props.resultsCollapsed
? props.panelGroupSettings['0,0']?.[0] ?? 50
: 0
}
style={{
overflowY: 'auto',
overflowX: 'hidden',
Expand Down Expand Up @@ -127,7 +131,11 @@ export const CodemodRuns = (
<ResizablePanel
collapsible
minSize={0}
defaultSize={props.panelGroupSettings['0,0']?.[1] ?? 50}
defaultSize={
props.changeExplorerCollapsed
? 0
: props.panelGroupSettings['0,0']?.[1] ?? 50
}
style={{
overflowY: 'auto',
overflowX: 'hidden',
Expand Down
7 changes: 7 additions & 0 deletions src/data/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,13 @@ const rootSlice = createSlice({
);
}

// if we persist collapsed state (e.g [0, 100]), last noticed panel sizes (user's resizing) will be lost when panel is unmounted
// so we want to persist only users resizing
// collapsed state is already handled by boolean flags resultsCollapsed, changeExplorerCollapsed
if (validation.right['0,0']?.some((size) => size === 0)) {
return;
}

state.codemodRunsTab.panelGroupSettings = validation.right;
} catch (error) {
console.error(error);
Expand Down

0 comments on commit b1f0371

Please sign in to comment.