Skip to content

Commit 5b31324

Browse files
committed
Improve status bar action padding based on label presence and position
- only last item should have padding [Fragment], non last ones should have 0 5px 0 4px. When not having label, non last actions should have 0 4px - rename noLabel to no-label
1 parent 89593a8 commit 5b31324

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

‎packages/ui/src/components/editor/prompt-view/StatusBar/StatusBar.module.scss‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,15 @@
145145
gap: 4px;
146146
cursor: pointer;
147147
white-space: nowrap;
148-
padding: 0 7px 0 4px;
148+
padding: 0 5px 0 4px;
149+
150+
&.no-label {
151+
padding: 0 4px;
152+
}
153+
154+
&.last {
155+
padding: 0 7px 0 4px;
156+
}
149157

150158
&:hover {
151159
background-color: var(--vscode-list-hoverBackground);

‎packages/ui/src/components/editor/prompt-view/StatusBar/StatusBar.tsx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,17 @@ export const StatusBar: React.FC<Props> = (props) => {
5454
</div>
5555
{props.actions && props.actions.length > 0 && (
5656
<div className={styles.actions}>
57-
{props.actions.map((action) => {
57+
{props.actions.map((action, index) => {
58+
const is_last = index == props.actions!.length - 1
59+
const has_label = !!action.label
60+
5861
const content = (
5962
<div
6063
key={action.id}
61-
className={styles.action}
64+
className={cn(styles.action, {
65+
[styles.last]: is_last,
66+
[styles['no-label']]: !has_label
67+
})}
6268
onClick={action.on_click}
6369
title={action.title}
6470
>

0 commit comments

Comments
 (0)