-
Notifications
You must be signed in to change notification settings - Fork 53
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
[Experiment] 🧪 DataTable Initial Prototype #418
Conversation
Hmm.. interesting we're hitting Uno0001 errors:
Oh, I didn't make this multi-target only UWP/WinAppSDK... maybe I should do that just for now? |
0080036
to
8de8ef2
Compare
Ran XAML Styler, missed some things when adding the tree test before apparently. Also have a test case and logic working for auto-sized columns (doesn't work with resizing interaction yet). But seems to work in simple case. Need to add a sample with more rows and varying length data width to see how it really works in practice. That's my next step I think. |
Thinking to deal with the various padding options, I may be able to look at the position of the first item in the row in relation to the position of the DataTable column (with the positioning/coordinate APIs in the composition layer we have extensions for). I think this would mean we could factor it in without having to worry about built-in container padding or developer padding, and possible would work well for TreeView and the indentation padding in the first row, we could get the other columns to ignore it after in the layout pass, maybe... Needs more investigation for that last bit. |
// TODO: Check with Sergio if there's a better structure here, as I don't need a Dictionary like ConditionalWeakTable | ||
internal HashSet<DataRow> Rows { get; private set; } = new(); | ||
|
||
internal void ColumnResized() | ||
{ | ||
InvalidateArrange(); | ||
|
||
foreach (var row in Rows) | ||
{ | ||
row.InvalidateArrange(); | ||
} | ||
} |
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.
@Sergio0694 wanted to check in with you here, as my instinct was a ConditionalWeakTable
for safety of reference holding. Though I have the DataRow
class remove itself on Unloaded
(though we know how that is in the XAML lifecycle). Right now, I was just trying to get the layout logic to work, and I think that's in a good place now.
Theoretically these should all be owned by the same parent, so not sure if that would cause problems with reference counts. Realizing though that I should probably have the DataRow grab a WeakReference
to the parent too...
What are your thoughts on this connection? Thanks!
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 I'm missing some context on who's keeping alive what. As in, if this is just some internal data structure for a control, I'm not necessarily seeing an issue with it tracking other things and objects it needs. Even if there's some reference cycle, the GC is completely able to handle that. Is there some global (static) state being involved here that's worrying you? Or, could you explain in simple terms what the relationship is between the various components here so I can better understand the scenario and what you're thinking might cause problems? 🙂
Alright, auto-sizing columns effectively works. Layout becomes a bit unstable when adjusting columns, so not sure how kosher that is. Not sure how we can account for that better though to fix. Performance seems fine though. I did try to debounce, but then it wasn't updating layout at all in-between, so it was either all or nothing it seems. Looking into the auto-detect padding... that seems difficult as we can sometimes detect it using the composition layer coordinates positioning in the Arrange step, but that's pretty late. We'd have to invalidate arrange and re-layout possible for a third time (2nd from auto-sizing columns, though that gets triggered much earlier). And I think the padding from TreeView is outside the |
@Arlodotexe it's trying to run the WASM head on the package, but I turned the multi-target to just uwp/wasdk in the src project... or I have to update the sample one too, eh? |
3d5c4d8
to
00ba812
Compare
For now, manually added margin to 'Tree Table' is working now, which is really awesome! Just should add the sticky header behavior to the virtualization sample for completeness. |
@Arlodotexe I'm still missing something to make this work for only uwp/wasdk with the build... is that documented somewhere yet? I added multitarget props to the source and samples... thought that'd be it? |
Stack trace from resizing a column too far to the right:
|
Your MultiTarget files look good. At first glance, this appears related to CommunityToolkit/Tooling-Windows-Submodule#5, but we already have components that do this. It shouldn't be causing any issues here 🤔 @michael-hawker Just a hunch, try removing the |
Thought I had tried that... will see though on next go-around. |
Waiting on CommunityToolkit/Windows#136 |
Thanks @Arlodotexe, just waiting for packages from Behaviors, then can apply local patch to add Sticky Header to the virtualization sample and we'll call this good for 'V1'... 🙂 |
Sticky Header works, though not perfect as default style is Transparent, added a border for now (which was a cool scenario to test anyway), and it works fine. There'll be more clean-up to do with this and how it works in the future anyway. @niels9001 suggested a helper maybe for the items panel to fade the top away on scrolling with some sort of gradient brush maybe... something to investigate later. So this is ready to go then otherwise, just needs a sign-off. |
I'm seeing this error in the console on WASM. UWP and WinAppSDK seem okay.
|
@Arlodotexe these don't work on WASM... so expected - see multi-target. They just show up as we have that other issue open: CommunityToolkit/Tooling-Windows-Submodule#5 |
Our transient test failure again... will re-run once others done. Probably something need to investigate later. |
Test are constantly dying after 3 attempts on this one, not sure why. Opened up a runner issue to start a conversation as that's the only thing I can think that's changed (as we haven't modified our tests themselves in the last while): actions/runner-images#7937 Only extra change on this PR is the upgraded package version of the extensions, though we've been seeing this test failure before that was released... |
4b8ae71
to
e8b8a54
Compare
…t supposed to work...) Will have to see how it runs in the CI and after I've rebooted VS...
Invalidate Arrange of children when column autosizes - auto size works! Test virtualization with more items, works too!
…tainer... need to investigate, adding a TODO comment for now
…taTable Looks explicitly for the MultiSelectGrid which drives the indentation/gutter size for TreeViewItem
Add manual margins to samples for alignment between different containers Add more depth to tree table example
Fix test relying on it, see CommunityToolkit/Tooling-Windows-Submodule#101
For now add a solid background, would be nice to have a fadebehavior on the items panel to fade behind the sticky header that's transparent still...
…rios Fixes a bug/issue with a Row's Height not being properly calculated, which was not only pivotal for this scenario but would have caused issues in practical usage of all other scenarios as well.
d1f1ca0
to
78b1a08
Compare
Alright, rebased on the clean tooling build/infrastructure we have which is building on I also took the time while re-testing locally to add the requested "Blank" header sample to the docs/examples. It helped exposed a bug with improper Once this builds clean, it should be merged and a new package pushed for folks to try more easily! 🎉 |
Implements #415
Wrote up all details of current prototype and to dos here: #415 (comment)
Tested on Win10 with UWP and WinUI 3.
(Uno WASM won't work due to
ItemsPresenter
not supporting Header/Footer, see Uno links in discussion above)Want to fix the following before committing: