Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

=table should not be applied on context #2736

Merged
merged 3 commits into from
Dec 28, 2024

Conversation

RED-ROSE515
Copy link
Collaborator

This PR resolves the issue : Context View: =table should not be applied on context #2724.

In this PR, I have modified the useHideBullet to not hide bullets(=table) in context view.
And I added a function to check if the current thought is in context view.
If the current thougt is in context view, show bullet.

Copy link
Contributor

@raineorshine raineorshine left a comment

Choose a reason for hiding this comment

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

Behavior looks good, thanks! Just a couple recommendations.

src/hooks/useHideBullet.ts Outdated Show resolved Hide resolved
src/components/Thought.tsx Outdated Show resolved Hide resolved
src/components/__tests__/Bullet.ts Show resolved Hide resolved
Comment on lines 182 to 189
const isInContextView = useSelector(state => {
/** Check if the thought is in the context view. */
const checkContextView = (currentPath: Path): boolean => {
if (currentPath.length <= 1) return false
return isContextViewActive(state, parentOf(currentPath))
}
return checkContextView(path)
})
Copy link
Contributor

Choose a reason for hiding this comment

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

This can. be simplified to:

const showContexts = useSelector(state => isContextViewActive(state, rootedParentOf(state, path)))

or even:

const showContexts = useSelector(state => isContextViewActive(state, parentOf(path)))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I got it. I will regard that.

@raineorshine raineorshine merged commit 16204e3 into cybersemics:main Dec 28, 2024
3 checks passed
@RED-ROSE515 RED-ROSE515 deleted the fix-table-context branch December 28, 2024 17:36
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