* Move Konnect projects into a global Control Planes organization
* fix: break new circular dependency in Konnect organization utils
useKonnectOrganization() imported useRootLoaderData from ~/root to read
accountId, but organization-utils.ts is itself reached from root.tsx via
the settings modal chain, closing a new import cycle flagged by CI's
dependency-cruiser check. Pass accountId in from the caller
(useOrganizations), which already has it, instead.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Konnect moved onboarding nudge.
* Can sync when the konnect org is empty.
* fix: guard two develop-introduced hooks against the Konnect organization
use-organization-storage-rule.ts and use-remote-files.ts's
useRemoteBackendProjects were added by develop's account-data refactor
after this plan's original API-guard audit, and both issued real
network/IPC calls for the local-only Konnect organization:
- useOrganizationStorageRule called the raw API directly and only
checked isScratchpadOrganizationId, missing Konnect. Fixed by
delegating to fetchAndCacheOrganizationStorageRule (which already
returns the correct local-only rules with no network call) instead
of gating with `enabled`, since a naive gate would fall back to the
permissive DEFAULT_STORAGE_RULES and surface Cloud Sync/Git Sync
inside Control Planes.
- useRemoteBackendProjects had no organization guard at all, firing
window.main.sync.remoteBackendProjectsOfTeam for an org whose
projects never have a remoteId. Fixed with an isLocalOrganizationId
check on its `enabled` gate.
Re-audited every other organizationId-scoped API guard in the plan;
no further gaps found. Plan doc updated with both findings.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix: disable Connect & Sync in Konnect settings modal without entitlement
The modal let a user validate and store a PAT even when the account
lacks the Konnect control-planes entitlement, even though syncing
could never run in that state — the sidebar's Sync button was already
disabled here but the modal's own Connect & Sync button was not.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix: re-fetch Konnect entitlements after logging back into the same account
refreshKonnectAccess deduped by accountId, but signing in never
reloads the renderer, so its module-level guard survives a logout —
and a fresh login into the same account keeps the same accountId,
silently skipping the re-fetch of /v1/user/entitlements.
Key the guard on sessionId instead: a new login always mints a new
session token even for the same account, so this still dedupes the
normal cold-start case (startup call and post-login loader share one
session) while correctly re-resolving after logout/login.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix: navigate away when the Konnect organization becomes invisible
Deleting a user's last Konnect project (one at a time via the project
delete action, or in bulk via Disconnect) could leave them stranded on
a URL for an organization that no longer appears in the dropdown, with
no automatic navigation elsewhere.
Add getKonnectOrganizationEscapeRoute(organizationId), which re-checks
visibility with a fresh local project count (no network call — only
that half can change from a plain NeDB delete) combined with the
last-resolved entitlement, updates the shared access store so
useOrganizations() reflects it immediately, and returns the account's
first real organization to redirect to when the org just went dark.
Call it from both places that can remove the last Konnect project:
- organization.$organizationId._index.tsx's loader, which every
"no reachable project" fallback already redirects through
- organization.$organizationId.project.$projectId.delete.tsx's
action, which previously short-circuited straight back into the
same (now invisible) organization instead of going through that
loader
Extracted the shared "recompute + store update" logic into
reconcileKonnectAccess() to avoid duplicating it between
refreshKonnectAccess() and the new escape-route check.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Migrate after login
* Force fetch storage rule
* Replace Konnect sync module-var trigger with event bus
Swaps the register/run module variable in konnect-sync-trigger.ts for
uiEventBus so the sync callback is subscribed/unsubscribed via useEffect
instead of being reassigned on every render with no cleanup.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Remove plan
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* feat: record enterprise-plan actions for request/document creation
* chore: address copilot feedback
* feat: adds enterprise plan type guard
* chore: formatting
* refactor: clean up
* chore: use proper types
* refactor: clean up
* chore: clean up
* Create new methods colors
* Implement first request logic
* feat: enhance first request treatment logic with backend support and caching
* feat: add experiment assignment analytics and related utility functions
* feat: add reportRequestsCreated function to track request creation for first-request experiments
* feat: enhance request creation reporting with session tracking
* feat: add tests for reportRequestsCreated function to validate API interactions
* feat: refactor localStorage methods for better error handling and state management
* feat: enhance accessibility of error message in FirstRequestCreation component
* feat: simplify user ownership check in project component
* feat: update user tests to include onboarding state and related functions
* feat: replace reportRequestCreated function with maybeLatchRequestThreshold for request tracking
* feat: integrate onboarding state into first request treatment logic and refactor related functions
* feat: integrate onboarding state into FirstRequestCreation component and enhance treatment logic
* feat: implement maybeLatchRequestThreshold function for tracking first-request graduation
* feat: refactor onboarding request handling and replace reportRequestsCreated with latchRequestThresholdReached
* feat: simplify first request treatment logic and remove unused functions
* feat: update latchRequestThresholdReached to use PATCH method for idempotent threshold latch
* feat: update onboarding state interface and test to use reached_request_threshold instead of has_reached_request_threshold
* feat: update latchRequestThresholdReached to use PUT method and correct endpoint for idempotent threshold latch
* feat: remove reached_request_threshold from onboarding state and related tests
* feat: integrate request tracking with maybeLatchRequestThreshold in clientAction
* feat: update onboarding state handling and treatment logic in user module
* feat: update @getinsomnia/insomnia-v3-fetch to version 1.0.20 in package-lock and package.json
* feat: add padding to request URL bar and adjust MethodSelector alignment
* feat: enhance request threshold handling by adding per-account request count baseline
* feat: update analytics event emission for treatment assignments in first request flow