fix(self-host): show "Check rankings" action for self-hosted instances - #201
Open
gortazar wants to merge 1 commit into
Open
fix(self-host): show "Check rankings" action for self-hosted instances#201gortazar wants to merge 1 commit into
gortazar wants to merge 1 commit into
Conversation
RankTrackingDomainDetail computed isFreePlan by calling autumn-js's useCustomer() directly, with no awareness of self-hosted/local_noauth mode. Since self-hosted instances have no billing customer, this always resolved to "free plan", and ToolbarMenus' MoreMenu doesn't just disable the "Check rankings" item when checkDisabled is true — it omits it from the DOM entirely. So the action to manually trigger a rank check was invisible on every self-hosted instance. The server-side triggerRankTrackingCheck function already exempts self-hosted mode from this same plan check (`isHosted && !hasPaidPlan`), so self-hosted users could already run checks — they just had no way to reach the action. Switch to HostedPlanGate, the render-prop component two other pages (PromptExplorerPage, BrandLookupPage) already use for this exact purpose: it short-circuits to isFreePlan: false without touching Autumn at all when isHostedClientAuthMode() is false, and only defers to the real billing check in hosted mode. Verified with `pnpm run types:check` and `pnpm run lint` (both clean), and against a real self-hosted Docker instance: rebuilt the image from this branch, recreated the running container in place (existing D1 data untouched), and confirmed the "Check rankings" menu item now appears.
There was a problem hiding this comment.
Pull request overview
Fixes a self-hosted UI regression where the “Check rankings” action was hidden because the page incorrectly inferred a “free plan” when no billing customer exists in local_noauth / self-hosted mode.
Changes:
- Replaces direct
autumn-jscustomer/session plan detection withHostedPlanGateto correctly treat self-hosted as non-free for gating purposes. - Refactors the component into a small wrapper (
RankTrackingDomainDetail) plus an inner implementation (RankTrackingDomainDetailInner) that consumesHostedPlanGateState.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RankTrackingDomainDetail.tsxcomputedisFreePlanby callingautumn-js'suseCustomer()directly, with no awareness of self-hosted/local_noauthmode. Since self-hosted instances have no billing customer, this always resolved to "free plan" — andToolbarMenus.tsx'sMoreMenudoesn't just disable the "Check rankings" item whencheckDisabledis true, it omits it from the DOM entirely. So the action to manually trigger a rank check was invisible on every self-hosted instance.triggerRankTrackingCheckfunction already exempts self-hosted mode from this same plan check (isHosted && !hasPaidPlan), so self-hosted users could already run checks server-side — they just had no UI path to reach the action.HostedPlanGate, the render-prop component two other pages (PromptExplorerPage,BrandLookupPage) already use for this exact purpose: it short-circuits toisFreePlan: falsewithout touching Autumn at all whenisHostedClientAuthMode()is false, and only defers to the real billing check in hosted mode.Test plan
pnpm run types:check— clean.pnpm run lint— clean, 0 warnings/errors.🤖 Generated with Claude Code