Skip to content

Commit 24f18ba

Browse files
authored
feat: remove resizer border imitation and drop resizer highlight (#9806)
* Made details view pop Rearrange div structure to achieve an unfolded lane layout. The idea is to adjust the right margin and render the details view as an absolutely positioned element, allowing the scrollbar to be on the right side of the whole lane. Otherwise, the scrollbar would appear in the middle between sections, which doesn’t fit the layout. * Details view resizer refactoring Because we decided not to resize the commit/branch details section, and the changes preview section now takes only the maximum height of the remaining space or fits the content, basically only one section is resizable — the changes list. That’s why we don’t need complex calculations here. * feat: remove resizer border imitation and drop resizer highlight
1 parent 91bd2dd commit 24f18ba

File tree

6 files changed

+8
-104
lines changed

6 files changed

+8
-104
lines changed

apps/desktop/src/components/BranchesView.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@
267267
viewport={branchViewLeftEl}
268268
direction="right"
269269
minWidth={14}
270-
borderRadius="ml"
271270
persistId="resizer-branchesWidth"
272271
defaultValue={24}
273272
/>

apps/desktop/src/components/ChangedFiles.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
});
7474
</script>
7575

76-
<Drawer {grow} {ontoggle} {resizer} {noshrink}>
76+
<Drawer {grow} {ontoggle} {resizer} {noshrink} bottomBorder>
7777
{#snippet header()}
7878
<h4 class="text-14 text-semibold truncate">{title}</h4>
7979
<div class="text-11 header-stats">
@@ -99,6 +99,7 @@
9999
{conflictEntries}
100100
{draggableFiles}
101101
{ancestorMostConflictedCommitId}
102+
hideLastFileBorder={false}
102103
onselect={() => {
103104
if (stackId) {
104105
intelligentScrollingService.show(projectId, stackId, 'diff');
@@ -125,6 +126,7 @@
125126
.filelist-wrapper {
126127
display: flex;
127128
flex-direction: column;
129+
margin-bottom: 16px;
128130
background-color: var(--clr-bg-1);
129131
130132
&.bottom-border {

apps/desktop/src/components/Drawer.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@
161161
passive={resizer.passive}
162162
hidden={$collapsed}
163163
direction="down"
164-
imitateBorder
165164
{...resizer}
166165
{maxHeight}
167166
/>

apps/desktop/src/components/MainViewport.svelte

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ the window, then enlarge it and retain the original widths of the layout.
154154
minWidth={leftMinWidth}
155155
defaultValue={leftDefaultWidth}
156156
maxWidth={leftMaxWidth}
157-
imitateBorder
158-
borderRadius={!preview ? 'ml' : 'none'}
159157
persistId="viewport-${name}-left-section"
160158
onWidth={(width) => {
161159
leftPreferredWidth = width;
@@ -182,7 +180,6 @@ the window, then enlarge it and retain the original widths of the layout.
182180
direction="right"
183181
minWidth={previewMinWidth}
184182
maxWidth={previewMaxWidth}
185-
borderRadius="ml"
186183
persistId="viewport-${name}-left-sideview"
187184
defaultValue={pxToRem(previewWidth?.default, zoom)}
188185
onWidth={(width) => {
@@ -225,7 +222,6 @@ the window, then enlarge it and retain the original widths of the layout.
225222
minWidth={rightMinWidth}
226223
defaultValue={pxToRem(rightWidth.default, zoom)}
227224
maxWidth={rightMaxWidth}
228-
borderRadius="ml"
229225
persistId="viewport-${name}-right-sideview"
230226
onWidth={(width) => {
231227
rightPreferredWidth = width;
@@ -307,7 +303,6 @@ the window, then enlarge it and retain the original widths of the layout.
307303
308304
.left-sideview-open .left-section__content {
309305
border-radius: var(--radius-ml) 0 0 var(--radius-ml);
310-
border-right-color: transparent;
311306
}
312307
313308
.main-section {

apps/desktop/src/components/Resizer.svelte

Lines changed: 5 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,8 @@
1515
viewport: HTMLElement;
1616
/** Sets direction of resizing for viewport */
1717
direction: 'left' | 'right' | 'up' | 'down';
18-
/** Border radius for cases when the resizable element has rounded corners */
19-
borderRadius?: 's' | 'm' | 'ml' | 'l' | 'none';
2018
/** Custom z-index in case of overlapping with other elements */
2119
zIndex?: string;
22-
/** imitate border */
23-
imitateBorder?: boolean;
24-
borderColor?: string;
2520
/** Other resizers with the same name will receive same updates. */
2621
syncName?: string;
2722
/** Name under which the latest width is stored. */
@@ -47,7 +42,6 @@
4742
onWidth?: (width: number) => void;
4843
onResizing?: (isResizing: boolean) => void;
4944
onOverflow?: (value: number) => void;
50-
onHover?: (isHovering: boolean) => void;
5145
onDblClick?: () => void;
5246
}
5347
@@ -60,9 +54,6 @@
6054
maxWidth = 120,
6155
minHeight = 0,
6256
maxHeight = 120,
63-
borderRadius = 'none',
64-
imitateBorder,
65-
borderColor = 'var(--clr-border-2)',
6657
syncName,
6758
persistId,
6859
passive,
@@ -72,7 +63,6 @@
7263
unsetMaxHeight,
7364
onResizing,
7465
onOverflow,
75-
onHover,
7666
onDblClick,
7767
onWidth
7868
}: Props = $props();
@@ -227,10 +217,6 @@
227217
}
228218
}
229219
230-
function isHovered(isHovered: boolean) {
231-
onHover?.(isHovered);
232-
}
233-
234220
function getValue() {
235221
if ($value !== undefined) {
236222
return $value;
@@ -292,21 +278,16 @@
292278
});
293279
</script>
294280

295-
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
296-
<!-- svelte-ignore a11y_no_static_element_interactions -->
297281
<div
282+
role="presentation"
298283
bind:this={resizerDiv}
299284
data-remove-from-draggable
300285
onmousedown={onMouseDown}
301286
ondblclick={() => {
302287
onDblClick?.();
303288
setValue(defaultValue);
304289
}}
305-
onmouseenter={() => isHovered(true)}
306-
onmouseleave={() => isHovered(false)}
307-
tabindex="0"
308290
class:hidden
309-
class:imitate-border={imitateBorder}
310291
class="resizer"
311292
class:dragging
312293
class:vertical={orientation === 'vertical'}
@@ -316,117 +297,46 @@
316297
class:left={direction === 'left'}
317298
class:right={direction === 'right'}
318299
style:z-index={zIndex}
319-
style:--resizer-border-radius="var(--radius-{borderRadius})"
320-
style:--border-imitation-color={borderColor}
321-
>
322-
<div class="resizer-line"></div>
323-
</div>
300+
></div>
324301

325302
<style lang="postcss">
326303
.resizer {
327-
--resizer-line-thickness: 0;
328-
--resizer-line-color: transparent;
329-
/* resizer-line-frame should be the same as border-radius */
330-
--resizer-line-frame: var(--resizer-border-radius, 1px);
304+
--resizer-thickness: 4px;
331305
--resizer-cursor: default;
332306
position: absolute;
333307
outline: none;
334308
cursor: var(--resizer-cursor);
335309
336-
&.imitate-border {
337-
--resizer-line-color: var(--border-imitation-color);
338-
--resizer-line-thickness: 1px;
339-
}
340-
341-
&:not(.hidden) {
342-
&:hover,
343-
&:focus,
344-
&.dragging {
345-
--resizer-line-color: var(--resizer-color);
346-
--resizer-line-thickness: 0.14rem;
347-
348-
& .resizer-line {
349-
transition-delay: 0.1s;
350-
}
351-
}
352-
}
353-
354310
&.horizontal {
355311
--resizer-cursor: col-resize;
356312
top: 0;
357-
width: 4px;
313+
width: var(--resizer-thickness);
358314
height: 100%;
359-
360-
& .resizer-line {
361-
width: var(--resizer-line-frame);
362-
}
363315
}
364316
365317
&.vertical {
366318
--resizer-cursor: row-resize;
367319
left: 0;
368320
width: 100%;
369-
height: 4px;
370-
371-
& .resizer-line {
372-
height: var(--resizer-line-frame);
373-
}
321+
height: var(--resizer-thickness);
374322
}
375323
376324
&.right {
377325
right: 0;
378-
379-
& .resizer-line {
380-
left: auto;
381-
border-right: var(--resizer-line-thickness) solid var(--resizer-line-color);
382-
border-top-right-radius: var(--resizer-border-radius);
383-
border-bottom-right-radius: var(--resizer-border-radius);
384-
}
385326
}
386327
&.left {
387328
left: 0;
388-
389-
& .resizer-line {
390-
right: auto;
391-
border-left: var(--resizer-line-thickness) solid var(--resizer-line-color);
392-
border-top-left-radius: var(--resizer-border-radius);
393-
border-bottom-left-radius: var(--resizer-border-radius);
394-
}
395329
}
396330
&.up {
397331
top: 0;
398-
399-
& .resizer-line {
400-
bottom: auto;
401-
border-top: var(--resizer-line-thickness) solid var(--resizer-line-color);
402-
border-top-right-radius: var(--resizer-border-radius);
403-
border-top-left-radius: var(--resizer-border-radius);
404-
}
405332
}
406333
&.down {
407334
bottom: 0;
408-
409-
& .resizer-line {
410-
top: auto;
411-
border-bottom: var(--resizer-line-thickness) solid var(--resizer-line-color);
412-
border-bottom-right-radius: var(--resizer-border-radius);
413-
border-bottom-left-radius: var(--resizer-border-radius);
414-
}
415335
}
416336
417337
&.hidden {
418338
pointer-events: none;
419339
--resizer-cursor: default;
420340
}
421341
}
422-
423-
.resizer-line {
424-
position: absolute;
425-
top: 0;
426-
right: 0;
427-
bottom: 0;
428-
left: 0;
429-
pointer-events: none;
430-
transition: border 0.1s ease;
431-
}
432342
</style>

apps/desktop/src/routes/[projectId]/history/+page.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@
194194
viewport={sidebarEl}
195195
direction="right"
196196
minWidth={14}
197-
borderRadius="ml"
198197
persistId="resizer-historyWidth"
199198
defaultValue={30}
200199
/>

0 commit comments

Comments
 (0)