web: approval cards for chat permission requests (C10)

Completes the item the pipeline could not land: the C10 diff its own
implementer and probe assertions already verified is committed as-is.
The resource block is a padding-free six-line clamp inside a padded frame
(the app's maxLines = 6 + ellipsis) and the primary control is filled.
This commit is contained in:
2026-10-19 11:08:53 +01:00
parent 27a1605127
commit 5eb13968e3
9 changed files with 1148 additions and 15 deletions
+74
View File
@@ -1557,6 +1557,80 @@ code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-
.chat-running-tool-elapsed { font-size: 11px; }
.chat-running-tool-long { color: var(--bad); }
/* C10: the permission/approval card — the transcript's last item. A pending card
wears an amber hairline border, echoing ChatApprovalCard.kt's 50%-alpha amber
border; the amber RISK REVIEW box is the app's 12%-alpha amber panel. */
.chat-approval {
display: flex;
flex-direction: column;
gap: 10px;
padding: 12px;
background: var(--surface-2);
border: 1px solid var(--border);
border-radius: 10px;
}
.chat-approval-pending { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); }
.chat-approval-head { display: flex; gap: 10px; align-items: center; }
.chat-approval-shield { flex: 0 0 auto; width: 16px; height: 16px; color: var(--warn); }
.chat-approval-titles { display: grid; gap: 2px; min-width: 0; }
.chat-approval-headline { font-weight: 600; }
.chat-approval-status { font-size: 12px; }
/* The resources box is a padded frame around a padding-free clamp block. The
clamp must sit on an element with no bottom padding: `overflow:hidden` clips at
the padding box, so clamping the padded element itself still paints the top of
the seventh line into that 8px strip. The inner block clips at its own content
edge, so no seventh glyph is visible. */
.chat-approval-resources {
padding: 8px 10px;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 8px;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 12px;
line-height: 18px;
}
.chat-approval-resources-text {
margin: 0;
font: inherit;
white-space: pre-wrap;
overflow-wrap: anywhere;
/* The six-visible-line cap (ChatApprovalCard.kt maxLines = 6, Ellipsis): -webkit
-line-clamp counts *rendered* lines, so a long resource that wraps is elided
on the sixth line instead of spilling past it, exactly like the app. */
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 6;
overflow: hidden;
}
.chat-approval-risk {
display: flex;
flex-direction: column;
gap: 4px;
padding: 8px 10px;
border-radius: 8px;
background: color-mix(in srgb, var(--warn) 12%, transparent);
}
.chat-approval-risk-head { display: flex; gap: 4px; align-items: center; }
.chat-approval-risk-shield { flex: 0 0 auto; width: 12px; height: 12px; color: var(--warn); }
.chat-approval-risk-label { color: var(--warn); font-size: 11px; letter-spacing: 0.06em; }
.chat-approval-risk-text { font-size: 12px; }
.chat-approval-controls { display: flex; gap: 10px; }
.chat-approval-control { padding: 6px 12px; }
/* The app renders Allow once as a filled Button and the other two as
TextButtons (ChatApprovalCard.kt:98-100); the browser matches that hierarchy
with the filled accent treatment on the primary control. */
.chat-approval-control.primary {
background: var(--accent);
border-color: var(--accent);
color: var(--bg);
font-weight: 600;
}
.chat-approval-control.primary:hover {
background: color-mix(in srgb, var(--accent) 88%, white);
border-color: color-mix(in srgb, var(--accent) 88%, white);
}
.chat-approval-jump { white-space: nowrap; font-size: 12px; border-color: var(--warn); color: var(--warn); }
.chat-tool-panel {
position: fixed;
z-index: 40;