Skip to content

Studio schedules: detail refresh, focus and shortcut fixes #2300

Closed as duplicate

Description

@kantord

Parent: #2210. Follow-up to #2194, from its second review.

Outcome

Correctness and accessibility details on the schedule detail page and the inventory that #2194 left for later. None blocks use today.

Behavior

  • Run now leaves history stale. runAction in schedules-workspace.tsx no longer invalidates the fires query, so reopening the detail within the 30s staleTime shows history without the new fire.
  • Delete flashes "not found". The detail page awaits the list invalidation before navigate, so DetailState (role="alert") renders for a moment and screen readers announce an error after a successful delete. Navigate first, or drop the item from the cache instead of refetching.
  • Run limit is invisible before the first fire. describeRuns returns "None yet" and drops maxFires, and the form no longer shows it, so a cron created with maxFires=10 never says it will stop.

Focus and keyboard

  • Focus after Edit from a row menu. openEditor saves document.activeElement, which is the menu item and is gone once the menu closes, so focus lands on <body>. Pass the trigger, as openDelete does. The detail page's edit dialog doesn't restore focus at all.
  • / while a dialog is open. Without useShortcutSuppression, / inside the Schedule or Edit dialog jumps to the search behind the modal. It is also swallowed in the loading and empty states where there is no search box.

Code

  • Duplicate relative-time formatting. formatSpan, describeNextRun and describeLastRun in schedule-detail.tsx re-implement formatUntilTime and formatRelativeTime from lib/formatters.ts.
  • Cron parsing in hot paths. describeCron runs inside the sort comparator (schedule-inventory.ts), and filtering runs twice per change (desktop and mobile). Compute the labels once per list, filter once, then sort. refactor(studio): describe cron schedules with cronstrue #2285 removed the cron parse from the comparator and memoizes describeCron; the double filtering remains.
  • Outcome mapping location. The fire outcome mapping from session.StopReason lives in the web app (fireOutcome in schedule-detail.tsx). Reviewers preferred the BFF so every client reads the same vocabulary.

Not included

The detail page does not poll while a schedule is merely scheduled, so "in 30m" and a newly fired run can go stale until the window regains focus. Judged low value, since the page is mostly static configuration and the inventory polls every 5s.

Fully or partially written by an AI agent.

Activity

  1. kantord commented on Oct 14, 2026

    @kantord
    MemberAuthor

    Merged into #2303: all items were copied there (section C). Closing as a duplicate. Fully or partially written by an AI agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions