mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-24 13:11:18 -08:00
Release 3.1.5: start the new project's dashboard on Change project, and keep the console page itself from scrolling
AI Assisted
This commit is contained in:
1 parent
cfc58f5a06
commit
b06a4cb4ab
20 files changed
+145
-21
No files matched your search
Generated
+2
-2
@@ -957,7 +957,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "fake-agent"
|
||||
version = "3.1.4"
|
||||
version = "3.1.5"
|
||||
dependencies = [
|
||||
"serde_json",
|
||||
"terminal_size",
|
||||
@@ -2647,7 +2647,7 @@ checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
|
||||
|
||||
[[package]]
|
||||
name = "plan2code-app"
|
||||
version = "3.1.4"
|
||||
version = "3.1.5"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"libc",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "fake-agent"
|
||||
version = "3.1.4"
|
||||
version = "3.1.5"
|
||||
description = "A stand-in agent program for the Plan2Code app's tests"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "plan2code-app",
|
||||
"version": "3.1.4",
|
||||
"version": "3.1.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "plan2code-app",
|
||||
"version": "3.1.4",
|
||||
"version": "3.1.5",
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.12.4",
|
||||
"@xterm/addon-fit": "0.11.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "plan2code-app",
|
||||
"version": "3.1.4",
|
||||
"version": "3.1.5",
|
||||
"private": true,
|
||||
"description": "Plan2Code desktop app (Tauri). Separate from the repo root so the root and the web console stay dependency-free.",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "plan2code-app"
|
||||
version = "3.1.4"
|
||||
version = "3.1.5"
|
||||
description = "Plan2Code desktop app"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
@@ -1139,6 +1139,14 @@ fn teardown_project(state: &AppState) -> Result<(), String> {
|
||||
let _ = sup.stop();
|
||||
}
|
||||
}
|
||||
// The new project's agent asks the window which session is current and
|
||||
// joins it; left at the old project's (its console just stopped), its
|
||||
// `open` joined a dead page and the dashboard never showed.
|
||||
if let Ok(guard) = state.announce.lock() {
|
||||
if let Some(server) = guard.as_ref() {
|
||||
server.forget_current();
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -2011,8 +2019,22 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn new_session_forgets_the_windows_session_so_the_fresh_agent_starts_its_own() {
|
||||
fn changing_project_forgets_the_old_projects_session_so_the_new_agent_starts_its_own() {
|
||||
// The new agent's `open` asks the window which session is current; left
|
||||
// at the old project's (its console torn down) it joined a dead page
|
||||
// and never showed its dashboard.
|
||||
let state = state_for("project-a");
|
||||
announce_page(&state, "s1");
|
||||
teardown_project(&state).unwrap();
|
||||
assert_eq!(
|
||||
state.announce.lock().unwrap().as_ref().unwrap().current(),
|
||||
None,
|
||||
"the new project's agent must not join the old project's s1"
|
||||
);
|
||||
}
|
||||
|
||||
/// Starts the announce server on `state` and announces page `sid` to it.
|
||||
fn announce_page(state: &AppState, sid: &str) {
|
||||
let server = AnnounceServer::start(Arc::new(|_| true)).unwrap();
|
||||
let port: u16 = server
|
||||
.url()
|
||||
@@ -2023,7 +2045,8 @@ mod tests {
|
||||
.parse()
|
||||
.unwrap();
|
||||
*state.announce.lock().unwrap() = Some(server);
|
||||
let body = r#"{"url":"http://127.0.0.1:5000/s/abc/","sid":"s1","workflow":"plan"}"#;
|
||||
let body =
|
||||
format!(r#"{{"url":"http://127.0.0.1:5000/s/abc/","sid":"{sid}","workflow":"plan"}}"#);
|
||||
let mut stream = std::net::TcpStream::connect(("127.0.0.1", port)).unwrap();
|
||||
let token = state
|
||||
.announce
|
||||
@@ -2055,8 +2078,14 @@ mod tests {
|
||||
.unwrap()
|
||||
.current()
|
||||
.map(|n| n.sid),
|
||||
Some("s1".to_string())
|
||||
Some(sid.to_string())
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn new_session_forgets_the_windows_session_so_the_fresh_agent_starts_its_own() {
|
||||
let state = state_for("project-a");
|
||||
announce_page(&state, "s1");
|
||||
|
||||
// No console supervised here, so no brief to write: only the forgetting.
|
||||
assert_eq!(before_fresh_hook(&state)(), None);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Plan2Code",
|
||||
"version": "3.1.4",
|
||||
"version": "3.1.5",
|
||||
"identifier": "com.plan2code.desktop",
|
||||
"build": {
|
||||
"frontendDist": "../ui",
|
||||
|
||||
Reference in new issue
Block a user