fix: wire up close button on Skills detail pane#1685
Open
reverb256 wants to merge 1 commit intoPostHog:mainfrom
Open
fix: wire up close button on Skills detail pane#1685reverb256 wants to merge 1 commit intoPostHog:mainfrom
reverb256 wants to merge 1 commit intoPostHog:mainfrom
Conversation
The selectedSkill useMemo returned skills[0] as a fallback when selectedPath was null, meaning the sidebar never closed because !!selectedSkill was always true when skills existed. Changed both fallback returns to null so the sidebar correctly closes when the close button or card toggle sets selectedPath to null. Fixes PostHog#1649
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.
Problem
The close button (X) on the Skills detail pane does nothing. Clicking it appears to have no effect — the sidebar stays open.
Closes #1649
Root Cause
In
SkillsView.tsx, theselectedSkilluseMemo returnsskills[0]whenselectedPathisnull. Since the sidebar renders based on!!selectedSkill, it's alwaystruewhen any skills exist — the close button setsselectedPathtonull, butselectedSkillstill resolves to the first skill.Fix
Return
nullwhenselectedPathisnullinstead of falling back toskills[0].Tests
5 new tests in
SkillsView.test.tsx: