Skip to content

Commit 7b80d20

Browse files
authored
Problems pane consistency (#1817)
* rename '_top/buttom' to be more intuitive * Ensure we toggle problems collapsed state onclick
1 parent f03d8c3 commit 7b80d20

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

frontend/src/components/Diff/CompilationPanel.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,16 @@ export default function CompilationPanel({
101101
<Allotment
102102
ref={allotment}
103103
vertical
104-
onChange={([_top, bottom]) => {
105-
if (_top === undefined || bottom === undefined) {
104+
onChange={([_diffHeight, problemsHeight]) => {
105+
if (
106+
_diffHeight === undefined ||
107+
problemsHeight === undefined
108+
) {
106109
return;
107110
}
108-
setIsProblemsCollapsed(bottom <= problemsCollapsedHeight);
111+
setIsProblemsCollapsed(
112+
problemsHeight <= problemsCollapsedHeight,
113+
);
109114
}}
110115
>
111116
<Allotment.Pane>
@@ -138,6 +143,7 @@ export default function CompilationPanel({
138143
<GhostButton
139144
className="flex w-max grow justify-between text-gray-11"
140145
onClick={() => {
146+
setIsProblemsCollapsed((curr) => !curr);
141147
const containerHeight =
142148
container.current?.clientHeight ?? 0;
143149
const newProblemsHeight =

0 commit comments

Comments
 (0)