Inline permission approvals in tool calls

This commit is contained in:
Shantur Rathore
2025-11-16 02:30:12 +00:00
parent 2b6597ad00
commit c4e76aaac4
16 changed files with 572 additions and 106 deletions

View File

@@ -237,16 +237,128 @@
line-height: var(--line-height-tight);
}
.tool-call-awaiting-permission {
border-left-color: var(--status-warning);
}
.tool-call-permission {
@apply flex flex-col gap-3;
border: 2px solid var(--status-warning);
border-radius: 0;
margin: 0;
padding: 1rem 1.25rem;
background-color: var(--message-tool-bg);
}
.tool-call-permission-header {
@apply flex items-center justify-between gap-3;
}
.tool-call-permission-label {
@apply font-semibold text-sm;
color: var(--text-primary);
}
.tool-call-permission-type {
font-family: var(--font-family-mono);
font-size: 12px;
padding: 2px 6px;
border-radius: 0.375rem;
border: 1px solid var(--border-base);
background-color: var(--surface-code);
}
.tool-call-permission-title code {
display: block;
font-size: 13px;
color: var(--text-primary);
background-color: var(--surface-code);
border: 1px solid var(--border-base);
border-radius: 0.5rem;
padding: 0.5rem 0.75rem;
word-break: break-word;
}
.tool-call-permission-actions {
@apply flex items-center justify-between gap-3 flex-wrap;
margin-top: 0.75rem;
}
.tool-call-permission-buttons {
@apply flex flex-wrap gap-2;
}
.tool-call-permission-button {
background-color: var(--surface-base);
border: 1px solid var(--status-warning);
color: var(--text-secondary);
padding: 0.4rem 1.05rem;
border-radius: 0.5rem;
font-size: 0.8rem;
font-weight: var(--font-weight-medium);
line-height: 1.15;
transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 1.75rem;
}
.tool-call-permission-button:hover:not(:disabled) {
background-color: var(--surface-hover);
border-color: var(--status-warning);
color: var(--status-warning);
}
.tool-call-permission-button:active:not(:disabled) {
transform: scale(0.97);
}
.tool-call-permission-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.tool-call-permission-shortcuts {
@apply flex items-center gap-2 text-xs text-muted;
}
.tool-call-permission-shortcuts .kbd {
margin-right: 0.25rem;
}
.tool-call-permission-queued-text {
@apply text-sm text-muted;
}
.tool-call-permission-error {
@apply text-sm;
color: var(--status-error);
margin-top: 0.5rem;
}
.tool-call-permission-diff {
margin-top: 1rem;
margin-bottom: 0.5rem;
}
.tool-call-permission-diff .tool-call-diff-shell {
margin: 0;
}
.tool-call-diff-viewer .diff-line-old-num,
.tool-call-diff-viewer .diff-line-new-num,
.tool-call-diff-viewer .diff-line-num {
width: auto !important;
min-width: 4ch;
padding-left: 0.5rem;
padding-right: 0.5rem;
white-space: nowrap;
color: var(--text-muted);
font-size: var(--font-size-xs);
}
.tool-call-markdown .markdown-code-block {
margin: 0;
border-radius: 0;
}
.tool-call-markdown .markdown-code-block {
margin: 0;
border: none;