diff --git a/CHANGELOG.md b/CHANGELOG.md index f96db97..8607129 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ 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.8.8] - 2026-07-09 + +### Added + +- ✨ **More flexible layouts.** Split any view again and again, resize each section, and drag tabs exactly where you want them. +- 🤖 **Commit-writing help.** Get a suggested commit title and description from your staged work. +- 📁 **Create folders as you browse.** Make a new folder without leaving the workspace picker. +- 💬 **An easy way to share feedback.** Send feature ideas from the sidebar. + +### Fixed + +- 👀 **Updates stay dismissed.** Closing the update notes no longer brings them back after a quick refresh. + ## [0.8.7] - 2026-07-09 ### Fixed diff --git a/cptr/frontend/src/lib/apis/git.ts b/cptr/frontend/src/lib/apis/git.ts index 61d8329..1dd15d0 100644 --- a/cptr/frontend/src/lib/apis/git.ts +++ b/cptr/frontend/src/lib/apis/git.ts @@ -68,6 +68,12 @@ export const discardChanges = (root: string, files: string[]) => export const gitCommit = (root: string, message: string) => fetchJSON('/api/git/commit', jsonBody({ root, message })); +export const generateGitCommitMessage = (root: string, modelId?: string) => + fetchJSON<{ summary: string; description: string }>( + '/api/git/message', + jsonBody({ root, model_id: modelId || undefined }) + ); + export const gitPull = (root: string) => fetchJSON('/api/git/pull', jsonBody({ root })); export const gitFetch = (root: string) => fetchJSON('/api/git/fetch', jsonBody({ root })); diff --git a/cptr/frontend/src/lib/components/Bar.svelte b/cptr/frontend/src/lib/components/Bar.svelte index 264a28c..d20b06a 100644 --- a/cptr/frontend/src/lib/components/Bar.svelte +++ b/cptr/frontend/src/lib/components/Bar.svelte @@ -35,7 +35,7 @@ active: direction === 'horizontal', onclick: () => { setSplitDirection('horizontal'); - if (!$splitActive) splitCurrentTab('horizontal'); + splitCurrentTab('horizontal'); } }, { @@ -44,7 +44,7 @@ active: direction === 'vertical', onclick: () => { setSplitDirection('vertical'); - if (!$splitActive) splitCurrentTab('vertical'); + splitCurrentTab('vertical'); } } ]; diff --git a/cptr/frontend/src/lib/components/ChangelogModal.svelte b/cptr/frontend/src/lib/components/ChangelogModal.svelte index 45c2344..a39a284 100644 --- a/cptr/frontend/src/lib/components/ChangelogModal.svelte +++ b/cptr/frontend/src/lib/components/ChangelogModal.svelte @@ -2,6 +2,7 @@ import { fetchJSON } from '$lib/apis'; import Modal from './Modal.svelte'; import Icon from './Icon.svelte'; + import { savePreferences } from '$lib/apis/state'; import { appVersion, lastSeenVersion, showChangelog } from '$lib/stores'; import Spinner from '$lib/components/common/Spinner.svelte'; import { t } from '$lib/i18n'; @@ -29,6 +30,8 @@ function handleClose() { if ($appVersion) { lastSeenVersion.set($appVersion); + // Persist immediately so Done and the close button survive a quick reload. + savePreferences({ version: $appVersion }).catch(() => {}); } showChangelog.set(false); } diff --git a/cptr/frontend/src/lib/components/DirectoryPicker.svelte b/cptr/frontend/src/lib/components/DirectoryPicker.svelte index 08ec5ba..5d056aa 100644 --- a/cptr/frontend/src/lib/components/DirectoryPicker.svelte +++ b/cptr/frontend/src/lib/components/DirectoryPicker.svelte @@ -2,7 +2,7 @@ import { goto } from '$app/navigation'; import { addWorkspace } from '$lib/stores'; import { getWelcome } from '$lib/apis/state'; - import { listDir } from '$lib/apis/files'; + import { createEntry, listDir } from '$lib/apis/files'; import Icon from './Icon.svelte'; import Modal from './Modal.svelte'; import DropdownMenu from './DropdownMenu.svelte'; @@ -33,6 +33,8 @@ let actionsBtnEl: HTMLButtonElement | undefined = $state(); let listEl: HTMLDivElement | undefined = $state(); let history = $state([]); + let creatingFolder = $state(false); + let folderName = $state(''); // ── Editable path bar ─────────────────────────────────────── let editingPath = $state(false); @@ -283,6 +285,32 @@ function toggleHidden() { showHidden = !showHidden; } + + function startCreatingFolder() { + creatingFolder = true; + folderName = ''; + actionsMenuOpen = false; + } + + async function createFolder() { + const name = folderName.trim(); + if (!name) return; + const path = currentPath === '/' ? `/${name}` : `${currentPath}/${name}`; + try { + await createEntry(path, 'directory'); + await fetchDirectories(currentPath); + } catch (e: any) { + error = e.message || $t('files.failedToLoad'); + } finally { + creatingFolder = false; + folderName = ''; + } + } + + function cancelCreatingFolder() { + creatingFolder = false; + folderName = ''; + } @@ -393,6 +421,37 @@
+ {#if creatingFolder} +
+ + { + if (e.key === 'Enter') createFolder(); + if (e.key === 'Escape') cancelCreatingFolder(); + }} + autofocus + /> + + +
+ {/if} + {#if loading}
@@ -459,6 +518,11 @@ anchor={actionsBtnEl} align="end" items={[ + { + label: $t('files.newFolder'), + icon: 'folder', + onclick: () => startCreatingFolder() + }, { label: showHidden ? $t('files.hideHidden') : $t('files.showHidden'), icon: 'eye', diff --git a/cptr/frontend/src/lib/components/GitBar.svelte b/cptr/frontend/src/lib/components/GitBar.svelte index 0299588..e7160fd 100644 --- a/cptr/frontend/src/lib/components/GitBar.svelte +++ b/cptr/frontend/src/lib/components/GitBar.svelte @@ -1,6 +1,6 @@ @@ -890,114 +901,99 @@ {:else} {/if} +{#snippet renderLayout(node: EditorLayout)} + {#if node.type === 'group'} + {@const group = allGroups.find((item) => item.id === node.groupId)} + {#if group}{@render renderPane(group)}{/if} + {:else} +
+
+ {@render renderLayout(node.first)} +
+ +
handleDividerPointerDown(event, node)} + onpointermove={handleDividerPointerMove} + onpointerup={handleDividerPointerUp} + onpointercancel={handleDividerPointerUp} + >
+
+ {@render renderLayout(node.second)} +
+
+ {/if} +{/snippet} + +{#snippet renderPane(group: EditorGroup)} + {@const groupTab = getGroupActiveTab(group)} + +
setActiveGroup(group.id)} + ondragover={(event) => handlePaneDragOver(event, group.id)} + ondragleave={(event) => handlePaneDragLeave(event, group.id)} + ondrop={(event) => handlePaneDrop(event, group.id)} + > + 1} + isPrimary={group.id === allGroups[0]?.id} + onTabDragOver={() => { + if (dragOverZone?.groupId === group.id) dragOverZone = null; + }} + /> +
+ {#if $gitReviewOpen && group.id === allGroups[0]?.id} + + {:else} + {#each group.tabs.filter((tab) => tab.type === 'file' && tab.filePath) as tab (tab.id)} +
+ +
+ {/each} + {#each group.tabs.filter((tab) => tab.type === 'chat') as tab (tab.id)} +
+ +
+ {/each} + {#each group.tabs.filter((tab) => tab.type === 'terminal' && tab.sessionId) as tab (tab.id)} +
+ +
+ {/each} + {#each group.tabs.filter((tab) => tab.type === 'preview' && tab.port) as tab (tab.id)} +
+ +
+ {/each} + {#if !groupTab || groupTab.type === 'files'} + + {:else if groupTab.type === 'terminal' && !groupTab.sessionId} +
+ {/if} + {/if} +
+ {#if dragOverZone?.groupId === group.id} +
+ {/if} +
+{/snippet} + {#if pendingIntent} str: + """Return the staged patch, capped for lightweight AI requests.""" + _, out, _ = await _run("diff", "--staged", "--unified=3", cwd=root) + return out[:max_chars] + + def _parse_diff(raw: str) -> dict[str, Any]: """Parse unified diff into structured format.""" files: list[dict] = [] diff --git a/pyproject.toml b/pyproject.toml index 2e18835..e105620 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cptr" -version = "0.8.7" +version = "0.8.8" 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 8b650d6..a128eb9 100644 --- a/uv.lock +++ b/uv.lock @@ -284,7 +284,7 @@ wheels = [ [[package]] name = "cptr" -version = "0.8.7" +version = "0.8.8" source = { editable = "." } dependencies = [ { name = "aiosqlite" },