From 977bdb4e4e00e0e5ff608162f9bcd542d866bc3c Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 23 Jul 2026 17:44:16 -0400 Subject: [PATCH 1/2] refac --- .../lib/components/SidebarWorkspaceList.svelte | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/cptr/frontend/src/lib/components/SidebarWorkspaceList.svelte b/cptr/frontend/src/lib/components/SidebarWorkspaceList.svelte index 2908143b..f792910f 100644 --- a/cptr/frontend/src/lib/components/SidebarWorkspaceList.svelte +++ b/cptr/frontend/src/lib/components/SidebarWorkspaceList.svelte @@ -43,6 +43,7 @@ let wsChatsLoading = $state>(new Set()); let currentPath = $derived($currentWorkspace?.path ?? null); let currentChatId = $derived($activeTab?.type === 'chat' ? $activeTab.path : null); + const WS_CHATS_PAGE_SIZE = 5; function toggleWorkspaceExpand(path: string) { const next = new Set(expandedWorkspaces); @@ -55,12 +56,18 @@ expandedWorkspaces = next; } - async function fetchWorkspaceChats(path: string, append = false) { + async function fetchWorkspaceChats(path: string, append = false, limit = WS_CHATS_PAGE_SIZE) { if (wsChatsLoading.has(path)) return; wsChatsLoading = new Set([...wsChatsLoading, path]); try { const existing = wsChatsCache.get(path) ?? []; - const data = await getChats(path, 5, append ? existing.length : 0, 'updated_at', 'desc'); + const data = await getChats( + path, + append ? WS_CHATS_PAGE_SIZE : limit, + append ? existing.length : 0, + 'updated_at', + 'desc' + ); wsChatsCache = new Map([ ...wsChatsCache, [ @@ -90,6 +97,11 @@ } } + function reloadWorkspaceChats(path: string) { + const loadedCount = wsChatsCache.get(path)?.length ?? WS_CHATS_PAGE_SIZE; + void fetchWorkspaceChats(path, false, Math.max(loadedCount, WS_CHATS_PAGE_SIZE)); + } + function closeMobileSidebar() { if (typeof window !== 'undefined' && window.innerWidth < 768) sidebarOpen.set(false); } @@ -254,7 +266,7 @@ data.workspace && expandedWorkspaces.has(data.workspace) ) { - void fetchWorkspaceChats(data.workspace); + reloadWorkspaceChats(data.workspace); } } From cac58114020f0326c8501701cc4e2e0677af9519 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 23 Jul 2026 17:45:19 -0400 Subject: [PATCH 2/2] refac --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- uv.lock | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b8ba394..4e8fcf70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.9.15] - 2026-07-23 + +### Fixed + +- 🗂️ **Expanded workspace chat lists keep their place.** When a chat updates, Computer now refreshes the expanded workspace list without shrinking it back to only the newest few chats. + ## [0.9.14] - 2026-07-23 ### Changed diff --git a/pyproject.toml b/pyproject.toml index 8e70247c..73b1fe24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cptr" -version = "0.9.14" +version = "0.9.15" description = "Your computer, from anywhere. Code, manage, and control your machine from the web." license = {file = "LICENSE"} readme = "README.md" diff --git a/uv.lock b/uv.lock index 103af922..20634b5a 100644 --- a/uv.lock +++ b/uv.lock @@ -284,7 +284,7 @@ wheels = [ [[package]] name = "cptr" -version = "0.9.14" +version = "0.9.15" source = { editable = "." } dependencies = [ { name = "aiosqlite" },