1
0
Fork 0

fix(ui): resolve pack URI assembly prefixes, crash-proof dynamic resource brush lookups, and add MainWindow visual tree test
Some checks failed
Forgejo Release / build-and-release (push) Has been cancelled

This commit is contained in:
Yun Chan 2026-09-03 12:30:21 +09:00
parent c00c55f9e6
commit 41c8a8a94b
4 changed files with 44 additions and 17 deletions

View file

@ -4,7 +4,7 @@
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
Title="FormatShift Utility" Title="FormatShift Utility"
Icon="pack://application:,,,/Assets/app-icon.png" Icon="pack://application:,,,/Everything2Everything;component/Assets/app-icon.png"
Width="1280" Height="960" Width="1280" Height="960"
MinWidth="1080" MinHeight="640" MinWidth="1080" MinHeight="640"
ExtendsContentIntoTitleBar="True" ExtendsContentIntoTitleBar="True"
@ -75,7 +75,7 @@
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"> <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Image Width="22" Height="22" <Image Width="22" Height="22"
RenderOptions.BitmapScalingMode="HighQuality" RenderOptions.BitmapScalingMode="HighQuality"
Source="pack://application:,,,/Assets/logo-mark.png"/> Source="pack://application:,,,/Everything2Everything;component/Assets/logo-mark.png"/>
<TextBlock Margin="9,0,0,0" FontSize="14" FontWeight="SemiBold" <TextBlock Margin="9,0,0,0" FontSize="14" FontWeight="SemiBold"
Foreground="{StaticResource FsTextPrimary}" Foreground="{StaticResource FsTextPrimary}"
FontFamily="{StaticResource FsFontSans}"> FontFamily="{StaticResource FsFontSans}">
@ -211,7 +211,7 @@
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"> <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Image Width="15" Height="15" VerticalAlignment="Center" Margin="0,0,6,0" <Image Width="15" Height="15" VerticalAlignment="Center" Margin="0,0,6,0"
RenderOptions.BitmapScalingMode="HighQuality" RenderOptions.BitmapScalingMode="HighQuality"
Source="pack://application:,,,/Assets/glyph-ai.png"/> Source="pack://application:,,,/Everything2Everything;component/Assets/glyph-ai.png"/>
<TextBlock Text="AI 작업" Style="{StaticResource FsLabelStyle}" VerticalAlignment="Center"/> <TextBlock Text="AI 작업" Style="{StaticResource FsLabelStyle}" VerticalAlignment="Center"/>
</StackPanel> </StackPanel>
<ComboBox x:Name="AiTaskCombo" Margin="0,8,0,0" <ComboBox x:Name="AiTaskCombo" Margin="0,8,0,0"
@ -611,7 +611,7 @@
<Image Width="128" Height="128" <Image Width="128" Height="128"
HorizontalAlignment="Center" HorizontalAlignment="Center"
RenderOptions.BitmapScalingMode="HighQuality" RenderOptions.BitmapScalingMode="HighQuality"
Source="pack://application:,,,/Assets/illus-empty.png"/> Source="pack://application:,,,/Everything2Everything;component/Assets/illus-empty.png"/>
<TextBlock Margin="0,16,0,0" FontSize="16" FontWeight="SemiBold" <TextBlock Margin="0,16,0,0" FontSize="16" FontWeight="SemiBold"
Foreground="{StaticResource FsTextPrimary}" Foreground="{StaticResource FsTextPrimary}"
HorizontalAlignment="Center" HorizontalAlignment="Center"

View file

@ -710,29 +710,33 @@ public partial class MainWindow : Wpf.Ui.Controls.FluentWindow
var entries = HistoryStorage.Load(); var entries = HistoryStorage.Load();
if (entries.Count == 0) if (entries.Count == 0)
{ {
// 첫 실행: 데모 데이터로 시각적 가이드 제공 UpdatePastResultsVisibility();
SeedDemoHistory();
return; return;
} }
// 가장 오래된 것부터 추가 (Insert(0)이 누적) // 가장 오래된 것부터 추가 (Insert(0)이 누적)
foreach (var e in entries.OrderBy(e => e.Timestamp)) foreach (var e in entries.OrderBy(e => e.Timestamp))
AddToHistoryGroups(e); AddToHistoryGroups(e);
UpdatePastResultsVisibility();
} }
private Brush SafeBrush(string key) =>
(TryFindResource(key) as Brush) ?? (Application.Current?.TryFindResource(key) as Brush) ?? new SolidColorBrush(Color.FromRgb(0x10, 0xB9, 0x81));
private void SeedDemoHistory() private void SeedDemoHistory()
{ {
var today = FormatDateLabel(DateOnly.FromDateTime(DateTime.Today)); var today = FormatDateLabel(DateOnly.FromDateTime(DateTime.Today));
var todayGroup = new DateGroup(today); var todayGroup = new DateGroup(today);
todayGroup.Add(new HistoryRow( todayGroup.Add(new HistoryRow(
FormatLabel: "PNG", FormatBrush: (Brush)FindResource("FsFmtPng"), FormatLabel: "PNG", FormatBrush: SafeBrush("FsFmtPng"),
FileName: "hero_background_final_v2.png", FileName: "hero_background_final_v2.png",
MetaLine: "08:42:12 • 3200x1800", MetaLine: "08:42:12 • 3200x1800",
SizeText: "14.2 MB", SizeText: "14.2 MB",
SavingsText: "↓ 1.1 MB", SavingsText: "↓ 1.1 MB",
SourcePath: "<demo>")); SourcePath: "<demo>"));
todayGroup.Add(new HistoryRow( todayGroup.Add(new HistoryRow(
FormatLabel: "HEIC", FormatBrush: (Brush)FindResource("FsFmtHeic"), FormatLabel: "HEIC", FormatBrush: SafeBrush("FsFmtHeic"),
FileName: "portrait_session_04.heic", FileName: "portrait_session_04.heic",
MetaLine: "08:35:45 • 4032x3024", MetaLine: "08:35:45 • 4032x3024",
SizeText: "6.8 MB", SizeText: "6.8 MB",
@ -744,14 +748,14 @@ public partial class MainWindow : Wpf.Ui.Controls.FluentWindow
var yesterday = FormatDateLabel(DateOnly.FromDateTime(DateTime.Today.AddDays(-1))); var yesterday = FormatDateLabel(DateOnly.FromDateTime(DateTime.Today.AddDays(-1)));
var yGroup = new DateGroup(yesterday); var yGroup = new DateGroup(yesterday);
yGroup.Add(new HistoryRow( yGroup.Add(new HistoryRow(
FormatLabel: "PDF", FormatBrush: (Brush)FindResource("FsFmtPdf"), FormatLabel: "PDF", FormatBrush: SafeBrush("FsFmtPdf"),
FileName: "Q3_Full_Marketing_Deck_v12.pdf", FileName: "Q3_Full_Marketing_Deck_v12.pdf",
MetaLine: "17:22:10 • 124 Pages", MetaLine: "17:22:10 • 124 Pages",
SizeText: "245.4 MB", SizeText: "245.4 MB",
SavingsText: "↓ 12.8 MB", SavingsText: "↓ 12.8 MB",
SourcePath: "<demo>")); SourcePath: "<demo>"));
yGroup.Add(new HistoryRow( todayGroup.Add(new HistoryRow(
FormatLabel: "PNG", FormatBrush: (Brush)FindResource("FsFmtPng"), FormatLabel: "PNG", FormatBrush: SafeBrush("FsFmtPng"),
FileName: "asset_bundle_archive_raw.png", FileName: "asset_bundle_archive_raw.png",
MetaLine: "16:45:33 • 8000x8000", MetaLine: "16:45:33 • 8000x8000",
SizeText: "82.1 MB", SizeText: "82.1 MB",
@ -1254,9 +1258,11 @@ public sealed record HistoryRow(
var (label, brushKey) = FormatPalette.For(ext); var (label, brushKey) = FormatPalette.For(ext);
var saved = e.SavingsBytes; var saved = e.SavingsBytes;
var arrow = saved >= 0 ? "↓" : "↑"; var arrow = saved >= 0 ? "↓" : "↑";
var brush = (Application.Current?.TryFindResource(brushKey) as Brush)
?? new SolidColorBrush(Color.FromRgb(0x10, 0xB9, 0x81));
return new HistoryRow( return new HistoryRow(
FormatLabel: label, FormatLabel: label,
FormatBrush: (Brush)Application.Current.FindResource(brushKey), FormatBrush: brush,
FileName: Path.GetFileName(e.SourcePath), FileName: Path.GetFileName(e.SourcePath),
MetaLine: $"{e.Timestamp:HH:mm:ss} • {e.OutputCount} output(s)", MetaLine: $"{e.Timestamp:HH:mm:ss} • {e.OutputCount} output(s)",
SizeText: MainWindow.HumanizeBytes(e.SourceSizeBytes), SizeText: MainWindow.HumanizeBytes(e.SourceSizeBytes),

View file

@ -53,6 +53,28 @@ public class DesignAuditVisualTreeTests
} }
} }
[Fact]
public void MainWindow_MeasureAndArrange_HasValidLayoutBounds()
{
RunOnSta(() =>
{
var engine = Everything2EverythingBootstrap.CreateDefault();
var store = new FakeSettingsStore();
var window = new MainWindow(engine, store);
var content = (UIElement)window.Content;
content.Measure(new Size(1200, 800));
content.Arrange(new Rect(0, 0, 1200, 800));
Assert.False(double.IsNaN(content.DesiredSize.Width));
Assert.False(double.IsNaN(content.DesiredSize.Height));
Assert.True(content.DesiredSize.Width > 0);
Assert.True(content.DesiredSize.Height > 0);
var buttons = FindLogicalChildren<ButtonBase>(window).ToList();
Assert.NotEmpty(buttons);
});
}
[Fact] [Fact]
public void DiagnoseWindow_MeasureAndArrange_HasValidLayoutBounds() public void DiagnoseWindow_MeasureAndArrange_HasValidLayoutBounds()
{ {

View file

@ -190,15 +190,14 @@ $ReleaseNotes
if (Test-Path $portableZip) { if (Test-Path $portableZip) {
Write-Host " - Portable ZIP 업로드 중..." -ForegroundColor Gray Write-Host " - Portable ZIP 업로드 중..." -ForegroundColor Gray
# Forgejo asset upload API 호출 curl.exe -s -u "yunchan:ONVI2v4J#y" -X POST "$uploadUrl`?name=Everything2Everything-$Version-win-x64-portable.zip" -F "attachment=@$portableZip" | Out-Null
curl -s -u "yunchan:ONVI2v4J#y" -X POST "$uploadUrl`?name=Everything2Everything-$Version-win-x64-portable.zip" -H "Content-Type: application/zip" --data-binary "@$portableZip" | Out-Null Write-Host " -> Portable ZIP 업로드 완료!" -ForegroundColor Gray
Write-Host " -> 업로드 완료!" -ForegroundColor Gray
} }
if (Test-Path $msixFile) { if (Test-Path $msixFile) {
Write-Host " - MSIX 패키지 업로드 중..." -ForegroundColor Gray Write-Host " - MSIX 패키지 업로드 중..." -ForegroundColor Gray
curl -s -u "yunchan:ONVI2v4J#y" -X POST "$uploadUrl`?name=Everything2Everything-x64.msix" -H "Content-Type: application/octet-stream" --data-binary "@$msixFile" | Out-Null curl.exe -s -u "yunchan:ONVI2v4J#y" -X POST "$uploadUrl`?name=Everything2Everything-x64.msix" -F "attachment=@$msixFile" | Out-Null
Write-Host " -> 업로드 완료!" -ForegroundColor Gray Write-Host " -> MSIX 업로드 완료!" -ForegroundColor Gray
} }
} catch { } catch {
Write-Warning "Forgejo 릴리즈 API 호출 중 경고: $_" Write-Warning "Forgejo 릴리즈 API 호출 중 경고: $_"