Skip to content

Commit 18a5e0e

Browse files
committed
Add visual indentation guides for group separators in presets list
1 parent ddcbbad commit 18a5e0e

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

packages/ui/src/components/editor/panel/Presets/Presets.module.scss

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,34 @@
2828

2929
.presets__item__left {
3030
flex: 1;
31+
position: relative;
3132
&::after {
3233
content: '';
3334
flex: 1;
3435
height: 1px;
3536
margin-left: 4px;
3637
background: linear-gradient(
3738
to right,
38-
var(--cwc-border-color-dimmed),
39+
var(--vscode-tree-inactiveIndentGuidesStroke),
3940
transparent
4041
);
4142
}
4243
}
44+
45+
&--ending {
46+
.presets__item__left::before {
47+
content: '';
48+
position: absolute;
49+
top: 0;
50+
left: 26px;
51+
width: 1px;
52+
height: 6px;
53+
background-color: var(--vscode-tree-inactiveIndentGuidesStroke);
54+
}
55+
.presets__item__left::after {
56+
margin-bottom: 9px;
57+
}
58+
}
4359
}
4460

4561
&--highlighted {

packages/ui/src/components/editor/panel/Presets/Presets.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,24 @@ export const Presets: React.FC<Presets.Props> = (props) => {
297297
}}
298298
animation={150}
299299
>
300-
{sortable_list.map((preset) => {
300+
{sortable_list.map((preset, index) => {
301301
if (!preset.chatbot && !preset.name) {
302+
const is_previous_in_group =
303+
index > 0 &&
304+
preset_indices_in_group.has(
305+
sortable_list[index - 1].original_index
306+
)
307+
302308
return (
303309
<div
304310
key={preset.id}
305311
className={cn(
306312
styles.presets__item,
307-
styles['presets__item--separator']
313+
styles['presets__item--separator'],
314+
{
315+
[styles['presets__item--separator--ending']]:
316+
is_previous_in_group
317+
}
308318
)}
309319
>
310320
<div className={styles.presets__item__left}>

0 commit comments

Comments
 (0)