Skip to content

Add "Change to…" for goal and time loops on the canvas - #495

Merged
coneilen merged 1 commit into
mainfrom
feat/retype-ui
Sep 28, 2026
Merged

coneilen merged 1 commit into
mainfrom
feat/retype-ui

Conversation

@scgopi

@scgopi scgopi commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Summary

The canvas half of #492: goal and time loops can switch types from the app, not just the CLI.

  • Right-click a goal loop → Change to Timed…; right-click a time loop → Change to Goal…. Turn, composite and stopped loops get no entry (the daemon refuses those).
  • Both open the existing promotion form, titled "Change to …" with a "Change" button and a subtitle saying what stops ("stops working toward its goal" / "stops its cadence").
  • Goal → Timed adds one field, What should each pass do? A goal loop has no note to repeat and its goal is withdrawn, so the form stays disabled until it's filled; the /loop preview shows the composed line.
  • Confirming sends the same promoteNode that graphcode node promote does, so there's no daemon change.
  • retypeTarget moves from GraphStore onto LoopType, so the app's menu and the daemon's guard read the same rule.

Rendered headlessly (NSHostingView) and checked: the empty goal → timed form shows the hint and a disabled Change button, the filled one previews /loop 1h check the flake hasn't come back, and time → goal shows the done-check field.

Test plan

RED: xcodebuild test -only-testing:graphcodeTests/LoopRetypeFormTests with origin/main's app and Domain sources -> compile fails, no member retypeTarget / promotionTask / promotionSource (exit 65)
GREEN: xcodebuild test -only-testing:graphcodeTests/LoopRetypeFormTests,SketchPromotionTests,LoopRetypeTests -> 26 tests in 3 suites passed (exit 0)
REGRESSION: xcodebuild -scheme graphcode test with private DerivedData -> 1990 tests in 212 suites passed (exit 0); graphcode-cli and graphcoded build (exit 0); swiftlint 0 errors; swift format lint clean; portable Domain package builds

Right-clicking a goal loop now offers "Change to Timed…", and a time
loop "Change to Goal…", opening the promotion form for the other type.
A goal loop turning time-based is asked what each pass should do, since
it has no note to repeat and its goal is withdrawn. Confirming sends the
same promoteNode the CLI's `node promote` does. Stopped loops get no
entry, matching the daemon's refusal.

`retypeTarget` moves onto `LoopType` so the app and the daemon read one
rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scgopi <scgopireddy@gmail.com>
@coneilen
coneilen merged commit 6c983a2 into main Sep 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants