Return to recurring runs after canceling creation#13379
Conversation
Signed-off-by: Jeff Spahr <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR adds a returnTo query parameter to preserve navigation context when launching recurring-run creation from the recurring runs list, so that canceling creation can return the user to /recurringruns instead of always falling back to /runs.
Changes:
- Add
QUERY_PARAMS.returnToplus agetSafeReturnPathhelper to validate same-app return targets. - Populate
returnTo=/recurringrunswhen creating a recurring run from the recurring runs list, and use it on Cancel inNewRunV2. - Add/adjust UI tests to cover the new return-path behavior and validation helper.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/pages/NewRunV2.tsx | Use validated returnTo to decide where Cancel navigates. |
| frontend/src/pages/NewRunV2.test.tsx | Add test asserting cancel navigates to a safe returnTo path. |
| frontend/src/pages/AllRecurringRunsList.test.tsx | Ensure recurring-run creation includes returnTo=/recurringruns. |
| frontend/src/lib/Buttons.ts | Add returnTo when launching recurring-run creation from /recurringruns. |
| frontend/src/components/Router.tsx | Introduce QUERY_PARAMS.returnTo and getSafeReturnPath. |
| frontend/src/components/Router.test.tsx | Add unit test for getSafeReturnPath acceptance/rejection. |
Signed-off-by: Jeff Spahr <[email protected]>
|
/ok-to-test |
Summary
#/recurringrunswhen canceling recurring-run creation launched from the all recurring-runs page.returnToquery parameter for the recurring-runs entrypoint and validate it as a same-app path before using it./runsfallback for new-run pages without a safe return target.Validation
npm --prefix frontend run test:ui -- AllRecurringRunsList.test.tsx NewRunV2.test.tsx Router.test.tsxnpm --prefix frontend run lintnpm --prefix frontend run typechecknpx --prefix frontend prettier --check frontend/src/components/Router.tsx frontend/src/components/Router.test.tsx frontend/src/lib/Buttons.ts frontend/src/pages/AllRecurringRunsList.test.tsx frontend/src/pages/NewRunV2.tsx frontend/src/pages/NewRunV2.test.tsxgit diff --check