Add stale-pending-task detection - #95
Merged
Merged
Conversation
A pending task untouched (per git blame) longer than a configurable threshold (default 14 days) is now flagged in the Change Timeline view -- a warning marker distinct from a normal "pending" task, not a notification. Reuses the existing blame computation entirely (no new git calls): ChangeTimelineTask gains lastTouchedDate, always populated regardless of done state, distinct from the completion-only `date` field. isTaskStale/findStaleTasks are pure date-math functions shared by both delivery targets: a "Stale after (days)" input in the standalone Timeline tab, and a new openspec-ui.staleTaskThresholdDays VS Code setting. Also re-points change-timeline-client.ts at core's real browser-safe types instead of a hand-duplicated copy, which had already drifted out of sync once before this change. Verified against the real CSP shape TimelineWebviewPanel actually uses (learned from the prior CSP bug), not a bare unrestricted page. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ChangeTimelineTask.lastTouchedDateis always populated (done or not), distinct from the completion-onlydatefield (kept deliberately restricted to checked tasks in the prior change, to avoid misreading as a completion date).isTaskStale/findStaleTasks(packages/core/src/stale-tasks.ts) are pure date-math, shared by both hosts: a "Stale after (days)" input in the standalone Timeline tab, and a newopenspec-ui.staleTaskThresholdDaysVS Code setting.change-timeline-client.tsat core's real@openspec-ui/core/browsertypes instead of a hand-duplicated copy — the duplicate had already drifted out of sync once (missed this exact new field) before this change stopped it for good.@openspec-ui/core0.27.0 -> 0.28.0,@openspec-ui/webui1.13.0 -> 1.14.0,openspec-ui-vscode0.24.1 -> 0.25.0 (all minor).Verification note
Learned from the prior CSP bug (#94): manually verified against the real CSP shape
TimelineWebviewPanel.getHtml()actually produces (same nonce, same dual-global embedding), not a bare unrestricted page — a synthetic genuinely-stale task and a fresh pending task both rendered correctly with zero console errors.Test plan
stale-tasks.test.ts(new),change-timeline.test.tsupdated forlastTouchedDateChangeTimelineView.test.tsx: stale/fresh rendering with a deterministicnowtimeline-panel.test.tsandcommands.test.tsupdated for the new parameter/setting, including a dedicated test asserting the VS Code setting is actually readnpm run typecheck,npm run lint(includinglint:english),npm run testworkspace-widenpm run package --workspace openspec-ui-vscode— VSIX packages without erroropenspec change validate --strict add-stale-task-detection🤖 Generated with Claude Code