-
Notifications
You must be signed in to change notification settings - Fork 8
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
HLD brainstorming - Formatted text table columns #1054
Conversation
packages/nimble-components/src/table/specs/table-column-specs/table-column-formatted-text.md
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/table/specs/table-column-specs/table-column-formatted-text.md
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/table/specs/table-column-specs/table-column-formatted-text.md
Outdated
Show resolved
Hide resolved
|
||
For the sake of discussion my initial proposal is: | ||
|
||
1. For columns that require app-specific formatting logic I'm leaning towards "Client specifies formatting function" over "Use `table-column-text`" because it seems more like the API that app developers would expect (perhaps I'm biased by previous implementations). I'd like to do performance profiling to see how it impacts scroll performance before committing to this direction. |
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 think the possible proposed solution outlined in the "Client specifies formatting function" section is at odds with what an app developer would expect for an API, in that they would be expected to create a custom column implementation. The first variant, I think, is what clients typically expect, and resembles what Ag-grid provides.
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'll leave this open since I haven't addressed it (it's one level more detailed than I'm seeking agreement on at this moment, though still a good discussion to have).
I like the proposed approach of deriving from an abstract element class to define a new column type because it makes it easy to associate the formatting function with the column definition in JS code (they're in the same class). The approach of setting a formatting function via a property on the column element requires you to get a reference to the column in JS/TS/C# code which seemed more annoying to me (especially in Blazor).
packages/nimble-components/src/table/specs/table-column-specs/table-column-formatted-text.md
Show resolved
Hide resolved
packages/nimble-components/src/table/specs/table-column-specs/table-column-formatted-text.md
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/table/specs/table-column-specs/table-column-formatted-text.md
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/table/specs/table-column-specs/table-column-formatted-text.md
Outdated
Show resolved
Hide resolved
Co-authored-by: mollykreis <[email protected]>
field-name="progress" | ||
locales="en-US" | ||
style="percent" | ||
minimum-fraction-digits=2 |
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.
One thing that may be worth considering is if we do have a nimble-table-column-number
that exposes an API for formatting the value, whether or not that API should be reflected in the number-field
component (and what the implications of that are).
packages/nimble-components/src/table/specs/table-column-specs/table-column-formatted-text.md
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/table/specs/table-column-specs/table-column-formatted-text.md
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/table/specs/table-column-specs/table-column-formatted-text.md
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/table/specs/table-column-specs/table-column-formatted-text.md
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/table/specs/table-column-specs/table-column-formatted-text.md
Outdated
Show resolved
Hide resolved
Closing in favor of #1224. All of the excellent feedback in this PR has been captured in that update. |
) # Pull Request ## π€¨ Rationale Start the HLD for #1011 and other column types that display data as text. This update focuses on shared base classes, client-specified custom colums, and possible elements that Nimble could define, not APIs for specific elements. We previously brainstormed this in #1054 but I started a new PR for this more concrete proposal. ## π©βπ» Implementation This includes the HLD and also some updates to component naming conventions which fell out of the brainstorming. ## π§ͺ Testing N/A ## β Checklist <!--- Review the list and put an x in the boxes that apply or ~~strike through~~ around items that don't (along with an explanation). --> - [x] I have updated the project documentation to reflect my changes or determined no changes are needed. --------- Co-authored-by: mollykreis <[email protected]> Co-authored-by: Milan Raj <[email protected]>
Pull Request
π€¨ Rationale
First pass of design document for #1011. I'm considering formatted text more holistically, so this is also relevant to #1014.
π©βπ» Implementation
The document describes several alternative high-level approaches and proposes which ones we should pursue. Once we agree on the high-level direction in this PR, I will move it back to draft while I refine the proposed APIs and fill in the rest of the HLD template.