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

feat: add max width for table cells #387

Merged
merged 1 commit into from
May 26, 2024
Merged

Conversation

islxyqwe
Copy link
Member

Apply max width on DataTable cells.
When a cell is truncated, hover it will display a hover card and user can copy the value of the cell in the card.
image

@islxyqwe islxyqwe requested a review from ObservedObserver May 21, 2024 12:40
Copy link

vercel bot commented May 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
graphic-walker ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 0:42am

Copy link
Contributor

Risk Level 2 - /home/runner/work/graphic-walker/graphic-walker/packages/graphic-walker/src/components/dataTable/profiling.tsx

The code seems to be well written and follows the SOLID principles. However, there is a potential performance issue in the NominalProfiling function. The render function is called inside the JSX, which means it will be called on every render. This could be optimized by using useMemo to only recompute the render function when valueRenderer or value changes. Here is an example of how you could do this:

const render = useMemo(() => {
    const displayValue = valueRenderer(value);
    if (!displayValue) {
        return <span className=\"text-destructive\">(Empty)</span>;
    }
    return displayValue;
}, [valueRenderer, value]);

📝🐌🚀


Powered by Code Review GPT

@ObservedObserver ObservedObserver merged commit 5ce9b8c into main May 26, 2024
6 checks passed
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