Skip to content

fix(self-host): show "Check rankings" action for self-hosted instances - #201

Open
gortazar wants to merge 1 commit into
every-app:mainfrom
gortazar:fix-self-hosted-actions
Open

fix(self-host): show "Check rankings" action for self-hosted instances#201
gortazar wants to merge 1 commit into
every-app:mainfrom
gortazar:fix-self-hosted-actions

Conversation

@gortazar

@gortazar gortazar commented Aug 8, 2026

Copy link
Copy Markdown

Summary

  • RankTrackingDomainDetail.tsx 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.tsx's 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 server-side — they just had no UI path to reach the action.
  • Switches 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.

Test plan

  • pnpm run types:check — clean.
  • pnpm run lint — clean, 0 warnings/errors.
  • Verified against a real self-hosted Docker instance: built a local image from this branch, recreated the running container in place (existing D1 data preserved), confirmed the "Check rankings" menu item now appears, and triggered a real manual check that completed successfully with live SERP positions returned.

🤖 Generated with Claude Code

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.
Copilot AI lite review requested due to automatic review settings August 8, 2026 23:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-js customer/session plan detection with HostedPlanGate to correctly treat self-hosted as non-free for gating purposes.
  • Refactors the component into a small wrapper (RankTrackingDomainDetail) plus an inner implementation (RankTrackingDomainDetailInner) that consumes HostedPlanGateState.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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