feat(nav): hide contexts into a collapsed group#3476
Conversation
Add a "Hide context" action to each context's three-dot / right-click menu in the Contexts explorer, mirroring "Star context". Hidden contexts drop out of the starred and main lists and collapse into a "Hidden" group at the bottom of the sidebar (collapsed by default). Hidden state persists per-user via desktop file-system shortcuts (a distinct "hidden-folder" shortcut type), reusing the shared shortcuts query so stars and hides don't double-fetch. Generated-By: PostHog Code Task-Id: 4c16844c-acc9-4124-909d-f07335710a91
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
|
CHANNELS_SPACE_VIEWED is a one-shot event gated only on the channels query. The stars/hides shortcuts query is independent, so if channels resolved first the event recorded starred_count and hidden_count as zero and viewedTrackedRef blocked any correction. Gate the effect on the shortcut queries' loading state too. Addresses Greptile P1. Generated-By: PostHog Code Task-Id: 4c16844c-acc9-4124-909d-f07335710a91
Two Greptile findings on the hide hook, both inherited from the star hook, so fix them symmetrically: - Ignore toggle re-clicks while a create/delete is in flight. The cache only updates on success, so a quick double-tap fired two creates for the same path, leaving a duplicate shortcut that a single later toggle couldn't clear. - Swallow failures in the delete-on-channel-delete cleanup so a rejected request doesn't surface as an unhandled promise rejection. Generated-By: PostHog Code Task-Id: 4c16844c-acc9-4124-909d-f07335710a91
Problem
The Contexts explorer gets crowded in a large org — there's a lot in there and no way to tuck away contexts you don't care about. You can star the ones you use most, but everything else sits in one long list.
Changes
hidden-foldershortcut type), reusing the shared shortcuts query so stars and hides don't double-fetch. Deleting a context clears any stale hidden marker, same as it does for stars.How did you test this?
useChannelHides.test.tsx(map / hide / unhide), mirroring the stars hook tests.vitest run src/features/canvas) — 95 passing.pnpm --filter @posthog/ui typecheck,@posthog/shared typecheck, and Biome check all clean.Automatic notifications
Created with PostHog Code