Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 16:00 UTC
docs: fix sidebar click gating and make position a visible row index
Review follow-ups on the docs_sidebar_click instrumentation. usePostHog() resolves to the posthog-js module singleton whether or not a provider is mounted, so the `!posthog` guard never fired: with no NEXT_PUBLIC_POSTHOG_KEY the listener still attached and every sidebar click called capture() on an uninitialized instance, logging "You must initialize PostHog before calling posthog.capture". Gate the effect on the same env var components/posthog-provider.tsx gates on. position threaded through folder recursion, so a collapsed folder's hidden children counted as rows: Triggers is the 4th visible row under Core concepts but reported 11, which would inflate any "clicks land in the top N rows" reading — the same inference error this instrumentation exists to remove. Count per level instead, so a folder occupies one row for its siblings and its children get their own 1..n sequence. Making group and position per-level locals also removes the latent collision where a separator nested in a folder reset the counter for the folder's siblings; a test pins that case. Also: capture auxclick (middle button only) so sidebar links opened in a new tab are not missing while Cmd/Ctrl+click ones are counted; a folder with a non-string name now reports folder: null rather than inheriting its parent's label; and both reference layouts memoize the index instead of rebuilding it on every render. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>