Add personalization features: Favorites and Recently Viewed Samples#1875
Conversation
- Implement new AdaptiveSelectorBar control for responsive tab-like navigation - Add AdaptiveSelectorBarItem class to represent selectable items - Create styles for selected/unselected AdaptiveSelectorBarItems - Update Home page to include SampleFilterBar using AdaptiveSelectorBar
|
@niels9001 @marcelwgn |
- Implement StringListSettingsHelper for managing string lists in app settings - Add constants for Favorites and RecentlyVisited keys - Add Favorite button with tooltip and icon toggle to PageHeader - Manage favorite state handling and persist it using helper
- Implemented filtering for Recently Added, Recently Updated, Recently Visited, Favorites, and All Samples - Hooked up ItemsRepeater to dynamically update based on selected filter - Ensured data consistency with cleanup for invalid favorites and recently visited
…lable based on the selected filter
…plates now manage that logic.
…ted samples. Add new CriticalButtonStyle
Couldn't stop overthinking about this, so I pushed a PR with breaking changes just to shut my brain up. |
|
Hey @Zakariathr22, thanks for opening this PR! We discussed this PR internally and we believe the recent/favorite tabs brings additional value (can't wait to use it myself😁!). We just need to ensure that we are not overcomplicating things, therefore we are suggesting a few changes: TabsWould it make sense to just have 2 tabs? Tab 1: Recent
Tab 2: favorites
This keeps things simple, without providing too many options. Since we have the "All samples" tab already in the main menu, we probably don't need it on the homepage. Tab controllerCreating custom controls can always introduce potential a11y issues - so I was wondering if we could use a simple Other changes
All and all, super appreciative of the work! It's awesome 🚀 |
I think the data about the recently added and recently updated samples is also important.
It already retrieves the last 15 visited samples. We can simply edit it in private const int _maxRecentlyVisitedPages = 15;
But it does solve the overflow issue, and we’ll need it if we keep the list as I initially suggested.
Yes, it makes sense only if we're going to remove the recently added and recently updated data.
Personally, it was the first thing that guided me to this repo 😂.
Could you also take a look at the Generally, the implemented design was inspired by the Windows File Explorer, which adds familiarity and aligns with the overall Windows design language. These my thoughts, so if what you're proposing is just a suggestion, I might disagree on a few things 😅. |
Changed the constant `_maxRecentlyVisitedPages` in the `PageHeader` class from 15 to 7, limiting the number of recently visited pages that can be tracked or displayed.
Renamed `SettingsExpander` to `SamplesSettingsExpander` and updated its header to "Sample preferences". Adjusted `SettingsCard` headers for consistency by changing them to lowercase. Enhanced the logic in `SettingsPage.xaml.cs` to expand the `SamplesSettingsExpander` based on the presence of items in the recently visited samples or favorites list.
…akariathr22/WinUI-Gallery into feature/sample-personalization
|
The proposal was to have 2 tabs. The default tab (Recent - or if we have a better name for it) would combine these 3 into a single view:
The reason for this is having 5 tabs with kind of similiar things make the UX more complex. We want the landingspage to be as calm as possible and reduce the number of ways to navigate to similar content. |
@niels9001, do you mean something like this? |
|
Exactly! |
🤝 Got it |
- Replaced custom tab implementation with a styled SelectorBar for better accessibility and consistency. - Reduced tabs to only "Recent" and "Favorites". - "Recent" tab now includes a horizontal scroller for the last visited samples (up to 7), followed by 2 ItemRepeaters of recently added and updated a samples. - "Favorites" tab displays an ItemsRepeater of favorite items. - Removed redundant "All samples" section from homepage, aligning with navigation structure. - Applied visual style from AI Dev Gallery for SelectorBar to maintain design consistency. - Redesign item template to align the new design and prevent hovering border issue in GridView.
…akariathr22/WinUI-Gallery into feature/sample-personalization
…pdatedSamplesList
|
/azp run |
…item in the list.
…ntrol to the NavigationRootPage
…akariathr22/WinUI-Gallery into feature/sample-personalization
Removed error handling for adding items to favorites. The code now directly calls `TryAddItem` without checking the result.
|
/azp run |
|
/azp run |
|
/azp run |
1 similar comment
|
/azp run |
Head branch was pushed to by a user without write access
|
/azp run |
niels9001
left a comment
There was a problem hiding this comment.
@Zakariathr22 LGTM! Again.. AMAZING work!!!!

Description
This PR introduces Favorites and Recently Viewed Samples to enhance personalization. These features aim to improve navigation efficiency and user engagement.
Main changes are:
Motivation and Context
How Has This Been Tested?
Manually tested.
Screenshots (if appropriate)
Types of changes
References