From 14cfd98a6792554de84ba7ec0954b76931ada9cc Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 25 Jun 2026 17:08:49 +0100 Subject: [PATCH] refac --- cptr/frontend/src/app.html | 2 +- .../src/lib/components/Admin/Models.svelte | 4 +- .../src/lib/components/AuthScreen.svelte | 4 +- .../lib/components/NotificationToast.svelte | 23 +++-- .../src/lib/components/Settings/About.svelte | 5 +- .../src/lib/components/Sidebar.svelte | 2 +- cptr/frontend/src/lib/i18n/locales/de.json | 6 +- cptr/frontend/src/lib/i18n/locales/en.json | 6 +- cptr/frontend/src/lib/i18n/locales/es.json | 6 +- cptr/frontend/src/lib/i18n/locales/fr.json | 6 +- cptr/frontend/src/lib/i18n/locales/ja.json | 6 +- cptr/frontend/src/lib/i18n/locales/ko.json | 6 +- cptr/frontend/src/lib/i18n/locales/pt-BR.json | 6 +- cptr/frontend/src/lib/i18n/locales/ru.json | 6 +- cptr/frontend/src/lib/i18n/locales/zh-CN.json | 6 +- cptr/frontend/src/lib/i18n/locales/zh-TW.json | 6 +- cptr/frontend/src/lib/stores/audio.ts | 4 +- cptr/frontend/src/lib/stores/chat.ts | 2 +- cptr/frontend/src/routes/+layout.svelte | 8 +- cptr/frontend/src/routes/+page.svelte | 86 ++++++++++++++----- .../src/routes/automations/+page.svelte | 2 +- .../src/routes/automations/[id]/+page.svelte | 2 +- 22 files changed, 127 insertions(+), 77 deletions(-) diff --git a/cptr/frontend/src/app.html b/cptr/frontend/src/app.html index ec5e73b..5e17d40 100644 --- a/cptr/frontend/src/app.html +++ b/cptr/frontend/src/app.html @@ -15,7 +15,7 @@ - + %sveltekit.head% diff --git a/cptr/frontend/src/lib/components/Admin/Models.svelte b/cptr/frontend/src/lib/components/Admin/Models.svelte index 0f98ea7..cd580f8 100644 --- a/cptr/frontend/src/lib/components/Admin/Models.svelte +++ b/cptr/frontend/src/lib/components/Admin/Models.svelte @@ -61,12 +61,12 @@ { name: 'ARCH', desc: 'Machine architecture' }, { name: 'SHELL', desc: 'Default shell path' }, { name: 'HOME', desc: 'Home directory' }, - { name: 'CPTR_VERSION', desc: 'cptr version' }, + { name: 'CPTR_VERSION', desc: 'Computer version' }, { name: 'DATE', desc: 'Current date (ISO format)' }, { name: 'MODEL', desc: 'Model ID being used' } ]; - const DEFAULT_PROMPT_PLACEHOLDER = `You are Computer (cptr), a helpful assistant running inside the user's computer interface. You have access to tools to read, search, and modify files in the workspace, run commands, and use configured tools. Use them to help the user directly. Approach hard requests with initiative and persistence: make the best possible attempt, adapt as needed, and keep going unless a real constraint prevents progress. + const DEFAULT_PROMPT_PLACEHOLDER = `You are Computer, a helpful assistant running inside the user's computer interface. You have access to tools to read, search, and modify files in the workspace, run commands, and use configured tools. Use them to help the user directly. Approach hard requests with initiative and persistence: make the best possible attempt, adapt as needed, and keep going unless a real constraint prevents progress. {{CPTR_CONTEXT}} diff --git a/cptr/frontend/src/lib/components/AuthScreen.svelte b/cptr/frontend/src/lib/components/AuthScreen.svelte index 48c305a..33bb71e 100644 --- a/cptr/frontend/src/lib/components/AuthScreen.svelte +++ b/cptr/frontend/src/lib/components/AuthScreen.svelte @@ -72,7 +72,9 @@
-

cptr

+

+ Computer +

{#if isSetup}

diff --git a/cptr/frontend/src/lib/components/NotificationToast.svelte b/cptr/frontend/src/lib/components/NotificationToast.svelte index a423cb8..db9c8ca 100644 --- a/cptr/frontend/src/lib/components/NotificationToast.svelte +++ b/cptr/frontend/src/lib/components/NotificationToast.svelte @@ -47,10 +47,7 @@ function onPointerUp(e: PointerEvent) { (e.currentTarget as HTMLElement).releasePointerCapture?.(e.pointerId); - if ( - closeButtonEl && - (e.target === closeButtonEl || closeButtonEl.contains(e.target as Node)) - ) { + if (closeButtonEl && (e.target === closeButtonEl || closeButtonEl.contains(e.target as Node))) { return; } if (!moved) { @@ -74,22 +71,31 @@ bind:this={closeButtonEl} class="absolute -top-0.5 -left-0.5 p-0.5 rounded-full opacity-0 group-hover:opacity-100 bg-gray-200 dark:bg-[#222] text-gray-500 dark:text-gray-400 hover:bg-gray-300 dark:hover:bg-[#333] hover:text-gray-700 dark:hover:text-gray-300 border-none cursor-pointer transition-opacity duration-150 z-10" aria-label={$t('a11y.dismissNotification')} - onclick={(e) => { e.stopPropagation(); onclose(); }} + onclick={(e) => { + e.stopPropagation(); + onclose(); + }} > - +

- cptr + Computer
{#if title} -
{title}
+
+ {title} +
{/if} {#if content}
{content}
@@ -102,4 +108,3 @@ min-width: var(--width, 300px); } - diff --git a/cptr/frontend/src/lib/components/Settings/About.svelte b/cptr/frontend/src/lib/components/Settings/About.svelte index 0cc19f1..bf79b50 100644 --- a/cptr/frontend/src/lib/components/Settings/About.svelte +++ b/cptr/frontend/src/lib/components/Settings/About.svelte @@ -3,7 +3,7 @@ import { appVersion, showChangelog, updateAvailable, latestVersion } from '$lib/stores'; const REPO_URL = 'https://github.com/open-webui/computer'; - const SHARE_TEXT = 'Check out cptr. Your computer, from anywhere.'; + const SHARE_TEXT = 'Check out Computer. Your computer, from anywhere.'; const shareLinks = [ { @@ -39,7 +39,7 @@ href="https://github.com/open-webui/computer" target="_blank" rel="noopener noreferrer" - class="text-xs font-semibold text-gray-900 dark:text-white hover:underline">cptrComputer {#if $appVersion}
- {#if workspaceItems().length} + {#if continuation}
-

- {welcomeData?.recent?.length ? $t('home.recent') : $t('home.folders')} -

+

Continue

+ +
+ {/if} + + {#if recent.length} +
+

{$t('home.recent')}

- {#each workspaceItems() as item} + {#each recent as item} {@const resume = workspaceResumes.get(item.path)} {@const signals = resumeSignals(resume)} {/each}
- {:else} + {:else if !continuation}

{$t('home.recent')}