Skip to content

Align routine pause polarity on list and detail (CL-6756) - #597

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-6756-routines-pause-polarity-is-inverted-and-run-now-has-no
Sep 4, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-6756-routines-pause-polarity-is-inverted-and-run-now-has-no

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

Detail always mounted Run now and Pause/Resume together, and the list switch was labeled Pause while checked. Off and dead-lettered (health.state === "paused") now match the list: Resume only. Active routines keep Run now + Pause. The switch is named On/Off, not Pause-while-checked. setEnabled polarity is unchanged. Run now already uses RunNowButton, which shows Starting… while the POST is in flight.

Fixes CL-6756

Changes

  • Detail: if !enabled or health.state === "paused", show Resume only; otherwise Run now + Pause
  • List switch aria-label is On/Off + name; checked={enabled} and onCheckedChange are unchanged
  • Tests: detail hides Run now when off or dead-lettered; pending while the start promise is unsettled; switch naming

Test plan

  • cd apps/web && bun test ./test/routine-detail-page.test.tsx ./test/routines-page.test.tsx — 66 pass, 0 fail (exit 0)
  • bun run typecheck — exit 0
  • bun run lint — prettier clean; eslint 0 errors / 10 pre-existing warnings
  • bun run check:structural — ok
  • Full bun run check / bun run test fail in scripts/db-setup.test.ts with PostgresError: password authentication failed for user "thegreataxios" (pre-existing local DATABASE_URL, unrelated)

@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Self-review

Verified the detail page's Run now/Pause vs Resume-only branching against the list page's existing routineHealth-based logic (routines-page.tsx:360) and confirmed they now match; ran the targeted suite and typecheck clean. No defects found — ready as is.

  • Detail page action-slot branching mirrors the list page's pre-existing !enabled || health.state === "paused" check, both sourced from @corbits/routines/client — DISMISSED (consistent, no app-level logic duplication of a package rule)
  • Switch aria-label changed from Pause/Resume to On/Off while checked/onCheckedChange polarity is untouched — DISMISSED (matches PR intent, verified against source)
  • RunNowButton's pending "Starting…" state — DISMISSED (pre-existing in @corbits/react-ui, not reimplemented here)
  • No catch clauses, as T casts, or secrets touched by this diff — DISMISSED

Tests run: cd apps/web && bun test ./test/routine-detail-page.test.tsx ./test/routines-page.test.tsx — 66 pass, 0 fail. bun run typecheck — exit 0.

@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown

CL-6756

@TheGreatAxios
TheGreatAxios merged commit 6c94bc6 into main Sep 4, 2026
7 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.

1 participant