Skip to content

fix(web): return to Cloud Agent setup from integration detail - #5388

Merged
eshurakov merged 1 commit into
Kilo-Org:mainfrom
IamCoder18:fix/cloud-agent-integration-return-to
Aug 20, 2026
Merged

fix(web): return to Cloud Agent setup from integration detail#5388
eshurakov merged 1 commit into
Kilo-Org:mainfrom
IamCoder18:fix/cloud-agent-integration-return-to

Conversation

@IamCoder18

@IamCoder18 IamCoder18 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

When Cloud Agent onboarding shows the "Connect a repository provider" panel (e.g. after a user lands on /cloud without a connected repo), picking GitHub/GitLab/Bitbucket drops the user on the integration detail page whose Back link is hard-coded to /integrations. The user lands somewhere they did not intend instead of returning to the Cloud Agent setup flow.

Two pieces conspired:

  • RepositoryProviderOnboardingPanel built provider links as plain /integrations/<platform> with no returnTo query param.
  • UserIntegrationDetailPage in IntegrationDetailPage.tsx ignored returnTo entirely; only the organization variant of the same page already honored it.

This change passes a returnTo path through the onboarding panel (/cloud for personal, /organizations/<id>/cloud for org) and updates the user variant of the integration detail page to validate and use it, mirroring the organization variant. The validated returnTo is also threaded into the rendered detail component's search params so downstream branches (e.g. GitHubIntegrationDetails' appReturnPath) keep working for the OAuth round-trip.

Files touched:

  • apps/web/src/components/cloud-agent-next/RepositoryProviderOnboardingPanel.tsx
  • apps/web/src/components/cloud-agent-next/NewSessionPanel.tsx
  • apps/web/src/components/integrations/IntegrationDetailPage.tsx

Verification

  • Manually walk through: visit /cloud without a connected repo -> pick GitHub -> click "Back". Confirm it now returns to /cloud instead of /integrations. Repeat for /organizations/<id>/cloud.

Local checks run:

  • oxlint on the three changed files: 0 warnings, 0 errors.
  • tsgo --noEmit (apps/web): clean.

Visual Changes

image

Reviewer Notes

  • withReturnTo is a small inline helper to append returnTo without breaking callers that already had query strings; today only the generated integration hrefs use it, but the helper is defensive.
  • validateReturnPath already rejects non-/ paths, unsafe characters, and double-slash tricks, so the Back href is constrained the same way as the organization variant.
  • The pre-existing GitHubIntegrationDetails appReturnPath plumbing was already returnTo-aware but the page never set it; that gap is closed here.

When Cloud Agent onboarding showed the 'Connect a repository provider'
panel, picking GitHub/GitLab/Bitbucket dropped the user on the
integration detail page with a hard-coded 'Back to Integrations' link
to /integrations, losing the original context.

Pass a returnTo path through the onboarding panel so the user variant
of the integration detail page (UserIntegrationDetailPage) can mirror
the existing organization variant: validate the returnTo and render
'Return to setup' when present, falling back to '/integrations'.
@kilo-code-bot

kilo-code-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

User integration detail now validates returnTo the same way as the org variant, with Cloud Agent onboarding passing /cloud or /organizations/<id>/cloud so Back returns to setup.

Files Reviewed (3 files)
  • apps/web/src/components/cloud-agent-next/NewSessionPanel.tsx
  • apps/web/src/components/cloud-agent-next/RepositoryProviderOnboardingPanel.tsx
  • apps/web/src/components/integrations/IntegrationDetailPage.tsx

Reviewed by grok-4.6 · Input: 363K · Output: 25K · Cached: 446.1K

Review guidance: REVIEW.md from base branch main

@eshurakov
eshurakov self-requested a review August 20, 2026 11:59
@eshurakov eshurakov self-assigned this Aug 20, 2026
@IamCoder18

Copy link
Copy Markdown
Contributor Author

All checks pass

@eshurakov
eshurakov merged commit d42ae07 into Kilo-Org:main Aug 20, 2026
31 of 33 checks passed
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.

2 participants