diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fc0bd66..48c13989 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,19 @@ and listed with their assets on the A service's or container's detail goes to the overview, a command's run to the command list, since both belong to the lane left. +### Changed + +- **The dashboard's "stack file behind" banner is one quiet line and can be + hidden**: neutral instead of blue, one "Bring up to date" button whose + menu holds the other agents, the copy and the prompt, and it says that the + agent skills are older too instead of a second banner. Hidden, it stays + hidden for that stack until the next minor devstack is installed; a patch + release does not bring it back. +- **The agent skills count as outdated only when their text changed**: a new + devstack whose skills read the same, apart from the version in their marker + line and docs links, no longer asks for a refresh (dashboard, `status`, + `doctor`, `skills check`). + ### Fixed - **A lane's memory check looks at Docker Desktop's VM** (#309): on Windows diff --git a/crates/devstack-skills/src/lib.rs b/crates/devstack-skills/src/lib.rs index 936ab174..8a5c5cd7 100644 --- a/crates/devstack-skills/src/lib.rs +++ b/crates/devstack-skills/src/lib.rs @@ -6,8 +6,8 @@ //! (`.claude/skills` when it names none). A generated skill says so in a //! marker line; installing again overwrites it, and `devstack status` (and //! the dashboard, through the hub) notes when an installed copy, in those -//! folders or another agent's, no longer matches this devstack or this stack -//! file. What is +//! folders or another agent's, no longer matches this devstack's templates or +//! this stack file (a new version alone does not count). What is //! specific to a project beyond that belongs in a skill of the project's own, //! which devstack never touches. @@ -104,17 +104,19 @@ fn file_name(stack_file: &Path) -> String { pub fn render_all(stack: &Stack, stack_file: &Path) -> Vec<(&'static str, String)> { TEMPLATES .iter() - .map(|(name, tpl)| (*name, render(tpl, stack, stack_file))) + .map(|(name, tpl)| (*name, render(tpl, stack, stack_file, VERSION))) .collect() } -fn render(tpl: &str, stack: &Stack, stack_file: &Path) -> String { +/// `version` names the devstack in the marker line and the docs links: this +/// one, or an installed skill's own to tell whether more than that differs. +fn render(tpl: &str, stack: &Stack, stack_file: &Path, version: &str) -> String { let file = file_name(stack_file); let vars: Vec<(&str, String)> = vec![ ( "marker", format!( - "generated by devstack {VERSION} from {file} {MARKER_TAG}: edits here are overwritten; put project specifics into a skill of your own" + "generated by devstack {version} from {file} {MARKER_TAG}: edits here are overwritten; put project specifics into a skill of your own" ), ), ("stack_name", stack.stack.name.clone()), @@ -128,7 +130,7 @@ fn render(tpl: &str, stack: &Stack, stack_file: &Path) -> String { .map_or_else(|| "any version".into(), |r| format!("devstack {r}")), ), ("repo_url", REPO_URL.into()), - ("docs_url", format!("{REPO_URL}/blob/v{VERSION}/docs")), + ("docs_url", format!("{REPO_URL}/blob/v{version}/docs")), ("services_table", services_table(stack)), ("held_paths", held_paths(stack)), ("commands_table", commands_table(stack)), @@ -395,7 +397,9 @@ pub struct Installed { /// Generated skills found, by folder: `.claude/skills/devstack` (one the /// project wrote itself is not one). pub found: Vec, - /// Of those, the ones that differ from what `install` would write now. + /// Of those, the ones that differ from what `install` would write now, + /// apart from the devstack version: a release whose skills read the same + /// leaves them be. pub outdated: Vec, /// The oldest devstack their marker lines name: the version the /// repository was last set up with. `None` when no marker names one. @@ -410,10 +414,9 @@ pub fn installed(stack_file: &Path) -> Installed { let Ok(dirs) = search_dirs(&stack, stack_file) else { return Installed::default(); }; - let rendered = render_all(&stack, stack_file); let mut out = Installed::default(); for dir in &dirs { - for (name, content) in &rendered { + for (name, tpl) in TEMPLATES { let Ok(e) = std::fs::read_to_string(dir.join(name).join("SKILL.md")) else { continue; }; @@ -421,11 +424,19 @@ pub fn installed(stack_file: &Path) -> Installed { continue; } let at = shown(stack_file, dir, name); - if normalize(&e) != normalize(content) { + // Held against this devstack's text as the version that wrote it. + let version = marker_version(&e); + let content = render( + tpl, + &stack, + stack_file, + version.as_deref().unwrap_or(VERSION), + ); + if normalize(&e) != normalize(&content) { out.outdated.push(at.clone()); } out.found.push(at); - if let Some(v) = marker_version(&e) { + if let Some(v) = version { let older = out.from.as_deref().is_none_or(|f| { devstack_config::version_order(&v) < devstack_config::version_order(f) }); @@ -615,7 +626,7 @@ steps = [{ exec = "true" }] #[test] fn the_marker_names_the_version_it_was_written_by() { let s = stack(); - let written = render(TEMPLATES[0].1, &s, Path::new("devstack.toml")); + let written = render(TEMPLATES[0].1, &s, Path::new("devstack.toml"), VERSION); assert_eq!(marker_version(&written).as_deref(), Some(VERSION)); assert_eq!( marker_version( @@ -645,8 +656,17 @@ ours" assert!(now.outdated.is_empty()); assert_eq!(now.from.as_deref(), Some(VERSION)); - // One of them written by an older devstack. - age(&dir.path().join(".claude/skills/devstack/SKILL.md")); + // One of them written by an older devstack whose skill read the same: + // nothing to refresh, but it still says how far back. + let skill = dir.path().join(".claude/skills/devstack/SKILL.md"); + age(&skill, false); + let same = installed(&file); + assert!(same.outdated.is_empty(), "{:?}", same.outdated); + assert_eq!(same.from.as_deref(), Some("0.1.0")); + + // One whose text has changed since. + install(&stack, &file, None, false).unwrap(); + age(&skill, true); let then = installed(&file); assert_eq!(then.outdated, [".claude/skills/devstack"]); assert_eq!(then.from.as_deref(), Some("0.1.0")); @@ -654,14 +674,17 @@ ours" const STACK: &str = "version = 1\n[stack]\nname = \"shop\"\n[services.api]\nrun = \"x\"\n"; - /// As if an older devstack had written it. - fn age(skill: &Path) { - let text = std::fs::read_to_string(skill).unwrap(); - std::fs::write( - skill, - text.replace(&format!("devstack {VERSION} "), "devstack 0.1.0 "), - ) - .unwrap(); + /// As if an older devstack had written it, with other text than this one + /// when `changed`. + fn age(skill: &Path, changed: bool) { + let mut text = std::fs::read_to_string(skill) + .unwrap() + .replace(&format!("devstack {VERSION} "), "devstack 0.1.0 ") + .replace(&format!("/blob/v{VERSION}/"), "/blob/v0.1.0/"); + if changed { + text.push_str("\nA paragraph this devstack no longer writes.\n"); + } + std::fs::write(skill, text).unwrap(); } #[test] @@ -690,7 +713,7 @@ ours" // found and refreshed; the project's own skill there stays. let github = dir.path().join(".github/skills"); install(&stack, &file, Some(&github), false).unwrap(); - age(&github.join("devstack/SKILL.md")); + age(&github.join("devstack/SKILL.md"), true); std::fs::write(github.join("devstack-config/SKILL.md"), "ours").unwrap(); assert_eq!(outdated(&file), [".github/skills/devstack"]); install(&stack, &file, None, false).unwrap(); diff --git a/docs/stack-file.md b/docs/stack-file.md index c38812d3..97e40af6 100644 --- a/docs/stack-file.md +++ b/docs/stack-file.md @@ -957,7 +957,8 @@ inside the repository and be named once; the list must not be empty. A generated skill (its marker line says so) is also looked for in the other agents' folders (`.github/skills`, `.cursor/skills`, `.gemini/skills`, ...): `devstack status`, `doctor`, `skills check` and the dashboard report one that -no longer matches, and `skills install` refreshes it there. A skill the +no longer matches (a newer devstack whose skills read the same, apart from +its version, does not count), and `skills install` refreshes it there. A skill the project wrote itself is never touched. ## Placeholders diff --git a/ui/src/components/AgentPrompt.vue b/ui/src/components/AgentPrompt.vue index 70f3f59e..d232c46d 100644 --- a/ui/src/components/AgentPrompt.vue +++ b/ui/src/components/AgentPrompt.vue @@ -2,16 +2,20 @@ // A prompt for a coding agent, written by the hub (ADR-0046, amendment // 2026-10-22): copied, shown, or handed to an agent the hub starts in the // right folder. The page names the prompt and what it is about, never text. +// `compact` fits it into a one-line banner: one button for the first agent, +// the others, the copy and the text in its menu. import { computed, ref, watch } from 'vue'; import { api, paths } from '@/api'; import type { Opener, PromptKind, PromptTarget } from '@/api/types'; import { act } from '@/lib/actions'; import { useOpenerPrefs } from '@/lib/openers'; +import { usePopover } from '@/lib/popover'; import { useHub } from '@/stores/hub'; import { useUi } from '@/stores/ui'; import Icon from './icons/Icon.vue'; +import Modal from './Modal.vue'; -const props = defineProps<{ kind: PromptKind; target: PromptTarget }>(); +const props = defineProps<{ kind: PromptKind; target: PromptTarget; compact?: boolean; label?: string }>(); const hub = useHub(); const ui = useUi(); const prefs = useOpenerPrefs(); @@ -19,6 +23,10 @@ const prefs = useOpenerPrefs(); const text = ref(null); const problem = ref(null); const starting = ref(null); +const showing = ref(false); +const root = ref(null); +const trigger = ref(null); +const menu = usePopover(root, trigger); // Keyed by the request itself: a parent that renders again passes a new // target object for the same prompt. @@ -45,6 +53,7 @@ void hub.loadOpeners(); const agents = computed(() => prefs.shown(hub.openers ?? []).filter((o) => o.prompt)); async function copy() { + menu.close(); if (!text.value) return; try { await navigator.clipboard.writeText(text.value); @@ -55,6 +64,7 @@ async function copy() { } async function start(o: Opener) { + menu.close(); starting.value = o.id; try { await act({ @@ -73,7 +83,41 @@ async function start(o: Opener) {