mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-17 20:51:19 -08:00
Start the desktop app terminal docked on the right, and release 3.0.3
AI Assisted
This commit is contained in:
1 parent
9226b82c37
commit
d84d6a4690
13 files changed
+40
-39
No files matched your search
@@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
All notable changes to Plan2Code will be documented in this file.
|
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
|
## v3.0.2
|
||||||
|
|
||||||
### ✨ Added
|
### ✨ Added
|
||||||
|
|||||||
@@ -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.
|
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)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "plan2code",
|
"name": "plan2code",
|
||||||
"version": "3.0.2",
|
"version": "3.0.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"plan2code-install": "./install.js"
|
"plan2code-install": "./install.js"
|
||||||
|
|||||||
Generated
+2
-2
@@ -757,7 +757,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fake-agent"
|
name = "fake-agent"
|
||||||
version = "3.0.2"
|
version = "3.0.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"terminal_size",
|
"terminal_size",
|
||||||
@@ -2371,7 +2371,7 @@ checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "plan2code-app"
|
name = "plan2code-app"
|
||||||
version = "3.0.2"
|
version = "3.0.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"libc",
|
"libc",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "fake-agent"
|
name = "fake-agent"
|
||||||
version = "3.0.2"
|
version = "3.0.3"
|
||||||
description = "A stand-in agent program for the Plan2Code app's tests"
|
description = "A stand-in agent program for the Plan2Code app's tests"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "plan2code-app",
|
"name": "plan2code-app",
|
||||||
"version": "3.0.2",
|
"version": "3.0.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "plan2code-app",
|
"name": "plan2code-app",
|
||||||
"version": "3.0.2",
|
"version": "3.0.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "2.12.4",
|
"@tauri-apps/api": "2.12.4",
|
||||||
"@xterm/addon-fit": "0.11.0",
|
"@xterm/addon-fit": "0.11.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "plan2code-app",
|
"name": "plan2code-app",
|
||||||
"version": "3.0.2",
|
"version": "3.0.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Plan2Code desktop app (Tauri). Separate from the repo root so the root and the web console stay dependency-free.",
|
"description": "Plan2Code desktop app (Tauri). Separate from the repo root so the root and the web console stay dependency-free.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "plan2code-app"
|
name = "plan2code-app"
|
||||||
version = "3.0.2"
|
version = "3.0.3"
|
||||||
description = "Plan2Code desktop app"
|
description = "Plan2Code desktop app"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|||||||
@@ -706,14 +706,11 @@ fn app_state(state: State<'_, AppState>) -> serde_json::Value {
|
|||||||
.filter(known)
|
.filter(known)
|
||||||
})
|
})
|
||||||
.or_else(|| project::remembered_agent().filter(known));
|
.or_else(|| project::remembered_agent().filter(known));
|
||||||
let term_panel = settings_file.as_ref().map_or(
|
// Null until the person has docked, dragged or collapsed the pane: the
|
||||||
settings::TermPanelSettings {
|
// page then starts it docked right.
|
||||||
dock: settings::DEFAULT_TERM_DOCK.to_string(),
|
let term_panel = settings_file
|
||||||
fraction: settings::DEFAULT_TERM_FRACTION,
|
.as_ref()
|
||||||
collapsed: false,
|
.and_then(|file| settings::load_term_panel(file));
|
||||||
},
|
|
||||||
|file| settings::load_term_panel(file),
|
|
||||||
);
|
|
||||||
let first_run_done = settings_file
|
let first_run_done = settings_file
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.is_some_and(|file| settings::load_first_run_done(file));
|
.is_some_and(|file| settings::load_first_run_done(file));
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ pub struct TermPanelSettings {
|
|||||||
pub collapsed: bool,
|
pub collapsed: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const DEFAULT_TERM_DOCK: &str = "bottom";
|
|
||||||
pub const DEFAULT_TERM_FRACTION: f64 = 0.25;
|
pub const DEFAULT_TERM_FRACTION: f64 = 0.25;
|
||||||
const TERM_FRACTION_MIN: f64 = 0.05;
|
const TERM_FRACTION_MIN: f64 = 0.05;
|
||||||
const TERM_FRACTION_MAX: f64 = 0.9;
|
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)
|
write(file, settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The terminal pane's shape, from the file or the defaults. A dock other
|
/// The terminal pane's saved shape, or `None` when no valid dock is saved (a
|
||||||
/// than `bottom` or `right`, or a fraction outside its range, is the default.
|
/// fresh install, or a dock other than `bottom` or `right`): the page then
|
||||||
pub fn load_term_panel(file: &Path) -> TermPanelSettings {
|
/// 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<TermPanelSettings> {
|
||||||
let settings = read(file);
|
let settings = read(file);
|
||||||
let dock = settings
|
let dock = settings
|
||||||
.get(TERM_DOCK_KEY)
|
.get(TERM_DOCK_KEY)
|
||||||
.and_then(|v| v.as_str())
|
.and_then(|v| v.as_str())
|
||||||
.filter(|d| *d == "bottom" || *d == "right")
|
.filter(|d| *d == "bottom" || *d == "right")?
|
||||||
.unwrap_or(DEFAULT_TERM_DOCK)
|
|
||||||
.to_string();
|
.to_string();
|
||||||
let fraction = settings
|
let fraction = settings
|
||||||
.get(TERM_FRACTION_KEY)
|
.get(TERM_FRACTION_KEY)
|
||||||
@@ -72,11 +72,11 @@ pub fn load_term_panel(file: &Path) -> TermPanelSettings {
|
|||||||
.get(TERM_COLLAPSED_KEY)
|
.get(TERM_COLLAPSED_KEY)
|
||||||
.and_then(|v| v.as_bool())
|
.and_then(|v| v.as_bool())
|
||||||
.unwrap_or(false);
|
.unwrap_or(false);
|
||||||
TermPanelSettings {
|
Some(TermPanelSettings {
|
||||||
dock,
|
dock,
|
||||||
fraction,
|
fraction,
|
||||||
collapsed,
|
collapsed,
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Save the terminal pane's shape, keeping any other key the file holds. An
|
/// Save the terminal pane's shape, keeping any other key the file holds. An
|
||||||
@@ -202,13 +202,8 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn the_term_panel_defaults_to_bottom_at_a_quarter() {
|
fn nothing_saved_reports_no_term_panel_so_the_page_docks_right() {
|
||||||
let want = TermPanelSettings {
|
assert_eq!(load_term_panel(&temp_file("term-missing")), None);
|
||||||
dock: "bottom".into(),
|
|
||||||
fraction: 0.25,
|
|
||||||
collapsed: false,
|
|
||||||
};
|
|
||||||
assert_eq!(load_term_panel(&temp_file("term-missing")), want);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -219,11 +214,11 @@ mod tests {
|
|||||||
save_term_panel(&file, "right", 0.4, true).unwrap();
|
save_term_panel(&file, "right", 0.4, true).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
load_term_panel(&file),
|
load_term_panel(&file),
|
||||||
TermPanelSettings {
|
Some(TermPanelSettings {
|
||||||
dock: "right".into(),
|
dock: "right".into(),
|
||||||
fraction: 0.4,
|
fraction: 0.4,
|
||||||
collapsed: true
|
collapsed: true
|
||||||
}
|
})
|
||||||
);
|
);
|
||||||
assert!(std::fs::read_to_string(&file)
|
assert!(std::fs::read_to_string(&file)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
@@ -272,11 +267,13 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[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");
|
let file = temp_file("term-bad-load");
|
||||||
std::fs::create_dir_all(file.parent().unwrap()).unwrap();
|
std::fs::create_dir_all(file.parent().unwrap()).unwrap();
|
||||||
std::fs::write(&file, r#"{"termDock": "top", "termFraction": 5}"#).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.dock, "bottom");
|
||||||
assert_eq!(loaded.fraction, 0.25);
|
assert_eq!(loaded.fraction, 0.25);
|
||||||
let _ = std::fs::remove_dir_all(file.parent().unwrap());
|
let _ = std::fs::remove_dir_all(file.parent().unwrap());
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "Plan2Code",
|
"productName": "Plan2Code",
|
||||||
"version": "3.0.2",
|
"version": "3.0.3",
|
||||||
"identifier": "com.plan2code.desktop",
|
"identifier": "com.plan2code.desktop",
|
||||||
"build": {
|
"build": {
|
||||||
"frontendDist": "../ui",
|
"frontendDist": "../ui",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// The app page: the top bar, the console dashboard in an iframe, and the
|
// 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 { 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';
|
import { NEW_RELEASE_COMMAND, attentionSignal, barNextSteps, continueKeys, defaultRightFraction, folderName, lastAgentNotice, pickDefaultAgent, taskbarSwitch, windowTitleFor, deadConsoleAction, loopBanner, loopLocks, loopStopLabels, loopWindowTitle } from './meter.js';
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Plan2Code",
|
"name": "Plan2Code",
|
||||||
"version": "3.0.2",
|
"version": "3.0.3",
|
||||||
"description": "A structured 4-step workflow methodology for AI-assisted software development",
|
"description": "A structured 4-step workflow methodology for AI-assisted software development",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ai",
|
"ai",
|
||||||
|
|||||||
Reference in new issue
Block a user