Skip to content
Merged
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 15 additions & 3 deletions cptr/frontend/src/lib/components/SidebarWorkspaceList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
let wsChatsLoading = $state<Set<string>>(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);
Expand All @@ -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,
[
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -254,7 +266,7 @@
data.workspace &&
expandedWorkspaces.has(data.workspace)
) {
void fetchWorkspaceChats(data.workspace);
reloadWorkspaceChats(data.workspace);
}
}

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

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

Loading