Skip to content

Commit 2ac0357

Browse files
committed
style: add separator in model selection list
1 parent c94e258 commit 2ac0357

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

app/components/chat.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ export function ChatActions(props: {
551551
items={models.map((m) => ({
552552
title: m.name,
553553
value: m.name,
554+
family: m.family,
554555
}))}
555556
onClose={() => setShowModelSelector(false)}
556557
onSelection={(s) => {

app/components/ui-lib.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@
103103
padding: 10px 20px;
104104
animation: slide-in ease 0.6s;
105105

106+
&.list-item-separator {
107+
border-bottom: var(--border-in-dark);
108+
}
109+
106110
.list-header {
107111
display: flex;
108112
align-items: center;

app/components/ui-lib.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ export function Selector<T>(props: {
488488
title: string;
489489
subTitle?: string;
490490
value: T;
491+
family?: string;
491492
}>;
492493
defaultSelectedValue?: T;
493494
onSelection?: (selection: T[]) => void;
@@ -500,9 +501,15 @@ export function Selector<T>(props: {
500501
<List>
501502
{props.items.map((item, i) => {
502503
const selected = props.defaultSelectedValue === item.value;
504+
const lastOfFamily =
505+
i < props.items.length - 1 &&
506+
item.family !== props.items[i + 1].family;
503507
return (
504508
<ListItem
505-
className={styles["selector-item"]}
509+
className={
510+
styles["selector-item"] +
511+
(lastOfFamily ? " " + styles["list-item-separator"] : "")
512+
}
506513
key={i}
507514
title={item.title}
508515
subTitle={item.subTitle}

app/styles/globals.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
/* stroke */
2424
--border-in-light: 1px solid rgb(222, 222, 222);
25+
--border-in-dark: 1px solid rgb(136, 136, 136);
2526
}
2627

2728
@mixin dark {
@@ -40,6 +41,7 @@
4041
--bar-color: rgba(255, 255, 255, 0.1);
4142

4243
--border-in-light: 1px solid rgba(255, 255, 255, 0.192);
44+
--border-in-dark: 1px solid rgb(255, 255, 255, 0.56);
4345

4446
--theme-color: var(--gray);
4547

0 commit comments

Comments
 (0)