From 81b5a6a08b6b2f591096a0f9a7fed04871002a33 Mon Sep 17 00:00:00 2001 From: Filip <34747899+neriousy@users.noreply.github.com> Date: Wed, 11 Feb 2026 17:59:09 +0100 Subject: [PATCH 1/3] fix(app):workspace reset (#13170) Co-authored-by: opencode-agent[bot] --- packages/app/src/context/layout.tsx | 6 ++++-- packages/app/src/context/terminal.tsx | 11 ++++++++--- packages/app/src/pages/layout.tsx | 11 +++++++++++ packages/app/src/utils/persist.ts | 7 +++---- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/packages/app/src/context/layout.tsx b/packages/app/src/context/layout.tsx index 8d9c865f84..4019b2f29d 100644 --- a/packages/app/src/context/layout.tsx +++ b/packages/app/src/context/layout.tsx @@ -4,6 +4,7 @@ import { createSimpleContext } from "@opencode-ai/ui/context" import { useGlobalSync } from "./global-sync" import { useGlobalSDK } from "./global-sdk" import { useServer } from "./server" +import { usePlatform } from "./platform" import { Project } from "@opencode-ai/sdk/v2" import { Persist, persisted, removePersisted } from "@/utils/persist" import { same } from "@/utils/same" @@ -90,6 +91,7 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext( const globalSdk = useGlobalSDK() const globalSync = useGlobalSync() const server = useServer() + const platform = usePlatform() const isRecord = (value: unknown): value is Record => typeof value === "object" && value !== null && !Array.isArray(value) @@ -200,10 +202,10 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext( for (const entry of SESSION_STATE_KEYS) { const target = session ? Persist.session(dir, session, entry.key) : Persist.workspace(dir, entry.key) - void removePersisted(target) + void removePersisted(target, platform) const legacyKey = `${dir}/${entry.legacy}${session ? "/" + session : ""}.${entry.version}` - void removePersisted({ key: legacyKey }) + void removePersisted({ key: legacyKey }, platform) } } } diff --git a/packages/app/src/context/terminal.tsx b/packages/app/src/context/terminal.tsx index d00c792e05..144bef2840 100644 --- a/packages/app/src/context/terminal.tsx +++ b/packages/app/src/context/terminal.tsx @@ -3,6 +3,7 @@ import { createSimpleContext } from "@opencode-ai/ui/context" import { batch, createEffect, createMemo, createRoot, onCleanup } from "solid-js" import { useParams } from "@solidjs/router" import { useSDK } from "./sdk" +import type { Platform } from "./platform" import { Persist, persisted, removePersisted } from "@/utils/persist" export type LocalPTY = { @@ -37,14 +38,18 @@ type TerminalCacheEntry = { const caches = new Set>() -export function clearWorkspaceTerminals(dir: string, sessionIDs?: string[]) { +export function clearWorkspaceTerminals( + dir: string, + sessionIDs?: string[], + platform?: Platform, +) { const key = getWorkspaceTerminalCacheKey(dir) for (const cache of caches) { const entry = cache.get(key) entry?.value.clear() } - removePersisted(Persist.workspace(dir, "terminal")) + removePersisted(Persist.workspace(dir, "terminal"), platform) const legacy = new Set(getLegacyTerminalStorageKeys(dir)) for (const id of sessionIDs ?? []) { @@ -53,7 +58,7 @@ export function clearWorkspaceTerminals(dir: string, sessionIDs?: string[]) { } } for (const key of legacy) { - removePersisted({ key }) + removePersisted({ key }, platform) } } diff --git a/packages/app/src/pages/layout.tsx b/packages/app/src/pages/layout.tsx index 13d15bdce2..1513752f05 100644 --- a/packages/app/src/pages/layout.tsx +++ b/packages/app/src/pages/layout.tsx @@ -1203,6 +1203,16 @@ export default function Layout(props: ParentProps) { if (!result) return + globalSync.set( + "project", + produce((draft) => { + const project = draft.find((item) => item.worktree === root) + if (!project) return + project.sandboxes = (project.sandboxes ?? []).filter((sandbox) => sandbox !== directory) + }), + ) + setStore("workspaceOrder", root, (order) => (order ?? []).filter((workspace) => workspace !== directory)) + layout.projects.close(directory) layout.projects.open(root) @@ -1230,6 +1240,7 @@ export default function Layout(props: ParentProps) { clearWorkspaceTerminals( directory, sessions.map((s) => s.id), + platform, ) await globalSDK.client.instance.dispose({ directory }).catch(() => undefined) diff --git a/packages/app/src/utils/persist.ts b/packages/app/src/utils/persist.ts index 57e01d86a9..91c504742a 100644 --- a/packages/app/src/utils/persist.ts +++ b/packages/app/src/utils/persist.ts @@ -1,4 +1,4 @@ -import { usePlatform } from "@/context/platform" +import { Platform, usePlatform } from "@/context/platform" import { makePersisted, type AsyncStorage, type SyncStorage } from "@solid-primitives/storage" import { checksum } from "@opencode-ai/util/encode" import { createResource, type Accessor } from "solid-js" @@ -318,9 +318,8 @@ export const Persist = { }, } -export function removePersisted(target: { storage?: string; key: string }) { - const platform = usePlatform() - const isDesktop = platform.platform === "desktop" && !!platform.storage +export function removePersisted(target: { storage?: string; key: string }, platform?: Platform) { + const isDesktop = platform?.platform === "desktop" && !!platform.storage if (isDesktop) { return platform.storage?.(target.storage)?.removeItem(target.key) From 8f56ed5b850ce4ad71ced4903a36d822cf91553f Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Wed, 11 Feb 2026 17:00:20 +0000 Subject: [PATCH 2/3] chore: generate --- packages/app/src/context/terminal.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/app/src/context/terminal.tsx b/packages/app/src/context/terminal.tsx index 144bef2840..c7816158cc 100644 --- a/packages/app/src/context/terminal.tsx +++ b/packages/app/src/context/terminal.tsx @@ -38,11 +38,7 @@ type TerminalCacheEntry = { const caches = new Set>() -export function clearWorkspaceTerminals( - dir: string, - sessionIDs?: string[], - platform?: Platform, -) { +export function clearWorkspaceTerminals(dir: string, sessionIDs?: string[], platform?: Platform) { const key = getWorkspaceTerminalCacheKey(dir) for (const cache of caches) { const entry = cache.get(key) From fbabce1125005bc4a658401fbbc1c04e50d2f5bc Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Wed, 11 Feb 2026 11:01:50 -0600 Subject: [PATCH 3/3] fix(app): translations --- packages/ui/src/i18n/ar.ts | 5 +++-- packages/ui/src/i18n/br.ts | 5 +++-- packages/ui/src/i18n/da.ts | 6 +++--- packages/ui/src/i18n/es.ts | 3 ++- packages/ui/src/i18n/fr.ts | 3 ++- packages/ui/src/i18n/ko.ts | 3 ++- packages/ui/src/i18n/no.ts | 3 ++- packages/ui/src/i18n/th.ts | 1 + packages/ui/src/i18n/zh.ts | 5 +++-- packages/ui/src/i18n/zht.ts | 5 +++-- 10 files changed, 24 insertions(+), 15 deletions(-) diff --git a/packages/ui/src/i18n/ar.ts b/packages/ui/src/i18n/ar.ts index f041eb4858..7ee17e2e01 100644 --- a/packages/ui/src/i18n/ar.ts +++ b/packages/ui/src/i18n/ar.ts @@ -1,20 +1,21 @@ export const dict = { "ui.sessionReview.title": "تغييرات الجلسة", "ui.sessionReview.title.lastTurn": "تغييرات آخر دور", - "ui.sessionReview.diffStyle.unified": "موجد", + "ui.sessionReview.diffStyle.unified": "موحد", "ui.sessionReview.diffStyle.split": "منقسم", "ui.sessionReview.expandAll": "توسيع الكل", "ui.sessionReview.collapseAll": "طي الكل", - "ui.sessionReview.change.added": "مضاف", "ui.sessionReview.change.removed": "محذوف", "ui.sessionReview.change.modified": "معدل", + "ui.lineComment.label.prefix": "تعليق على ", "ui.lineComment.label.suffix": "", "ui.lineComment.editorLabel.prefix": "جارٍ التعليق على ", "ui.lineComment.editorLabel.suffix": "", "ui.lineComment.placeholder": "أضف تعليقًا", "ui.lineComment.submit": "تعليق", + "ui.sessionTurn.steps.show": "إظهار الخطوات", "ui.sessionTurn.steps.hide": "إخفاء الخطوات", "ui.sessionTurn.summary.response": "استجابة", diff --git a/packages/ui/src/i18n/br.ts b/packages/ui/src/i18n/br.ts index b8765ff948..6d7449d845 100644 --- a/packages/ui/src/i18n/br.ts +++ b/packages/ui/src/i18n/br.ts @@ -5,16 +5,17 @@ export const dict = { "ui.sessionReview.diffStyle.split": "Dividido", "ui.sessionReview.expandAll": "Expandir tudo", "ui.sessionReview.collapseAll": "Recolher tudo", - "ui.sessionReview.change.added": "Adicionado", "ui.sessionReview.change.removed": "Removido", "ui.sessionReview.change.modified": "Modificado", + "ui.lineComment.label.prefix": "Comentar em ", "ui.lineComment.label.suffix": "", "ui.lineComment.editorLabel.prefix": "Comentando em ", "ui.lineComment.editorLabel.suffix": "", "ui.lineComment.placeholder": "Adicionar comentário", "ui.lineComment.submit": "Comentar", + "ui.sessionTurn.steps.show": "Mostrar passos", "ui.sessionTurn.steps.hide": "Ocultar passos", "ui.sessionTurn.summary.response": "Resposta", @@ -94,7 +95,7 @@ export const dict = { "ui.patch.action.deleted": "Excluído", "ui.patch.action.created": "Criado", "ui.patch.action.moved": "Movido", - "ui.patch.action.patched": "Aplicado patch", + "ui.patch.action.patched": "Patch aplicado", "ui.question.subtitle.answered": "{{count}} respondidas", "ui.question.answer.none": "(sem resposta)", diff --git a/packages/ui/src/i18n/da.ts b/packages/ui/src/i18n/da.ts index a87cf795e1..218f3b26a4 100644 --- a/packages/ui/src/i18n/da.ts +++ b/packages/ui/src/i18n/da.ts @@ -63,8 +63,8 @@ export const dict = { "ui.tool.webfetch": "Webhentning", "ui.tool.shell": "Shell", "ui.tool.patch": "Patch", - "ui.tool.todos": "To-dos", - "ui.tool.todos.read": "Læs to-dos", + "ui.tool.todos": "Opgaver", + "ui.tool.todos.read": "Læs opgaver", "ui.tool.questions": "Spørgsmål", "ui.tool.agent": "{{type}} Agent", @@ -94,7 +94,7 @@ export const dict = { "ui.patch.action.deleted": "Slettet", "ui.patch.action.created": "Oprettet", "ui.patch.action.moved": "Flyttet", - "ui.patch.action.patched": "Patched", + "ui.patch.action.patched": "Patchet", "ui.question.subtitle.answered": "{{count}} besvaret", "ui.question.answer.none": "(intet svar)", diff --git a/packages/ui/src/i18n/es.ts b/packages/ui/src/i18n/es.ts index 7308fccad7..4fd921b606 100644 --- a/packages/ui/src/i18n/es.ts +++ b/packages/ui/src/i18n/es.ts @@ -5,16 +5,17 @@ export const dict = { "ui.sessionReview.diffStyle.split": "Dividido", "ui.sessionReview.expandAll": "Expandir todo", "ui.sessionReview.collapseAll": "Colapsar todo", - "ui.sessionReview.change.added": "Añadido", "ui.sessionReview.change.removed": "Eliminado", "ui.sessionReview.change.modified": "Modificado", + "ui.lineComment.label.prefix": "Comentar en ", "ui.lineComment.label.suffix": "", "ui.lineComment.editorLabel.prefix": "Comentando en ", "ui.lineComment.editorLabel.suffix": "", "ui.lineComment.placeholder": "Añadir comentario", "ui.lineComment.submit": "Comentar", + "ui.sessionTurn.steps.show": "Mostrar pasos", "ui.sessionTurn.steps.hide": "Ocultar pasos", "ui.sessionTurn.summary.response": "Respuesta", diff --git a/packages/ui/src/i18n/fr.ts b/packages/ui/src/i18n/fr.ts index 4b6f28f0d8..537d01bba9 100644 --- a/packages/ui/src/i18n/fr.ts +++ b/packages/ui/src/i18n/fr.ts @@ -5,16 +5,17 @@ export const dict = { "ui.sessionReview.diffStyle.split": "Divisé", "ui.sessionReview.expandAll": "Tout développer", "ui.sessionReview.collapseAll": "Tout réduire", - "ui.sessionReview.change.added": "Ajouté", "ui.sessionReview.change.removed": "Supprimé", "ui.sessionReview.change.modified": "Modifié", + "ui.lineComment.label.prefix": "Commenter sur ", "ui.lineComment.label.suffix": "", "ui.lineComment.editorLabel.prefix": "Commentaire sur ", "ui.lineComment.editorLabel.suffix": "", "ui.lineComment.placeholder": "Ajouter un commentaire", "ui.lineComment.submit": "Commenter", + "ui.sessionTurn.steps.show": "Afficher les étapes", "ui.sessionTurn.steps.hide": "Masquer les étapes", "ui.sessionTurn.summary.response": "Réponse", diff --git a/packages/ui/src/i18n/ko.ts b/packages/ui/src/i18n/ko.ts index d2203aad18..fd394dbb7b 100644 --- a/packages/ui/src/i18n/ko.ts +++ b/packages/ui/src/i18n/ko.ts @@ -5,16 +5,17 @@ export const dict = { "ui.sessionReview.diffStyle.split": "분할 보기", "ui.sessionReview.expandAll": "모두 펼치기", "ui.sessionReview.collapseAll": "모두 접기", - "ui.sessionReview.change.added": "추가됨", "ui.sessionReview.change.removed": "삭제됨", "ui.sessionReview.change.modified": "수정됨", + "ui.lineComment.label.prefix": "", "ui.lineComment.label.suffix": "에 댓글 달기", "ui.lineComment.editorLabel.prefix": "", "ui.lineComment.editorLabel.suffix": "에 댓글 작성 중", "ui.lineComment.placeholder": "댓글 추가", "ui.lineComment.submit": "댓글", + "ui.sessionTurn.steps.show": "단계 표시", "ui.sessionTurn.steps.hide": "단계 숨기기", "ui.sessionTurn.summary.response": "응답", diff --git a/packages/ui/src/i18n/no.ts b/packages/ui/src/i18n/no.ts index ca1504da2e..dcb353614d 100644 --- a/packages/ui/src/i18n/no.ts +++ b/packages/ui/src/i18n/no.ts @@ -8,16 +8,17 @@ export const dict: Record = { "ui.sessionReview.diffStyle.split": "Delt", "ui.sessionReview.expandAll": "Utvid alle", "ui.sessionReview.collapseAll": "Fold sammen alle", - "ui.sessionReview.change.added": "Lagt til", "ui.sessionReview.change.removed": "Fjernet", "ui.sessionReview.change.modified": "Endret", + "ui.lineComment.label.prefix": "Kommenter på ", "ui.lineComment.label.suffix": "", "ui.lineComment.editorLabel.prefix": "Kommenterer på ", "ui.lineComment.editorLabel.suffix": "", "ui.lineComment.placeholder": "Legg til kommentar", "ui.lineComment.submit": "Kommenter", + "ui.sessionTurn.steps.show": "Vis trinn", "ui.sessionTurn.steps.hide": "Skjul trinn", "ui.sessionTurn.summary.response": "Svar", diff --git a/packages/ui/src/i18n/th.ts b/packages/ui/src/i18n/th.ts index 4a1fbb0a4a..68bb0d733d 100644 --- a/packages/ui/src/i18n/th.ts +++ b/packages/ui/src/i18n/th.ts @@ -57,6 +57,7 @@ export const dict = { "ui.imagePreview.alt": "ตัวอย่างรูปภาพ", "ui.tool.read": "อ่าน", + "ui.tool.loaded": "โหลดแล้ว", "ui.tool.list": "รายการ", "ui.tool.glob": "Glob", "ui.tool.grep": "Grep", diff --git a/packages/ui/src/i18n/zh.ts b/packages/ui/src/i18n/zh.ts index aead06a03d..53beeb1e4f 100644 --- a/packages/ui/src/i18n/zh.ts +++ b/packages/ui/src/i18n/zh.ts @@ -9,16 +9,17 @@ export const dict = { "ui.sessionReview.diffStyle.split": "拆分", "ui.sessionReview.expandAll": "全部展开", "ui.sessionReview.collapseAll": "全部收起", - "ui.sessionReview.change.added": "已添加", "ui.sessionReview.change.removed": "已移除", "ui.sessionReview.change.modified": "已修改", + "ui.lineComment.label.prefix": "评论 ", "ui.lineComment.label.suffix": "", "ui.lineComment.editorLabel.prefix": "正在评论 ", "ui.lineComment.editorLabel.suffix": "", "ui.lineComment.placeholder": "添加评论", "ui.lineComment.submit": "评论", + "ui.sessionTurn.steps.show": "显示步骤", "ui.sessionTurn.steps.hide": "隐藏步骤", "ui.sessionTurn.summary.response": "回复", @@ -92,7 +93,7 @@ export const dict = { "ui.message.expand": "展开消息", "ui.message.collapse": "收起消息", "ui.message.copy": "复制", - "ui.message.copied": "已复制", + "ui.message.copied": "已复制!", "ui.message.attachment.alt": "附件", "ui.patch.action.deleted": "已删除", diff --git a/packages/ui/src/i18n/zht.ts b/packages/ui/src/i18n/zht.ts index 0b9fb6eacd..1449b0530a 100644 --- a/packages/ui/src/i18n/zht.ts +++ b/packages/ui/src/i18n/zht.ts @@ -9,16 +9,17 @@ export const dict = { "ui.sessionReview.diffStyle.split": "拆分", "ui.sessionReview.expandAll": "全部展開", "ui.sessionReview.collapseAll": "全部收合", - "ui.sessionReview.change.added": "已新增", "ui.sessionReview.change.removed": "已移除", "ui.sessionReview.change.modified": "已修改", + "ui.lineComment.label.prefix": "評論 ", "ui.lineComment.label.suffix": "", "ui.lineComment.editorLabel.prefix": "正在評論 ", "ui.lineComment.editorLabel.suffix": "", "ui.lineComment.placeholder": "新增評論", "ui.lineComment.submit": "評論", + "ui.sessionTurn.steps.show": "顯示步驟", "ui.sessionTurn.steps.hide": "隱藏步驟", "ui.sessionTurn.summary.response": "回覆", @@ -92,7 +93,7 @@ export const dict = { "ui.message.expand": "展開訊息", "ui.message.collapse": "收合訊息", "ui.message.copy": "複製", - "ui.message.copied": "已複製", + "ui.message.copied": "已複製!", "ui.message.attachment.alt": "附件", "ui.patch.action.deleted": "已刪除",