Skip to content

Comments

fix: default kiloclaw feature flag to true when PostHog is blocked#502

Open
kiloconnect[bot] wants to merge 1 commit intomainfrom
session/agent_b3e8790c-7094-4b12-bf18-f3f3cfce8827
Open

fix: default kiloclaw feature flag to true when PostHog is blocked#502
kiloconnect[bot] wants to merge 1 commit intomainfrom
session/agent_b3e8790c-7094-4b12-bf18-f3f3cfce8827

Conversation

@kiloconnect
Copy link
Contributor

@kiloconnect kiloconnect bot commented Feb 24, 2026

Problem

Ad blockers block posthog-js in the browser, so useFeatureFlagEnabled('kiloclaw') returns undefined (falsy) — the "Claw" sidebar link disappears for users with ad blockers.

Fix

Use nullish coalescing (?? true) on the client-side useFeatureFlagEnabled('kiloclaw') call so that when PostHog fails to load or returns undefined (ad blocker scenario), the flag defaults to true instead of being treated as false.

  • true from PostHog → stays true
  • false from PostHog → stays false
  • undefined (PostHog blocked) → defaults to true

The server-side flag check in the tRPC router (kiloclawProcedure) is unaffected — it uses posthog-node which makes direct API calls from the backend and is not blocked by ad blockers. This means actual API access is still properly gated by the feature flag; this change only affects sidebar link visibility.

Changes

  • src/app/(app)/components/PersonalAppSidebar.tsx: Added ?? true to the useFeatureFlagEnabled('kiloclaw') call

Built for Brendan by Kilo for Slack

Ad blockers block posthog-js in the browser, causing
useFeatureFlagEnabled('kiloclaw') to return undefined (falsy).
This hides the Claw sidebar link for users with ad blockers.

Use nullish coalescing (?? true) so that undefined defaults to true,
while an explicit false from PostHog is still respected. The server-side
flag check in the tRPC router continues to gate actual access.
@kiloconnect
Copy link
Contributor Author

kiloconnect bot commented Feb 24, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • src/app/(app)/components/PersonalAppSidebar.tsx

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.

0 participants