From 3d5edfee802bbb2d2a25d9ef15cceba0f71a61a0 Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Mon, 1 Jun 2026 15:30:47 -0700 Subject: [PATCH] test(config): cover legacy workspace shell opt-in Refs #2523 --- crates/tui/src/main.rs | 14 ++++++++++++++ docs/CONFIGURATION.md | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/crates/tui/src/main.rs b/crates/tui/src/main.rs index e51a1900..376514f8 100644 --- a/crates/tui/src/main.rs +++ b/crates/tui/src/main.rs @@ -6905,6 +6905,20 @@ allow_shell = false assert_eq!(config.allow_shell, Some(true)); } + #[test] + fn user_workspace_overlay_accepts_legacy_projects_table() { + let tmp = tempdir().expect("tempdir"); + let workspace = tmp.path().join("project"); + fs::create_dir_all(&workspace).expect("mkdir workspace"); + let raw = format!("[projects.'{}']\nallow_shell = true\n", workspace.display()); + let doc: toml::Value = toml::from_str(&raw).expect("parse config"); + + let mut config = Config::default(); + merge_user_workspace_config_from_doc(&mut config, &doc, &workspace); + + assert_eq!(config.allow_shell, Some(true)); + } + #[test] fn user_workspace_overlay_ignores_non_matching_workspace() { let tmp = tempdir().expect("tempdir"); diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index 4aa2d8e3..e1698f2a 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -34,6 +34,10 @@ The entry applies only when the launched workspace path matches the table key. The legacy `[projects."/absolute/path/to/project"]` table is also accepted for this user-owned override. +In interactive mode, the per-project overlay +`/.codewhale/config.toml` is applied after this user entry. A +project-level `allow_shell = false` still takes precedence. + ### Per-project overlay (#485) When the TUI starts in a workspace that contains a