Repository navigation
feat: Let TableView be a SemanticZoom view again - #525
Merged
Merged
Conversation
v2 TableView derives from Control, so it lost the ISemanticZoomInformation that v1 inherited from ListView. Implement it on Windows (Uno has no SemanticZoom): picking a group in the other view scrolls its header to the top, zooming out lands on the group at the top of the viewport, and clicking a group header zooms out to that group. - CollectionGroups stays the same collection while the table is grouped and is refilled with one reset, so a list bound to it follows regrouping. - While zoomed out, CollectionGroups also lists the subgroups of collapsed groups as hidden entries; picking one expands the groups it is nested in. They are built on zoom-out only, so expanding and collapsing while zoomed in costs what it did before. - TableViewGroupInfo.Level is public, to tell nesting levels apart. - Sample app: Semantic Zoom and Nested Semantic Zoom pages (Windows only). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- Picking an item inside collapsed groups expands them and scrolls to it. Lookup order is group entry, then item, then outermost group key. - A tap on a hyperlink in a header template no longer zooms out. - A table used as the zoomed-out view no longer builds hidden subgroups. - Group building takes its output list as a parameter instead of a long-lived buffer field; FindCollectionGroup moved into CollectionView. - Tests unload in finally and unsubscribe their event handler. - Shorter doc comments; one InsertRange for the two sample pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
In v1
TableViewderived fromListView, so a grouped table could be the zoomed-in view of aSemanticZoom. The v2 table derives fromControland lostISemanticZoomInformation. This PR implements it again on Windows (Uno Platform has noSemanticZoom).CollectionGroupsentry, aTableViewGroupInfo, an item of the table or the key of an outermost group can be picked, looked up in that order. Picking an item inside collapsed groups expands them and scrolls to it.ListViewHeaderItemdid in v1. The expand/collapse button, any other focusable control and a hyperlink in a header template keep their own behaviour.CollectionView.CollectionGroupsis now the same collection for as long as the table stays grouped, and it is refilled with one reset instead of one insert per group, so a list bound to it follows regrouping. It is still null while the table is not grouped.CollectionGroupsalso lists the subgroups of collapsed groups. Picking one expands the groups it is nested in and scrolls to it. The table shows no header for these entries.SemanticZoom(itsSemanticZoomOwnerset back to null) stops the listing of hidden subgroups. A table used as the zoomed-out view never builds them.CollectionGroupsentries return their group's key fromToString(), so a list showing them gives screen readers the key as each item's name instead of the type name.TableViewGroupInfo.Levelis now public (read-only), so a zoomed-out item template can tell nesting levels apart.ScrollRowIntoViewis split into an internalScrollVisualRowIntoView(visualIndex, alignToTop); its behaviour for existing callers is unchanged.Why Windows only
Uno Platform does not implement
SemanticZoom: the types exist only as not-implemented stubs, so there is no control for the table to be a view of. It is tracked in unoplatform/uno#5252, and unoplatform/uno#23943 is an open PR that ports it to the Skia targets. Until that lands, the interface and the header tap are compiled under#if WINDOWSand the two sample pages are left out of the Uno sample app. The scrolling and group lookup behind them are platform-neutral and their tests run on Uno, so enabling this on Uno later should mostly mean removing the#if.Related Issue
None.
Type of Change
Checklist
mainbranchScreenshots / Recordings
Zoomed out: the groups of the table as tiles, with one tile hovered.
After picking Development: the table zooms back in with that group's header at the top.
Both sample pages were exercised with real mouse input in a JIT build and in a Native AOT publish.
Additional Notes
Tests
main; CI runs them on the merge.TableViewSemanticZoomTestsis new. The scrolling and group lookup tests are shared with Uno; the tests that need a realSemanticZoomare under#if WINDOWS.Performance (1,000,000 rows, two grouping levels, 200 groups with 100 subgroups each, Release, best of 6)
Hidden subgroups are built only when the table zooms out and are dropped when it zooms back in. Nothing is built when no parent group is collapsed. A table that is not in a
SemanticZoombuilds its groups as before.Native AOT
The WinUI sample app was published with Native AOT and both pages work in that build. The library's new code adds no trimming or AOT warnings. Uno targets, including WebAssembly, were not checked under AOT; the interface and the header tap are compiled only for Windows.
Not included
CollectionGroupsproperty onTableView. The zoomed-out view'sItemsSourceis assigned in code-behind, becausex:Bindcannot observeICollectionView.CollectionGroupsgoing from null to a collection.🤖 Generated with Claude Code