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: UI table respond to non-primitive prop changes #1046

Merged
merged 5 commits into from
Feb 21, 2025

Conversation

mattrunyon
Copy link
Collaborator

@mattrunyon mattrunyon commented Nov 27, 2024

Fixes #982

Also fixes a bug I found while implementing this where adding a custom column in the UI would cause formatting rule if_ clauses to be removed.

@mattrunyon mattrunyon requested a review from a team November 27, 2024 18:00
@mattrunyon mattrunyon self-assigned this Nov 27, 2024
@mattrunyon mattrunyon requested review from dgodinez-dh and mofojed and removed request for a team and dgodinez-dh November 27, 2024 18:00

const log = Log.module('@deephaven/js-plugin-ui/UITable');

function useDeepEquals<T>(value: T): T {
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be worth placing this in it's own file so it can be used in other code.

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 agree. I think this and the other hook would be good in @deephaven/react-hooks, but I was being lazy and avoiding needing to merge to web-client-ui, publish, then consume here. I can do that though

Copy link
Member

Choose a reason for hiding this comment

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

Add JS docs for this hook as well.

Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

Small cleanup


const log = Log.module('@deephaven/js-plugin-ui/UITable');

function useDeepEquals<T>(value: T): T {
Copy link
Member

Choose a reason for hiding this comment

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

Add JS docs for this hook as well.


const alwaysFetchColumns = useMemo(() => {
if (alwaysFetchColumnsArray[0] === true) {
if (modelColumns.length > 500) {
if (columns.length > 500) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: The 500 should be a constant, as it's used in the error message below.

setError(
`Table has ${modelColumns.length} columns, which is too many to always fetch. ` +
`Table has ${columns.length} columns, which is too many to always fetch. ` +
Copy link
Member

Choose a reason for hiding this comment

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

You should use the useThrowError hook above here. Looks like you only used in useUITableModel even though it applies here as well.

@mofojed mofojed mentioned this pull request Feb 18, 2025
Copy link

ui docs preview (Available for 14 days)

@mattrunyon
Copy link
Collaborator Author

I addressed the review comments, but left them unresolved so they are easier to verify since this PR was stale for a while

Copy link

ui docs preview (Available for 14 days)

Copy link

ui docs preview (Available for 14 days)

@mattrunyon mattrunyon merged commit 024811d into deephaven:main Feb 21, 2025
16 checks passed
@mattrunyon mattrunyon deleted the ui-table-stale-props branch February 21, 2025 19:35
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.

ui.table respond to format prop changes
3 participants