Skip to content

Add routine target editing to the routine panel (CL-7358) - #559

Draft
TheGreatAxios wants to merge 4 commits into
cl-7357-routine-entryfrom
cl-7358-target-edit
Draft

Add routine target editing to the routine panel (CL-7358)#559
TheGreatAxios wants to merge 4 commits into
cl-7357-routine-entryfrom
cl-7358-target-edit

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Editing an existing routine now reuses DefinitionTargetPicker (the same component create mode uses) instead of a read-only target display — no more duplicated target-display logic between modes.
  • Picking a new target on an existing routine fires a target-only PATCH ({ definitionAssetId }) through the panel's existing autosave queue; a server rejection (404/409/403 from routineTargetRejection) reverts the picker to the last-saved target and shows the error through the panel's existing inline error path, without discarding other unsaved input.
  • The picker now reports staleness via a new onStaleChange prop; the panel uses it to disable "Run now" until the routine's target is valid.
  • Exposes definitionAssetId on the browser-safe UpdateRoutineInput client type in packages/routines/src/client.ts — the server already accepted it.

Linear: https://linear.app/abklabs/issue/CL-7358

Test plan

  • bunx tsc --noEmit -p apps/web
  • bun test apps/web/test/routine-panel.test.tsx (run from apps/web so bunfig.toml's DOM preload applies) — 27 pass
  • bunx eslint apps/web/src/shell — clean

Resolves CL-7358

Reuse DefinitionTargetPicker for edit mode instead of a read-only
display, so create and edit never duplicate target-display logic.
Picking a new target on an existing routine fires a target-only PATCH
through the panel's autosave queue; a server rejection reverts the
picker to the last-saved target and surfaces through the existing
inline error path without touching other unsaved fields. The picker
now reports staleness via onStaleChange so the panel can disable
Run now when the current target is no longer available.

Also exposes definitionAssetId on the browser-safe UpdateRoutineInput
client type — the server (packages/routines/src/store.ts) already
accepted it.
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