Repository navigation
fix(studio): refresh schedule history after actions and tidy the detail page - #2315
Merged
Merged
Conversation
peppescg
requested changes
Oct 15, 2026
peppescg
left a comment
Contributor
There was a problem hiding this comment.
Thanks Daniel. The Run now invalidation, the run-limit hint and the formatter dedup look right, and the filter-once refactor makes the two layouts much easier to follow.
Before merge
- Delete can still flash "not found" (
apps/web/src/features/schedules/schedule-detail.tsx:159-170).setQueryDataremoves the schedule from the list query while the detail page is still mounted and subscribed to it, so its next render hits!scheduleand shows the "Scheduled task not found"role="alert"state, which is what the comment says this prevents. It usually doesn't show only because the router tends to commit before Query's batched notify.removeQuerieson the fires key has a related problem: the key still has a mounted observer, so the next render can rebuild it and fire aGET /firesfor the schedule you just deleted.await navigate({ to: "/workspace/schedules" })first, then do the cache cleanup. - The test can't see the flash (
apps/web/src/features/schedules/schedules-workspace.test.tsx:324).queryByRole("alert")runs after the path has changed, when the detail page is already unmounted, so it passes either way. Watch for the alert while navigation is still pending (aMutationObserverattached before confirming, or a router stub whose navigation never resolves) and assert it never appears.
Nits:
- The detail page's Run now
try/finally(schedule-detail.tsx:136) has no test. A rejectedfirethat still refetches the detail page's fires would cover it, like the workspace test does.
kantord
force-pushed
the
studio-followups/05-schedules-refresh
branch
3 times, most recently
from
October 15, 2026 09:26
777b2b8 to
f27f09d
Compare
…il page Run now (list and detail) invalidates the fires query even when the fire fails, since a failed fire still records a row. Deleting from the detail page drops the item from the cache and navigates before the list refetch, so "not found" no longer flashes. The run limit shows before the first fire, relative times reuse the shared formatters, and the inventory filters once for both layouts. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
kantord
force-pushed
the
studio-followups/05-schedules-refresh
branch
from
October 15, 2026 09:29
f27f09d to
49c68dc
Compare
Addresses the review on #2315: - Delete now awaits the navigation first, then drops the item from the list cache and removes its fires query, so no mounted observer re-renders into "not found" or refires GET /fires for the deleted task. - The delete test holds the navigation and watches for the alert with a MutationObserver, and asserts no fires request follows the delete. - Add a detail-page test that a rejected Run now still refetches fires. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Member
Author
|
Thanks Giuseppe. Addressed in 3712413.
Checked on top of the current head: Biome, typecheck, the full Studio test suite and Fully or partially written by an AI agent. |
peppescg
approved these changes
Oct 15, 2026
Merged
2 tasks
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
Run now left the run history stale, deleting from the detail page waited for the list refetch before leaving, and a few schedule details were inconsistent or duplicated.
Part of #2303 ("Tiny follow-up fixes"); it does not close it. This is PR 5 of 14 in a stack of draft PRs, reviewed and merged in order.
What changed
finally, and invalidates the schedule's fires query forfire, even when the fire fails (a failed fire still records a row).describeRunsshows "None yet · up to N" when a run limit exists.describeNextRunanddescribeLastRunreuseformatUntilTimeandformatRelativeTime;formatSpanand thenowparameters are removed. The shared formatters are unchanged ("<1m ago" matches the design).filterScheduleInventoryis exported; the workspace filters once and derives both layouts from the result.Behavior changes
Reopening the detail after Run now shows the new fire. Deleting from the detail page navigates immediately instead of waiting for the list refetch. The run limit is visible before the first fire.
Screenshots
Before is the parent branch (#2314), after is this PR, with the same scenario code and offline mock data.
Runs reads "None yet" with no hint that a limit exists.
Runs reads "None yet · up to 5".
Still on the deleted schedule's detail page, waiting for the list refetch.
Already back on the list, with no alert.
Run history lacks the new run (the cached history is stale).
The new failed run is on top.
Note on the delete case: the "not found" alert described in the review did not reproduce in a browser (checked with a DOM mutation observer and 20x CPU throttling). The visible difference is the wait: before, the page stays on the detail until the list refetch finishes; after, it navigates immediately.
Verification
Biome, typecheck, the full Studio test suite and
pnpm generated:checkpass on this branch, run on the assembled stack. The full Playwright suite passes on the stack tip (122 passed, 30 skipped, 0 failed, includingchat-approvalagainst a realmecatedbuild). The Run now, failed-fire, delete-flash and run-limit tests fail without the fix. The pause, rejected-delete, fake-timer and filter-both-layouts tests also pass on the old code, so they are regression guards. The detail page's own Run nowtry/finallyhas no test of its own.Not included
Focus and shortcut fixes (next PR) and the BFF outcome (after that).
Fully or partially written by an AI agent.
🤖 Generated with Claude Code