Skip to content

Return to recurring runs after canceling creation#13379

Open
jeffspahr wants to merge 2 commits into
kubeflow:masterfrom
jeffspahr:codex/fix-recurring-run-cancel
Open

Return to recurring runs after canceling creation#13379
jeffspahr wants to merge 2 commits into
kubeflow:masterfrom
jeffspahr:codex/fix-recurring-run-cancel

Conversation

@jeffspahr
Copy link
Copy Markdown
Contributor

Summary

  • Return users to #/recurringruns when canceling recurring-run creation launched from the all recurring-runs page.
  • Add a returnTo query parameter for the recurring-runs entrypoint and validate it as a same-app path before using it.
  • Keep the existing /runs fallback for new-run pages without a safe return target.

Validation

  • npm --prefix frontend run test:ui -- AllRecurringRunsList.test.tsx NewRunV2.test.tsx Router.test.tsx
  • npm --prefix frontend run lint
  • npm --prefix frontend run typecheck
  • npx --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.tsx
  • git diff --check

Signed-off-by: Jeff Spahr <spahrj@gmail.com>
Copilot AI review requested due to automatic review settings May 10, 2026 11:40
@google-oss-prow
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from jeffspahr. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.returnTo plus a getSafeReturnPath helper to validate same-app return targets.
  • Populate returnTo=/recurringruns when creating a recurring run from the recurring runs list, and use it on Cancel in NewRunV2.
  • 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.

Comment thread frontend/src/lib/Buttons.ts
Signed-off-by: Jeff Spahr <spahrj@gmail.com>
@jeffspahr
Copy link
Copy Markdown
Contributor Author

/ok-to-test

@github-actions github-actions Bot added the ci-passed All CI tests on a pull request have passed label May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-passed All CI tests on a pull request have passed ok-to-test size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants