Skip to content

Commit 2ed4bd6

Browse files
Jen-Unoclaude
andcommitted
refactor(brewhouse): group same-page previews into PreviewGroups
Consolidate each multi-preview page into one PreviewGroup file (named <hd:Preview> children) instead of one [Preview] class per state: - MenuPreviews (Full Catalog / No Results) - CartPreviews (Items / Empty) - OrdersPreviews (History / Empty) - ProductDetailPreviews (Today's Special / Standard) Each child classifies by its content type (the page), so the Previews tree is unchanged. HomePage (single preview) and the dataTemplateKey component previews (product card, order-status badge) stay as [Preview] classes — grouping would drop their Data Templates classification. Verified: Debug build succeeds; the four PreviewGroup types are generated into the assembly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent e185088 commit 2ed4bd6

24 files changed

Lines changed: 136 additions & 202 deletions

studio/coffee-shop/BrewHouse/Previews/CartPageEmptyPreview.xaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

studio/coffee-shop/BrewHouse/Previews/CartPageEmptyPreview.xaml.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

studio/coffee-shop/BrewHouse/Previews/CartPagePreview.xaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

studio/coffee-shop/BrewHouse/Previews/CartPagePreview.xaml.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<hd:PreviewGroup x:Class="BrewHouse.Previews.CartPreviews"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="using:BrewHouse.Presentation"
5+
xmlns:mock="using:BrewHouse.Presentation.MockData"
6+
xmlns:hd="using:Uno.UI.HotDesign"
7+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
8+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9+
mc:Ignorable="d">
10+
11+
<!-- CartPage populated vs. empty. -->
12+
<hd:Preview PreviewName="Items"
13+
Visibility="Collapsed"
14+
Width="390"
15+
Height="844">
16+
<local:CartPage DataContext="{x:Bind mock:CartPageMockData.Data}" />
17+
</hd:Preview>
18+
19+
<hd:Preview PreviewName="Empty"
20+
Visibility="Collapsed"
21+
Width="390"
22+
Height="844">
23+
<local:CartPage DataContext="{x:Bind mock:CartPageMockData.Empty}" />
24+
</hd:Preview>
25+
</hd:PreviewGroup>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Uno.UI.HotDesign;
2+
3+
namespace BrewHouse.Previews;
4+
5+
// A preview group holding the CartPage states (Items / Empty) as named children.
6+
public sealed partial class CartPreviews : PreviewGroup
7+
{
8+
public CartPreviews() => this.InitializeComponent();
9+
}

studio/coffee-shop/BrewHouse/Previews/MenuPageFullPreview.xaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

studio/coffee-shop/BrewHouse/Previews/MenuPageFullPreview.xaml.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

studio/coffee-shop/BrewHouse/Previews/MenuPageNoResultsPreview.xaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

studio/coffee-shop/BrewHouse/Previews/MenuPageNoResultsPreview.xaml.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)