diff options
| author | Adam <[email protected]> | 2026-03-26 14:34:01 -0500 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-03-26 14:34:01 -0500 |
| commit | 311ba4179a3c112a7e0cbbeae152a971284a3632 (patch) | |
| tree | b226c8c0e9f1108a477fb1e6af2e4a25059f6de8 /packages/ui | |
| parent | ad3b35067298a0803eef0c306510d37670ec8b18 (diff) | |
| download | opencode-311ba4179a3c112a7e0cbbeae152a971284a3632.tar.gz opencode-311ba4179a3c112a7e0cbbeae152a971284a3632.zip | |
fix(app): remove fork session button
Diffstat (limited to 'packages/ui')
| -rw-r--r-- | packages/ui/src/components/message-part.tsx | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsx index 3b4ed9e54..a15e2e0c1 100644 --- a/packages/ui/src/components/message-part.tsx +++ b/packages/ui/src/components/message-part.tsx @@ -884,7 +884,7 @@ export function UserMessageDisplay(props: { message: UserMessage; parts: PartTyp const i18n = useI18n() const [state, setState] = createStore({ copied: false, - busy: undefined as "fork" | "revert" | undefined, + busy: false, }) const copied = () => state.copied const busy = () => state.busy @@ -938,10 +938,10 @@ export function UserMessageDisplay(props: { message: UserMessage; parts: PartTyp setTimeout(() => setState("copied", false), 2000) } - const run = (kind: "fork" | "revert") => { - const act = kind === "fork" ? props.actions?.fork : props.actions?.revert + const revert = () => { + const act = props.actions?.revert if (!act || busy()) return - setState("busy", kind) + setState("busy", true) void Promise.resolve() .then(() => act({ @@ -949,9 +949,7 @@ export function UserMessageDisplay(props: { message: UserMessage; parts: PartTyp messageID: props.message.id, }), ) - .finally(() => { - if (busy() === kind) setState("busy", undefined) - }) + .finally(() => setState("busy", false)) } return ( @@ -1017,22 +1015,6 @@ export function UserMessageDisplay(props: { message: UserMessage; parts: PartTyp </Show> </span> </Show> - <Show when={props.actions?.fork}> - <Tooltip value={i18n.t("ui.message.forkMessage")} placement="top" gutter={4}> - <IconButton - icon="fork" - size="normal" - variant="ghost" - disabled={!!busy()} - onMouseDown={(e) => e.preventDefault()} - onClick={(event) => { - event.stopPropagation() - run("fork") - }} - aria-label={i18n.t("ui.message.forkMessage")} - /> - </Tooltip> - </Show> <Show when={props.actions?.revert}> <Tooltip value={i18n.t("ui.message.revertMessage")} placement="top" gutter={4}> <IconButton @@ -1043,7 +1025,7 @@ export function UserMessageDisplay(props: { message: UserMessage; parts: PartTyp onMouseDown={(e) => e.preventDefault()} onClick={(event) => { event.stopPropagation() - run("revert") + revert() }} aria-label={i18n.t("ui.message.revertMessage")} /> |
