Skip to content

feat(kilo-app): deep linking for existing web URLs#1935

Open
iscekic wants to merge 6 commits intomainfrom
feature/deep-linking
Open

feat(kilo-app): deep linking for existing web URLs#1935
iscekic wants to merge 6 commits intomainfrom
feature/deep-linking

Conversation

@iscekic
Copy link
Copy Markdown
Contributor

@iscekic iscekic commented Apr 2, 2026

Summary

  • Configure iOS universal links (associatedDomains) and Android App Links (intentFilters) for app.kilo.ai
  • Add +native-intent.ts to rewrite incoming web URLs to internal app routes
  • Map /claw → instance list, /profile → profile screen
  • Handle org-scoped URLs (/organizations/[orgId]/claw, /organizations/[orgId]) with automatic context switching

Prerequisites for universal links to work

  • iOS: Host an apple-app-site-association file at https://app.kilo.ai/.well-known/apple-app-site-association
  • Android: Host an assetlinks.json file at https://app.kilo.ai/.well-known/assetlinks.json
  • Requires a new native build (EAS Build) to pick up the config changes

Deep link mapping (existing web URLs only)

Web URL App Screen
/claw Instance list (personal)
/organizations/[orgId]/claw Instance list (org context)
/profile Profile
/organizations/[orgId] Profile (org context)

Test plan

  • Build dev client with new config
  • Test npx uri-scheme open "https://app.kilo.ai/claw" --ios opens instance list
  • Test npx uri-scheme open "https://app.kilo.ai/profile" --ios opens profile
  • Test org-scoped URLs switch context and navigate correctly
  • Test unrecognized URLs fall through to default behavior
  • Verify Android intent filters work with adb shell am start

Configure universal links (iOS) and Android App Links for app.kilo.ai.
Map /claw, /profile, and /organizations/[orgId]/... web URLs to the
corresponding mobile app screens via +native-intent URL rewriting.
@iscekic iscekic self-assigned this Apr 2, 2026
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot bot commented Apr 2, 2026

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

WARNING

File Line Issue
kilo-app/src/lib/hooks/use-deep-link.ts 27 Personal deep links never reset org context, so /claw and /profile can keep the previously selected organization instead of opening the personal page.
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
kilo-app/app.config.js 58 Android App Links still claim deeper /organizations/.../claw URLs because pathPattern: '/organizations/.*/claw' lets .* span multiple path segments, while the router only handles a single org id segment.
Files Reviewed (2 files)
  • kilo-app/src/lib/deep-link.ts - 0 issues
  • kilo-app/src/lib/hooks/use-deep-link.ts - 1 issue

Reviewed by gpt-5.4-20260305 · 183,174 tokens

Host apple-app-site-association and assetlinks.json under
public/.well-known/ so iOS and Android can verify app ownership
for deep linking from app.kilo.ai URLs.
@iscekic iscekic requested a review from jeanduplessis April 2, 2026 17:44
- Narrow Android intent filters: replace broad /organizations pathPrefix
  with specific pathPattern for /organizations/*/claw only
- AASA: add explicit exclude for /organizations/*/* to prevent claiming
  unsupported org sub-pages
- Make useDeepLink reactive: subscribe to deep link events so org-scoped
  links arriving while the app is already open are handled correctly
Only store pending link when no listener is active (cold start).
When a listener handles it directly (warm start), skip storage
so consumePendingDeepLink() won't replay it on layout remount.
@iscekic iscekic enabled auto-merge (squash) April 2, 2026 19:02
@iscekic iscekic disabled auto-merge April 2, 2026 19:04
iscekic added 2 commits April 2, 2026 21:07
Call organizations.list to verify the user belongs to the target org
before switching context. Shows a toast and stays on the current screen
if access is denied or the request fails.
Store all recognised deep link targets (not just org-scoped ones) as
pending so the app can navigate there after login completes. Previously,
non-org links like /claw were rewritten directly but lost if the user
wasn't authenticated and got redirected to login first.
(link: PendingDeepLink) => {
const navigate = async () => {
try {
if (link.organizationId) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: Personal deep links never reset org context

link.organizationId is the only branch that calls setContext, so /claw and /profile now reuse whatever organization context was already active. If someone is currently scoped to an org and opens https://app.kilo.ai/claw or https://app.kilo.ai/profile, this code navigates to the screen but leaves that org selected, so they never reach the personal page those URLs represent.

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