Skip to content

Commit 4b4be74

Browse files
authored
fix(ui): pin compact task-suggestion split button to the card top-right (#121246)
- Uses a four-column grid with inline top-row actions to keep the compact control pinned to the card corner. - Fixes both split halves at 26px, eliminating the chevron overhang. Release-note context: the suggested-task card's action button is now a compact split control in the top-right corner, matching the intended design.
1 parent 063acb9 commit 4b4be74

2 files changed

Lines changed: 36 additions & 21 deletions

File tree

‎ui/src/pages/chat/components/chat-task-suggestions.ts‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,6 @@ export function renderChatTaskSuggestions(props: {
6969
</div>
7070
</details>
7171
</div>
72-
${props.canDismiss
73-
? html`
74-
<button
75-
class="btn btn--ghost btn--icon task-suggestion__dismiss"
76-
type="button"
77-
?disabled=${busy}
78-
aria-label=${t("chat.taskSuggestions.dismiss", { title })}
79-
@click=${() => props.onDismiss(suggestion)}
80-
>
81-
${icons.x}
82-
</button>
83-
`
84-
: nothing}
8572
<div class="task-suggestion__actions">
8673
<div class="task-suggestion__split">
8774
<button
@@ -165,6 +152,19 @@ export function renderChatTaskSuggestions(props: {
165152
: nothing}
166153
</div>
167154
</div>
155+
${props.canDismiss
156+
? html`
157+
<button
158+
class="btn btn--ghost btn--icon task-suggestion__dismiss"
159+
type="button"
160+
?disabled=${busy}
161+
aria-label=${t("chat.taskSuggestions.dismiss", { title })}
162+
@click=${() => props.onDismiss(suggestion)}
163+
>
164+
${icons.x}
165+
</button>
166+
`
167+
: nothing}
168168
</article>
169169
`;
170170
})}

‎ui/src/styles/chat/layout.css‎

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@ openclaw-chat-video-player {
15861586
.task-suggestion {
15871587
position: relative;
15881588
display: grid;
1589-
grid-template-columns: auto minmax(0, 1fr) auto;
1589+
grid-template-columns: auto minmax(0, 1fr) auto auto;
15901590
align-items: start;
15911591
gap: 12px;
15921592
padding: 12px;
@@ -1667,46 +1667,61 @@ openclaw-chat-video-player {
16671667
}
16681668

16691669
.task-suggestion__actions {
1670-
grid-column: 2 / -1;
16711670
display: flex;
16721671
align-items: center;
1672+
align-self: start;
16731673
justify-self: end;
16741674
}
16751675

1676+
/* Compact split control pinned to the card's top-right; both halves share one
1677+
fixed height so the chevron cap can never overhang the primary segment. */
16761678
.task-suggestion__split {
16771679
display: inline-flex;
16781680
align-items: stretch;
1681+
height: 26px;
16791682
}
16801683

16811684
.task-suggestion__start {
16821685
display: inline-flex;
16831686
align-items: center;
1684-
gap: 6px;
1687+
gap: 5px;
1688+
height: 26px;
1689+
padding: 0 10px;
16851690
border-color: var(--accent);
16861691
border-radius: var(--radius-md) 0 0 var(--radius-md);
16871692
background: var(--primary);
16881693
color: var(--primary-foreground);
1694+
font-size: 12px;
1695+
line-height: 1;
16891696
white-space: nowrap;
16901697
}
16911698

16921699
.task-suggestion__start:only-child {
16931700
border-radius: var(--radius-md);
16941701
}
16951702

1703+
.task-suggestion__start svg {
1704+
width: 12px;
1705+
height: 12px;
1706+
}
1707+
16961708
.task-suggestion__menu-trigger {
1697-
min-width: 34px;
1698-
height: 100%;
1709+
display: grid;
1710+
width: 26px;
1711+
min-width: 26px;
1712+
height: 26px;
16991713
margin-left: -1px;
1700-
padding: 8px;
1714+
padding: 0;
1715+
place-items: center;
17011716
border-color: var(--accent);
17021717
border-radius: 0 var(--radius-md) var(--radius-md) 0;
17031718
background: var(--primary);
17041719
color: var(--primary-foreground);
17051720
}
17061721

17071722
.task-suggestion__menu-trigger svg {
1708-
width: 14px;
1709-
height: 14px;
1723+
width: 12px;
1724+
height: 12px;
17101725
}
17111726

17121727
.task-suggestion__menu[open] .task-suggestion__menu-trigger svg {

0 commit comments

Comments
 (0)