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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a follow-up PR, I'd like to investigate what if we removed
enableHiding
from our API and favor the following logic: all fields are visible unless they are theview.layout.primaryField
orview.layout.mediaField
.The
primaryField
config is only working on thegrid
layout type, but there is no reason it cannot be expanded to all layouts. For example, theside-by-side
could use it to determine which field that triggers the "side by side" view (in addition to prevent hiding it).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you mean all fields are hideable, right? If yes in the future we could have more fields that we don't want to be hideable, but still not the primary one. For example in a product title(primary), price not hideable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's good, I'll leave it as it is.
Upon sleeping on it, I think what I don't like about the existing
enableHiding
is that is a view-concern that lives in the Field API. The same asmaxWidth
, etc. That may be fine when you only have a single view (TanStack table), but it's not necessarily good when you may have some – each may need different view tweaks.Ok, so this PR is ready then :)