diff --git a/CHANGELOG.md b/CHANGELOG.md index 309d248..6a3b4fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added +- Native directory picker for CWD fields: `tauri-plugin-dialog` (Rust crate + `@tauri-apps/plugin-dialog` npm) provides native OS folder picker; browse buttons added to Default CWD, existing project CWD, and Add Project path inputs in SettingsTab - CSS relative units rule (`.claude/rules/18-relative-units.md`): enforces rem/em for layout CSS, px only for icons/borders/shadows +### Removed +- Stub `pick_directory` Tauri command (replaced by `tauri-plugin-dialog` frontend API) + ### Fixed - Sidebar drawer not scaling to content width: removed leftover v2 grid layout on `#app` in `app.css` (`display: grid; grid-template-columns: var(--sidebar-width) 1fr` + media queries) that constrained `.app-shell` to 260px first column; v3 `.app-shell` manages its own flexbox layout internally - ContextPane.svelte CSS converted from px to rem: font-size, padding, margin, gap; added `white-space: nowrap` on `.ctx-header`/`.ctx-error` for intrinsic width measurement diff --git a/CLAUDE.md b/CLAUDE.md index a307147..7b071b4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -103,10 +103,10 @@ Terminal emulator with SSH and Claude Code session management. v1 (GTK3+VTE Pyth - Multi-machine: bterminal-relay WebSocket server + RemoteManager WebSocket client - SQLite session persistence (rusqlite, WAL mode) + layout restore on startup - File watcher (notify crate) for live markdown viewer -- Rust deps (src-tauri): tauri, bterminal-core (path), rusqlite (bundled), dirs, notify, serde, tokio, tokio-tungstenite, futures-util, tauri-plugin-updater +- Rust deps (src-tauri): tauri, bterminal-core (path), rusqlite (bundled), dirs, notify, serde, tokio, tokio-tungstenite, futures-util, tauri-plugin-updater, tauri-plugin-dialog - Rust deps (bterminal-core): portable-pty, uuid, serde, serde_json, log - Rust deps (bterminal-relay): bterminal-core, tokio, tokio-tungstenite, clap, env_logger, futures-util -- npm deps: @anthropic-ai/claude-agent-sdk, @xterm/xterm, @xterm/addon-canvas, @xterm/addon-fit, @tauri-apps/api, @tauri-apps/plugin-updater, marked, shiki, vitest (dev) +- npm deps: @anthropic-ai/claude-agent-sdk, @xterm/xterm, @xterm/addon-canvas, @xterm/addon-fit, @tauri-apps/api, @tauri-apps/plugin-updater, @tauri-apps/plugin-dialog, marked, shiki, vitest (dev) - Source: `v2/` directory ## Build / Run diff --git a/TODO.md b/TODO.md index efbbfec..1f871a8 100644 --- a/TODO.md +++ b/TODO.md @@ -11,6 +11,7 @@ ## Completed +- [x] **Native directory picker** -- Added tauri-plugin-dialog for native OS folder picker on CWD fields (Default CWD, project CWD, Add Project path). Removed stub pick_directory command. | Done: 2026-03-08 - [x] **Fix sidebar drawer content-driven width** -- Root cause: leftover v2 grid layout on #app in app.css (`grid-template-columns: var(--sidebar-width) 1fr`) constrained .app-shell to 260px. Removed grid; JS $effect measurement now works correctly, all 4 tabs scale to content. | Done: 2026-03-08 - [x] **CSS relative units rule** -- Added .claude/rules/18-relative-units.md enforcing rem/em for layout CSS. Converted GlobalTabBar.svelte + App.svelte sidebar styles from px to rem. | Done: 2026-03-08 - [x] **VSCode-style sidebar redesign** -- Redesigned UI from top tab bar + right-side settings drawer to VSCode-style left sidebar: vertical icon rail (2.75rem, 4 SVG icons) + expandable drawer panel (content-driven width) + always-visible workspace. Settings is regular tab. Ctrl+B toggles sidebar. | Done: 2026-03-08 diff --git a/docs/v3-progress.md b/docs/v3-progress.md index 90ab710..5372182 100644 --- a/docs/v3-progress.md +++ b/docs/v3-progress.md @@ -303,3 +303,14 @@ All editor themes map to the same `--ctp-*` CSS custom property names (26 vars). - [x] Added JS `$effect` in App.svelte: measures content width via `requestAnimationFrame` + `querySelectorAll` for nowrap elements, headings, inputs, tab-specific selectors; `panelWidth` state drives inline `style:width` - [x] Verified all 4 tabs scale to content: Sessions ~473px, Settings ~322px, Context ~580px, Docs varies by content - [x] Investigation path: CSS intrinsic sizing (max-content, fit-content) failed due to column-flex circular dependency → JS measurement approach → discovered inline style set but rendered width wrong → Playwright inspection revealed parent `.main-row` only 260px → traced to `#app` grid layout + +### Session: 2026-03-08 — Native Directory Picker + +#### tauri-plugin-dialog Integration +- [x] Added `tauri-plugin-dialog` Rust crate + `@tauri-apps/plugin-dialog` npm package +- [x] Registered plugin in lib.rs (`tauri_plugin_dialog::init()`) +- [x] Removed stub `pick_directory` Tauri command (always returned None) +- [x] Added `browseDirectory()` helper in SettingsTab.svelte using `open({ directory: true })` +- [x] Added folder browse button (folder SVG icon) to: Default CWD, existing project CWD, Add Project path +- [x] Styled `.input-with-browse` layout (flex row, themed browse button) +- [x] Fixed nested input theme: `.setting-field .input-with-browse input` selector for dark background