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

Highlight related edges and cardinalities when a TableNode is active. #284

Conversation

FunamaYukina
Copy link
Member

@FunamaYukina FunamaYukina commented Dec 17, 2024

Summary

Highlight related edges and cardinalities when a TableNode is active.
Preview: https://liam-erd-sample-gx3t0p2yn-route-06-core.vercel.app/

Before

ss 2506

After

ss 2507

Related Issue

Changes

Testing

Other Information

@FunamaYukina FunamaYukina force-pushed the highlight-related-edges-and-cardinalities-when-a-TableNode-is-active branch from a7674be to b08232b Compare December 17, 2024 03:57
@FunamaYukina FunamaYukina marked this pull request as ready for review December 17, 2024 04:27
@FunamaYukina FunamaYukina requested a review from a team as a code owner December 17, 2024 04:27
@FunamaYukina FunamaYukina requested review from hoshinotsuyoshi, junkisai, MH4GF and sasamuku and removed request for a team December 17, 2024 04:27
Copy link
Member

@MH4GF MH4GF left a comment

Choose a reason for hiding this comment

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

The highlighting process is getting more complicated, but it looks good!

@@ -65,47 +65,66 @@ export const ERDContentInner: FC<Props> = ({
const {
state: { loading },
} = useERDContentContext()
const [clickedNodeId, setClickedNodeId] = useState<string | null>(null)
Copy link
Member

Choose a reason for hiding this comment

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

It is painful to have to create a separate state from the active state managed by useUserEditingStore(), but it seems that the logic has to be unravelled to solve the problem. I'd like to try another PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're absolutely right. I wanted to write the code more simply, but I couldn't. In the end, the code became more complex🥲.Thank you for thinking about it🙏.

@MH4GF MH4GF added this pull request to the merge queue Dec 17, 2024
@MH4GF MH4GF removed this pull request from the merge queue due to a manual request Dec 17, 2024
@@ -65,47 +65,66 @@ export const ERDContentInner: FC<Props> = ({
const {
state: { loading },
} = useERDContentContext()
const [clickedNodeId, setClickedNodeId] = useState<string | null>(null)
Copy link
Member

Choose a reason for hiding this comment

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

I've been considering the following:

Is click a suitable naming? Perhaps something like active might be better.

Copy link
Member

Choose a reason for hiding this comment

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

I agree that it is painful. I was thinking about checking whether the changes we made to how we handle data around PR #280 could be utilized. The functionality seems good, so I think it's fine to merge it now and integrate later!

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for your suggestion! I agree!
I've fixed it. 9c8767e

@FunamaYukina
Copy link
Member Author

Thank you all for your reviews.🙏

@FunamaYukina FunamaYukina added this pull request to the merge queue Dec 17, 2024
Merged via the queue into main with commit ab0e2dd Dec 17, 2024
12 checks passed
@FunamaYukina FunamaYukina deleted the highlight-related-edges-and-cardinalities-when-a-TableNode-is-active branch December 17, 2024 05:17
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.

3 participants