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
34 changes: 17 additions & 17 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/app",
"version": "1.15.2",
"version": "1.15.3",
"description": "",
"type": "module",
"exports": {
Expand Down
6 changes: 6 additions & 0 deletions packages/app/src/context/language.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type Locale =
| "th"
| "bs"
| "tr"
| "it"

type RawDictionary = typeof en & typeof uiEn
type Dictionary = i18n.Flatten<RawDictionary>
Expand Down Expand Up @@ -51,6 +52,7 @@ const LOCALES: readonly Locale[] = [
"br",
"th",
"tr",
"it",
]

const INTL: Record<Locale, string> = {
Expand All @@ -71,6 +73,7 @@ const INTL: Record<Locale, string> = {
th: "th",
bs: "bs",
tr: "tr",
it: "it",
}

const LABEL_KEY: Record<Locale, keyof Dictionary> = {
Expand All @@ -91,6 +94,7 @@ const LABEL_KEY: Record<Locale, keyof Dictionary> = {
th: "language.th",
bs: "language.bs",
tr: "language.tr",
it: "language.it",
}

const base = i18n.flatten({ ...en, ...uiEn })
Expand All @@ -116,6 +120,7 @@ const loaders: Record<Exclude<Locale, "en">, () => Promise<Dictionary>> = {
th: () => merge(import("@/i18n/th"), import("@opencode-ai/ui/i18n/th")),
bs: () => merge(import("@/i18n/bs"), import("@opencode-ai/ui/i18n/bs")),
tr: () => merge(import("@/i18n/tr"), import("@opencode-ai/ui/i18n/tr")),
it: () => merge(import("@/i18n/it"), import("@opencode-ai/ui/i18n/it")),
}

function loadDict(locale: Locale) {
Expand Down Expand Up @@ -154,6 +159,7 @@ const localeMatchers: Array<{ locale: Locale; match: (language: string) => boole
{ locale: "th", match: (language) => language.startsWith("th") },
{ locale: "bs", match: (language) => language.startsWith("bs") },
{ locale: "tr", match: (language) => language.startsWith("tr") },
{ locale: "it", match: (language) => language.startsWith("it") },
]

function detectLocale(): Locale {
Expand Down
46 changes: 46 additions & 0 deletions packages/app/src/context/pin-store.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { createSignal } from "solid-js"

const PIN_STORAGE_KEY = "opencode_pinned_sessions"

function loadPinned(): string[] {
try {
return JSON.parse(localStorage.getItem(PIN_STORAGE_KEY) ?? "[]")
} catch {
return []
}
}

function savePinned(pinned: string[]) {
localStorage.setItem(PIN_STORAGE_KEY, JSON.stringify(pinned))
}

const [pinnedIds, setPinnedIds] = createSignal<string[]>(loadPinned())

export function usePinned() {
return { pinnedIds }
}

export function isPinned(sessionId: string): boolean {
return pinnedIds().includes(sessionId)
}

export function togglePin(sessionId: string) {
setPinnedIds((prev) => {
const next = prev.includes(sessionId)
? prev.filter((id) => id !== sessionId)
: [...prev, sessionId]
savePinned(next)
return [...next]
})
}

export function sortByPinned<T extends { id: string }>(items: T[]): T[] {
const pinned = pinnedIds()
return [...items].sort((a, b) => {
const aPinned = pinned.includes(a.id)
const bPinned = pinned.includes(b.id)
if (aPinned && !bPinned) return -1
if (!aPinned && bPinned) return 1
return 0
})
}
3 changes: 3 additions & 0 deletions packages/app/src/i18n/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ export const dict = {
"language.bs": "Bosanski",
"language.th": "ไทย",
"language.tr": "Türkçe",
"language.it": "Italian",
"toast.language.title": "لغة",
"toast.language.description": "تم التبديل إلى {{language}}",
"toast.theme.title": "تم تبديل السمة",
Expand Down Expand Up @@ -527,6 +528,8 @@ export const dict = {
"common.learnMore": "اعرف المزيد",
"common.rename": "إعادة تسمية",
"common.reset": "إعادة تعيين",
"common.pin": "Pin",
"common.unpin": "Unpin",
"common.archive": "أرشفة",
"common.delete": "حذف",
"common.close": "إغلاق",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ export const dict = {
"language.bs": "Bosanski",
"language.th": "ไทย",
"language.tr": "Türkçe",
"language.it": "Italian",
"toast.language.title": "Idioma",
"toast.language.description": "Alterado para {{language}}",
"toast.theme.title": "Tema alterado",
Expand Down Expand Up @@ -534,6 +535,8 @@ export const dict = {
"common.learnMore": "Saiba mais",
"common.rename": "Renomear",
"common.reset": "Redefinir",
"common.pin": "Pin",
"common.unpin": "Unpin",
"common.archive": "Arquivar",
"common.delete": "Excluir",
"common.close": "Fechar",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/bs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ export const dict = {
"language.bs": "Bosanski",
"language.th": "ไทย",
"language.tr": "Türkçe",
"language.it": "Italian",

"toast.language.title": "Jezik",
"toast.language.description": "Prebačeno na {{language}}",
Expand Down Expand Up @@ -594,6 +595,8 @@ export const dict = {
"common.learnMore": "Saznaj više",
"common.rename": "Preimenuj",
"common.reset": "Resetuj",
"common.pin": "Pin",
"common.unpin": "Unpin",
"common.archive": "Arhiviraj",
"common.delete": "Izbriši",
"common.close": "Zatvori",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/da.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ export const dict = {
"language.bs": "Bosanski",
"language.th": "ไทย",
"language.tr": "Türkçe",
"language.it": "Italian",

"toast.language.title": "Sprog",
"toast.language.description": "Skiftede til {{language}}",
Expand Down Expand Up @@ -590,6 +591,8 @@ export const dict = {
"common.learnMore": "Lær mere",
"common.rename": "Omdøb",
"common.reset": "Nulstil",
"common.pin": "Pin",
"common.unpin": "Unpin",
"common.archive": "Arkivér",
"common.delete": "Slet",
"common.close": "Luk",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ export const dict = {
"language.bs": "Bosanski",
"language.th": "ไทย",
"language.tr": "Türkçe",
"language.it": "Italian",
"toast.language.title": "Sprache",
"toast.language.description": "Zu {{language}} gewechselt",
"toast.theme.title": "Thema gewechselt",
Expand Down Expand Up @@ -542,6 +543,8 @@ export const dict = {
"common.learnMore": "Mehr erfahren",
"common.rename": "Umbenennen",
"common.reset": "Zurücksetzen",
"common.pin": "Pin",
"common.unpin": "Unpin",
"common.archive": "Archivieren",
"common.delete": "Löschen",
"common.close": "Schließen",
Expand Down
6 changes: 6 additions & 0 deletions packages/app/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ export const dict = {
"language.bs": "Bosanski",
"language.th": "ไทย",
"language.tr": "Türkçe",
"language.it": "Italian",

"toast.language.title": "Language",
"toast.language.description": "Switched to {{language}}",
Expand Down Expand Up @@ -646,6 +647,11 @@ export const dict = {
"common.learnMore": "Learn more",
"common.rename": "Rename",
"common.reset": "Reset",
"common.pin": "Pin",
"common.unpin": "Unpin",
"common.selectAll": "Select All",
"common.copy": "Copy",
"common.copyUrl": "Copy URL",
"common.archive": "Archive",
"common.delete": "Delete",
"common.close": "Close",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ export const dict = {
"language.bs": "Bosanski",
"language.th": "ไทย",
"language.tr": "Türkçe",
"language.it": "Italian",

"toast.language.title": "Idioma",
"toast.language.description": "Cambiado a {{language}}",
Expand Down Expand Up @@ -597,6 +598,8 @@ export const dict = {
"common.learnMore": "Saber más",
"common.rename": "Renombrar",
"common.reset": "Restablecer",
"common.pin": "Pin",
"common.unpin": "Unpin",
"common.archive": "Archivar",
"common.delete": "Eliminar",
"common.close": "Cerrar",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ export const dict = {
"language.bs": "Bosanski",
"language.th": "ไทย",
"language.tr": "Türkçe",
"language.it": "Italian",
"toast.language.title": "Langue",
"toast.language.description": "Passé à {{language}}",
"toast.theme.title": "Thème changé",
Expand Down Expand Up @@ -539,6 +540,8 @@ export const dict = {
"common.learnMore": "En savoir plus",
"common.rename": "Renommer",
"common.reset": "Réinitialiser",
"common.pin": "Pin",
"common.unpin": "Unpin",
"common.archive": "Archiver",
"common.delete": "Supprimer",
"common.close": "Fermer",
Expand Down
Loading
Loading