From d84d6a4690f239ef557e5aeb5ab017ba71167a74 Mon Sep 17 00:00:00 2001 From: Justin Parker Date: Fri, 6 Nov 2026 13:38:13 -0800 Subject: [PATCH] Start the desktop app terminal docked on the right, and release 3.0.3 AI Assisted --- CHANGELOG.md | 6 +++++ README.md | 2 +- package.json | 2 +- plan2code-app/Cargo.lock | 4 +-- plan2code-app/fake-agent/Cargo.toml | 2 +- plan2code-app/package-lock.json | 4 +-- plan2code-app/package.json | 2 +- plan2code-app/src-tauri/Cargo.toml | 2 +- plan2code-app/src-tauri/src/main.rs | 13 ++++----- plan2code-app/src-tauri/src/settings.rs | 35 +++++++++++-------------- plan2code-app/src-tauri/tauri.conf.json | 2 +- plan2code-app/ui/app.js | 3 ++- version.json | 2 +- 13 files changed, 40 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a937024..e0930ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to Plan2Code will be documented in this file. +## v3.0.3 + +### 🐛 Fixed + +- **desktop app**: the terminal now starts docked on the right on a fresh install, as intended, instead of at the bottom. The app always reported a saved `bottom` dock, so the page's right-dock default never ran; it now reports nothing until a dock is saved. A dock you already chose is kept. + ## v3.0.2 ### ✨ Added diff --git a/README.md b/README.md index dd7a46e..144a54b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ the next engineer all start from the same specs. One command opens it, every step is a card, and the terminal is always there if you prefer it. -Version 3.0.2 · MIT · 📖 [plan2code.jparkerweb.com](https://plan2code.jparkerweb.com) +Version 3.0.3 · MIT · 📖 [plan2code.jparkerweb.com](https://plan2code.jparkerweb.com) --- diff --git a/package.json b/package.json index 2f8030a..0a0d7d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plan2code", - "version": "3.0.2", + "version": "3.0.3", "private": true, "bin": { "plan2code-install": "./install.js" diff --git a/plan2code-app/Cargo.lock b/plan2code-app/Cargo.lock index 780098c..cb7daf7 100644 --- a/plan2code-app/Cargo.lock +++ b/plan2code-app/Cargo.lock @@ -757,7 +757,7 @@ dependencies = [ [[package]] name = "fake-agent" -version = "3.0.2" +version = "3.0.3" dependencies = [ "serde_json", "terminal_size", @@ -2371,7 +2371,7 @@ checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" [[package]] name = "plan2code-app" -version = "3.0.2" +version = "3.0.3" dependencies = [ "chrono", "libc", diff --git a/plan2code-app/fake-agent/Cargo.toml b/plan2code-app/fake-agent/Cargo.toml index 968dc68..425d8cf 100644 --- a/plan2code-app/fake-agent/Cargo.toml +++ b/plan2code-app/fake-agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fake-agent" -version = "3.0.2" +version = "3.0.3" description = "A stand-in agent program for the Plan2Code app's tests" edition = "2021" publish = false diff --git a/plan2code-app/package-lock.json b/plan2code-app/package-lock.json index 44293f4..51c318e 100644 --- a/plan2code-app/package-lock.json +++ b/plan2code-app/package-lock.json @@ -1,12 +1,12 @@ { "name": "plan2code-app", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "plan2code-app", - "version": "3.0.2", + "version": "3.0.3", "dependencies": { "@tauri-apps/api": "2.12.4", "@xterm/addon-fit": "0.11.0", diff --git a/plan2code-app/package.json b/plan2code-app/package.json index 168898c..cb406cf 100644 --- a/plan2code-app/package.json +++ b/plan2code-app/package.json @@ -1,6 +1,6 @@ { "name": "plan2code-app", - "version": "3.0.2", + "version": "3.0.3", "private": true, "description": "Plan2Code desktop app (Tauri). Separate from the repo root so the root and the web console stay dependency-free.", "scripts": { diff --git a/plan2code-app/src-tauri/Cargo.toml b/plan2code-app/src-tauri/Cargo.toml index a5e5cb2..468525a 100644 --- a/plan2code-app/src-tauri/Cargo.toml +++ b/plan2code-app/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "plan2code-app" -version = "3.0.2" +version = "3.0.3" description = "Plan2Code desktop app" edition = "2021" publish = false diff --git a/plan2code-app/src-tauri/src/main.rs b/plan2code-app/src-tauri/src/main.rs index 288496e..8a6216a 100644 --- a/plan2code-app/src-tauri/src/main.rs +++ b/plan2code-app/src-tauri/src/main.rs @@ -706,14 +706,11 @@ fn app_state(state: State<'_, AppState>) -> serde_json::Value { .filter(known) }) .or_else(|| project::remembered_agent().filter(known)); - let term_panel = settings_file.as_ref().map_or( - settings::TermPanelSettings { - dock: settings::DEFAULT_TERM_DOCK.to_string(), - fraction: settings::DEFAULT_TERM_FRACTION, - collapsed: false, - }, - |file| settings::load_term_panel(file), - ); + // Null until the person has docked, dragged or collapsed the pane: the + // page then starts it docked right. + let term_panel = settings_file + .as_ref() + .and_then(|file| settings::load_term_panel(file)); let first_run_done = settings_file .as_ref() .is_some_and(|file| settings::load_first_run_done(file)); diff --git a/plan2code-app/src-tauri/src/settings.rs b/plan2code-app/src-tauri/src/settings.rs index f7287dd..1237ef1 100644 --- a/plan2code-app/src-tauri/src/settings.rs +++ b/plan2code-app/src-tauri/src/settings.rs @@ -21,7 +21,6 @@ pub struct TermPanelSettings { pub collapsed: bool, } -pub const DEFAULT_TERM_DOCK: &str = "bottom"; pub const DEFAULT_TERM_FRACTION: f64 = 0.25; const TERM_FRACTION_MIN: f64 = 0.05; const TERM_FRACTION_MAX: f64 = 0.9; @@ -53,15 +52,16 @@ pub fn save_last_agent(file: &Path, id: &str) -> Result<(), String> { write(file, settings) } -/// The terminal pane's shape, from the file or the defaults. A dock other -/// than `bottom` or `right`, or a fraction outside its range, is the default. -pub fn load_term_panel(file: &Path) -> TermPanelSettings { +/// The terminal pane's saved shape, or `None` when no valid dock is saved (a +/// fresh install, or a dock other than `bottom` or `right`): the page then +/// picks its own default, docked right. A fraction outside its range falls +/// back to the default fraction. +pub fn load_term_panel(file: &Path) -> Option { let settings = read(file); let dock = settings .get(TERM_DOCK_KEY) .and_then(|v| v.as_str()) - .filter(|d| *d == "bottom" || *d == "right") - .unwrap_or(DEFAULT_TERM_DOCK) + .filter(|d| *d == "bottom" || *d == "right")? .to_string(); let fraction = settings .get(TERM_FRACTION_KEY) @@ -72,11 +72,11 @@ pub fn load_term_panel(file: &Path) -> TermPanelSettings { .get(TERM_COLLAPSED_KEY) .and_then(|v| v.as_bool()) .unwrap_or(false); - TermPanelSettings { + Some(TermPanelSettings { dock, fraction, collapsed, - } + }) } /// Save the terminal pane's shape, keeping any other key the file holds. An @@ -202,13 +202,8 @@ mod tests { } #[test] - fn the_term_panel_defaults_to_bottom_at_a_quarter() { - let want = TermPanelSettings { - dock: "bottom".into(), - fraction: 0.25, - collapsed: false, - }; - assert_eq!(load_term_panel(&temp_file("term-missing")), want); + fn nothing_saved_reports_no_term_panel_so_the_page_docks_right() { + assert_eq!(load_term_panel(&temp_file("term-missing")), None); } #[test] @@ -219,11 +214,11 @@ mod tests { save_term_panel(&file, "right", 0.4, true).unwrap(); assert_eq!( load_term_panel(&file), - TermPanelSettings { + Some(TermPanelSettings { dock: "right".into(), fraction: 0.4, collapsed: true - } + }) ); assert!(std::fs::read_to_string(&file) .unwrap() @@ -272,11 +267,13 @@ mod tests { } #[test] - fn a_bad_dock_or_out_of_range_fraction_on_disk_reads_as_the_default() { + fn a_bad_dock_on_disk_reads_as_nothing_saved_and_a_bad_fraction_as_the_default() { let file = temp_file("term-bad-load"); std::fs::create_dir_all(file.parent().unwrap()).unwrap(); std::fs::write(&file, r#"{"termDock": "top", "termFraction": 5}"#).unwrap(); - let loaded = load_term_panel(&file); + assert_eq!(load_term_panel(&file), None); + std::fs::write(&file, r#"{"termDock": "bottom", "termFraction": 5}"#).unwrap(); + let loaded = load_term_panel(&file).unwrap(); assert_eq!(loaded.dock, "bottom"); assert_eq!(loaded.fraction, 0.25); let _ = std::fs::remove_dir_all(file.parent().unwrap()); diff --git a/plan2code-app/src-tauri/tauri.conf.json b/plan2code-app/src-tauri/tauri.conf.json index 352c01b..379b676 100644 --- a/plan2code-app/src-tauri/tauri.conf.json +++ b/plan2code-app/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Plan2Code", - "version": "3.0.2", + "version": "3.0.3", "identifier": "com.plan2code.desktop", "build": { "frontendDist": "../ui", diff --git a/plan2code-app/ui/app.js b/plan2code-app/ui/app.js index 9f1488c..ae952ec 100644 --- a/plan2code-app/ui/app.js +++ b/plan2code-app/ui/app.js @@ -1,5 +1,6 @@ // The app page: the top bar, the console dashboard in an iframe, and the -// agent's terminal panel docked at the bottom with a drag handle. +// agent's terminal panel, docked right by default (or at the bottom on +// request) with a drag handle. import { mountTerminal } from './terminal.js'; import { NEW_RELEASE_COMMAND, attentionSignal, barNextSteps, continueKeys, defaultRightFraction, folderName, lastAgentNotice, pickDefaultAgent, taskbarSwitch, windowTitleFor, deadConsoleAction, loopBanner, loopLocks, loopStopLabels, loopWindowTitle } from './meter.js'; diff --git a/version.json b/version.json index af74032..054bef0 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "name": "Plan2Code", - "version": "3.0.2", + "version": "3.0.3", "description": "A structured 4-step workflow methodology for AI-assisted software development", "keywords": [ "ai",