Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions apps/web/src/components/chat/ChildThreadApprovals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import {
isAtomCommandInterrupted,
squashAtomCommandFailure,
} from "@t3tools/client-runtime/state/runtime";
import { T, useGT, useMessages, Var } from "gt-react";
import { T, useGT, useMessages } from "gt-react";
import { useState } from "react";
import { ShieldQuestionIcon } from "lucide-react";
import { useEnvironmentScope } from "../../state/session";
import { childThreadApprovalsAtom, threadEnvironment } from "../../state/threads";
import { useAtomCommand } from "../../state/use-atom-command";
Expand All @@ -26,11 +27,15 @@ function ChildApproval({ entry }: { entry: ChildThreadApproval }) {
aria-label={gt("Approval from {title}", { title: entry.title })}
className="rounded-lg border border-border bg-background p-3 text-xs"
>
<p className="mb-2 font-medium">
<T>
Approval needed from <Var>{entry.title}</Var>
</T>
</p>
<div className="mb-2 flex items-start gap-2">
<ShieldQuestionIcon aria-hidden className="mt-0.5 size-4 shrink-0 text-warning" />
<div className="min-w-0">
<p className="font-medium">
<T>Your approval is needed</T>
</p>
<p className="text-muted-foreground wrap-anywhere">{entry.title}</p>
</div>
</div>
<pre className="max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono">
{approval.detail || approval.requestKind}
</pre>
Expand All @@ -46,9 +51,9 @@ function ChildApproval({ entry }: { entry: ChildThreadApproval }) {
{fullAccessOverrideExplanation(approval.fullAccessOverride, messages)}
</p>
) : null}
<div className="mt-2 flex flex-wrap gap-2">
<div className="mt-3 flex flex-wrap items-center gap-2">
<ComposerPendingApprovalActions
presentation="inline"
presentation="card"
requestId={approval.requestId}
isResponding={responding}
canRespond={approval.responseCapability === "live"}
Expand Down
20 changes: 16 additions & 4 deletions apps/web/src/components/chat/ComposerPendingApprovalActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
import { composerFloatingLayerProps } from "./composerEventScope";

interface ComposerPendingApprovalActionsProps {
presentation?: "composer" | "inline";
presentation?: "composer" | "inline" | "card";
requestId: RuntimeRequestId;
isResponding: boolean;
canRespond: boolean;
Expand Down Expand Up @@ -75,7 +75,15 @@ export const ComposerPendingApprovalActions = memo(function ComposerPendingAppro
const content = (
<>
{option.warning ? <TriangleAlertIcon className="size-3 shrink-0" /> : null}
<span className={presentation === "inline" ? "whitespace-normal" : "max-w-40 truncate"}>
<span
className={
presentation === "inline"
? "whitespace-normal"
: presentation === "card"
? "max-w-40 whitespace-normal wrap-anywhere"
: "max-w-40 truncate"
}
>
{optionLabel(option.label)}
</span>
</>
Expand All @@ -93,7 +101,7 @@ export const ComposerPendingApprovalActions = memo(function ComposerPendingAppro
<Button
key={option.decision}
{...buttonProps}
size="xs"
size={presentation === "card" ? "sm-multiline" : "xs"}
variant={option.decision === "accept" ? "default" : "outline"}
>
{content}
Expand All @@ -116,7 +124,11 @@ export const ComposerPendingApprovalActions = memo(function ComposerPendingAppro
presentation === "inline" ? (
<InlineButton tone="muted" aria-label={gt("More approval options")} />
) : (
<Button size="icon-xs" variant="outline" aria-label={gt("More approval options")} />
<Button
size={presentation === "card" ? "icon-sm" : "icon-xs"}
variant="outline"
aria-label={gt("More approval options")}
/>
)
}
>
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3250,14 +3250,7 @@
"c1c9ebabaa960f8c": "Zurücksetzen und Änderungen behalten",
"359e36da660f2c59": "Genehmigung von {title}",
"8d9617edf6eee5b9": "Die Genehmigungsentscheidung konnte nicht übermittelt werden.",
"160ead9e70889628": [
"Genehmigung nötig für ",
{
"i": 1,
"k": "_gt_value_1",
"v": "v"
}
],
"ec9420ed25e7ec28": "Deine Zustimmung ist erforderlich",
"1b1131295f62c44c": "Der Anbieterprozess ist beendet. Unterbrich den untergeordneten Thread oder starte ihn neu, um zu antworten.",
"da66023072c473d1": [
"Ausgabe konnte nicht geladen werden: ",
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3249,14 +3249,7 @@
"c1c9ebabaa960f8c": "Revert and keep changes",
"359e36da660f2c59": "Approval from {title}",
"8d9617edf6eee5b9": "Failed to submit approval decision.",
"160ead9e70889628": [
"Approval needed from ",
{
"i": 1,
"k": "_gt_value_1",
"v": "v"
}
],
"ec9420ed25e7ec28": "Your approval is needed",
"1b1131295f62c44c": "Provider process is gone. Interrupt or restart the child thread to respond.",
"da66023072c473d1": [
"Couldn't load output: ",
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -3249,14 +3249,7 @@
"c1c9ebabaa960f8c": "Revertir y conservar los cambios",
"359e36da660f2c59": "Aprobación de {title}",
"8d9617edf6eee5b9": "No se pudo enviar la decisión de aprobación.",
"160ead9e70889628": [
"Se necesita la aprobación de ",
{
"i": 1,
"k": "_gt_value_1",
"v": "v"
}
],
"ec9420ed25e7ec28": "Se necesita tu aprobación",
"1b1131295f62c44c": "El proceso del proveedor ya no existe. Interrumpe o reinicia el hilo secundario para responder.",
"da66023072c473d1": [
"No se pudo cargar la salida: ",
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3249,14 +3249,7 @@
"c1c9ebabaa960f8c": "Revenir en arrière en gardant les modifications",
"359e36da660f2c59": "Approbation de {title}",
"8d9617edf6eee5b9": "Échec de l’envoi de la décision d’approbation.",
"160ead9e70889628": [
"Approbation requise par ",
{
"i": 1,
"k": "_gt_value_1",
"v": "v"
}
],
"ec9420ed25e7ec28": "Votre approbation est nécessaire",
"1b1131295f62c44c": "Le processus du fournisseur n’existe plus. Interrompez ou redémarrez le fil enfant pour répondre.",
"da66023072c473d1": [
"Impossible de charger la sortie : ",
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -3245,14 +3245,7 @@
"c1c9ebabaa960f8c": "巻き戻して変更を保持",
"359e36da660f2c59": "{title} からの承認",
"8d9617edf6eee5b9": "承認の判断を送信できませんでした。",
"160ead9e70889628": [
{
"i": 1,
"k": "_gt_value_1",
"v": "v"
},
" からの承認が必要です"
],
"ec9420ed25e7ec28": "承認が必要です",
"1b1131295f62c44c": "プロバイダーのプロセスが終了しています。応答するには子スレッドを中断または再起動してください。",
"da66023072c473d1": [
"出力を読み込めませんでした: ",
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -3245,14 +3245,7 @@
"c1c9ebabaa960f8c": "되돌리고 변경 사항 유지",
"359e36da660f2c59": "{title}의 승인 요청",
"8d9617edf6eee5b9": "승인 결정을 제출하지 못했습니다.",
"160ead9e70889628": [
{
"i": 1,
"k": "_gt_value_1",
"v": "v"
},
"에서 승인이 필요합니다"
],
"ec9420ed25e7ec28": "승인이 필요합니다",
"1b1131295f62c44c": "제공자 프로세스가 종료되었습니다. 응답하려면 하위 스레드를 중단하거나 다시 시작하세요.",
"da66023072c473d1": [
"출력을 불러올 수 없습니다: ",
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3249,14 +3249,7 @@
"c1c9ebabaa960f8c": "Reverter e manter as alterações",
"359e36da660f2c59": "Aprovação de {title}",
"8d9617edf6eee5b9": "Falha ao enviar a decisão de aprovação.",
"160ead9e70889628": [
"Aprovação necessária de ",
{
"i": 1,
"k": "_gt_value_1",
"v": "v"
}
],
"ec9420ed25e7ec28": "Sua aprovação é necessária",
"1b1131295f62c44c": "O processo do provedor não existe mais. Interrompa ou reinicie a thread filha para responder.",
"da66023072c473d1": [
"Não foi possível carregar a saída: ",
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/i18n/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -3249,14 +3249,7 @@
"c1c9ebabaa960f8c": "Откатить и сохранить изменения",
"359e36da660f2c59": "Подтверждение от {title}",
"8d9617edf6eee5b9": "Не удалось отправить решение по подтверждению.",
"160ead9e70889628": [
"Нужно подтверждение от ",
{
"i": 1,
"k": "_gt_value_1",
"v": "v"
}
],
"ec9420ed25e7ec28": "Требуется ваше одобрение",
"1b1131295f62c44c": "Процесс провайдера завершился. Прервите или перезапустите дочерний тред, чтобы ответить.",
"da66023072c473d1": [
"Не удалось загрузить вывод: ",
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/i18n/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -3249,14 +3249,7 @@
"c1c9ebabaa960f8c": "Återställ och behåll ändringar",
"359e36da660f2c59": "Godkännande från {title}",
"8d9617edf6eee5b9": "Det gick inte att skicka godkännandebeslutet.",
"160ead9e70889628": [
"Godkännande behövs från ",
{
"i": 1,
"k": "_gt_value_1",
"v": "v"
}
],
"ec9420ed25e7ec28": "Ditt godkännande behövs",
"1b1131295f62c44c": "Leverantörsprocessen finns inte längre. Avbryt eller starta om undertråden för att svara.",
"da66023072c473d1": [
"Kunde inte läsa in utdata: ",
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/i18n/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -3254,14 +3254,7 @@
"c1c9ebabaa960f8c": "回退并保留改动",
"359e36da660f2c59": "来自 {title} 的审批",
"8d9617edf6eee5b9": "无法提交审批决定。",
"160ead9e70889628": [
{
"i": 1,
"k": "_gt_value_1",
"v": "v"
},
" 需要批准"
],
"ec9420ed25e7ec28": "需要你的批准",
"1b1131295f62c44c": "提供方进程已退出。请中断或重启子会话后再回应。",
"da66023072c473d1": [
"无法加载输出:",
Expand Down
Loading