2 Commits
Author SHA1 Message Date
poli0981 395728142b Merge pull request #12 from poli0981/fix/v1.1.1-hotfix
fix(v1.1.1): in-app updates, live localization, folder picker
2026-04-20 20:24:40 +07:00
poli0981andClaude Opus 4.7 35d5fd47bd fix(v1.1.1): in-app updates, live localization, folder picker
Hotfix on top of v1.1.0 — three bugs surfaced during the post-release
install smoke plus a CI gap that prevented the very update path from
working.

Fixed:

- **In-app update from v1.0.0 → v1.1.0 failed**. release.yml only
  published a full .nupkg + the legacy RELEASES manifest, but Velopack
  clients ≥ 0.0.900 poll for releases.win.json and prefer a
  *-delta.nupkg. Workflow now runs `vpk download github --channel win`
  ahead of `vpk pack` so pack sees the previous release, emits a delta
  + the JSON manifest; upload pattern picks up `releases.*.json` too.
  `vpk pack` also gains `--channel win --delta BestSize` explicitly.

- **Settings did not re-localize live**. `{Binding Localization[Key]}`
  indexer bindings through an intermediate property don't always pick
  up the service's own `PropertyChanged("Item[]")` in Avalonia's
  compiled binding path. Every VM exposing a `Localization` property
  now raises `OnPropertyChanged(nameof(Localization))` on culture
  switch — new listeners on SettingsViewModel, MainWindowViewModel,
  UpdateViewModel, AboutViewModel; existing listeners on Dashboard /
  LogViewer / HotkeyBinding extended with the same line. This matches
  the pattern NavItemViewModel has always used for its `Label`
  computed property.

- **Log drawer toggle label on the nav rail required app restart** to
  pick up a new language. Same root cause; MainWindowViewModel's new
  listener fixes it.

Added:

- **Output folder picker** in Settings. Click **Browse…** next to the
  Output folder TextBox to open the native folder picker instead of
  typing a path by hand. Seeds at the current value when set; falls
  back to the picker default otherwise. New resx keys `Settings_Browse`,
  `Settings_BrowseTitle`, `Settings_BrowseTooltip` in EN / VI / AR.

Build: 0/0, tests 107 pass on net9.0 + net9.0-windows10.0.22621.0.
Tag v1.1.1 follows this merge — release workflow will publish the
first incremental-update-capable set of artifacts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 20:21:34 +07:00
15 changed files with 190 additions and 4 deletions

No files matched your search

+18
View File
@@ -88,7 +88,22 @@ jobs:
shell: pwsh
run: echo "$env:USERPROFILE\.dotnet\tools" | Out-File -FilePath $env:GITHUB_PATH -Append
- name: Download previous release (for delta generation)
# Velopack only emits a *-delta.nupkg when it finds a previous full package
# in --outputDir. Fetching the last GitHub release before pack gives the
# Update tab a working incremental path from n-1 → n. Safe to continue-on-error:
# a first-ever release has nothing to download and we just publish full.
shell: pwsh
continue-on-error: true
run: |
New-Item -ItemType Directory -Force -Path ./releases | Out-Null
vpk download github --repoUrl https://github.com/${{ github.repository }} --outputDir ./releases --channel win
- name: Velopack pack
# --channel win produces the modern releases.win.json manifest alongside the
# legacy RELEASES file, which is what Velopack clients >= 0.0.900 poll for.
# --delta BestSize keeps the hotfix payload small (typical v1.1.0 → v1.1.1
# delta is a few MB vs the ~55 MB full).
run: >
vpk pack
--packId ${{ env.PACK_ID }}
@@ -96,6 +111,8 @@ jobs:
--packDir ./publish
--mainExe ${{ env.MAIN_EXE }}
--outputDir ./releases
--channel win
--delta BestSize
- name: Compute SHA256 sums
shell: pwsh
@@ -127,6 +144,7 @@ jobs:
./releases/*.exe
./releases/*.nupkg
./releases/RELEASES
./releases/releases.*.json
./releases/SHA256SUMS.txt
body: |
## CaptureImage v${{ steps.version.outputs.version }}
+36
View File
@@ -7,6 +7,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [1.1.1] - 2026-04-20
Hotfix on top of v1.1.0 — closes three bugs reported after the v1.1.0
smoke install, and closes the CI gap that prevented in-app updates from
working.
### Fixed
- **In-app update from v1.0.0 → v1.1.0 failed** because `release.yml`
packaged only a full `.nupkg` with the legacy `RELEASES` manifest —
Velopack clients ≥ 0.0.900 poll for `releases.win.json` and prefer an
incremental `*-delta.nupkg`. The workflow now runs
`vpk download github --channel win` ahead of `vpk pack` so Velopack
sees the previous release, emits a delta + the JSON manifest, and the
GitHub Release upload pattern picks up `releases.*.json`.
- **Settings tab did not re-localize live when the language dropdown
was used**. The `{Binding Localization[Settings_*]}` indexer bindings
relied on the service's own `PropertyChanged("Item[]")` notification,
which Avalonia's compiled indexer bindings through an intermediate
property don't always pick up. Every ViewModel that exposes a
`Localization` property now raises
`OnPropertyChanged(nameof(Localization))` on culture change
(`SettingsViewModel`, `MainWindowViewModel`, `UpdateViewModel`,
`AboutViewModel`, and the existing listeners on
`DashboardViewModel`, `LogViewerViewModel`, `HotkeyBindingViewModel`).
- **Log drawer toggle label on the nav rail required an app restart to
switch language** — same root cause as the Settings bug, same fix.
### Added
- **Output folder picker** in Settings. Click **Browse…** next to the
Output folder field to open the native folder picker instead of
typing a path by hand. The picker seeds from the current value when
set. New resx keys `Settings_Browse`, `Settings_BrowseTitle`,
`Settings_BrowseTooltip` in EN / VI / AR.
## [1.1.0] - 2026-04-20
Second release. Polish + configurability pass on top of v1.0.0 — ships a
+2 -2
View File
@@ -10,9 +10,9 @@
<UseWpf>false</UseWpf>
<!-- App icon + manifest are added in M4 -->
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<!-- Release value for v1.1.0; release.yml still overrides via /p:Version=<git-tag>
<!-- Release value for v1.1.1; release.yml still overrides via /p:Version=<git-tag>
for tag-driven builds. Bump to the next -dev suffix after the release lands. -->
<Version>1.1.0</Version>
<Version>1.1.1</Version>
</PropertyGroup>
<ItemGroup>
@@ -77,6 +77,9 @@
<data name="Settings_WebpQuality" xml:space="preserve"><value>جودة WebP</value></data>
<data name="Settings_OutputFolder" xml:space="preserve"><value>مجلد الإخراج</value></data>
<data name="Settings_OutputFolderDefault" xml:space="preserve"><value>(افتراضي: Pictures\CaptureImage)</value></data>
<data name="Settings_Browse" xml:space="preserve"><value>استعراض…</value></data>
<data name="Settings_BrowseTitle" xml:space="preserve"><value>اختر مجلد الإخراج</value></data>
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>اختر مجلدًا بدلاً من كتابة المسار.</value></data>
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>قالب اسم الملف</value></data>
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>معاينة كل التقاط قبل الحفظ</value></data>
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>زر الإغلاق يصغر إلى علبة النظام</value></data>
@@ -77,6 +77,9 @@
<data name="Settings_WebpQuality" xml:space="preserve"><value>WebP quality</value></data>
<data name="Settings_OutputFolder" xml:space="preserve"><value>Output folder</value></data>
<data name="Settings_OutputFolderDefault" xml:space="preserve"><value>(default: Pictures\CaptureImage)</value></data>
<data name="Settings_Browse" xml:space="preserve"><value>Browse…</value></data>
<data name="Settings_BrowseTitle" xml:space="preserve"><value>Choose output folder</value></data>
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>Pick a folder instead of typing the path.</value></data>
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>File name template</value></data>
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>Preview each capture before saving</value></data>
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>Close button minimizes to tray</value></data>
@@ -77,6 +77,9 @@
<data name="Settings_WebpQuality" xml:space="preserve"><value>Chất lượng WebP</value></data>
<data name="Settings_OutputFolder" xml:space="preserve"><value>Thư mục lưu</value></data>
<data name="Settings_OutputFolderDefault" xml:space="preserve"><value>(mặc định: Pictures\CaptureImage)</value></data>
<data name="Settings_Browse" xml:space="preserve"><value>Duyệt…</value></data>
<data name="Settings_BrowseTitle" xml:space="preserve"><value>Chọn thư mục lưu</value></data>
<data name="Settings_BrowseTooltip" xml:space="preserve"><value>Chọn thư mục thay vì phải gõ đường dẫn.</value></data>
<data name="Settings_FileNameTemplate" xml:space="preserve"><value>Mẫu tên tệp</value></data>
<data name="Settings_PreviewBeforeSave" xml:space="preserve"><value>Xem trước từng ảnh chụp trước khi lưu</value></data>
<data name="Settings_MinimizeToTray" xml:space="preserve"><value>Nút đóng sẽ thu nhỏ xuống tray</value></data>
+10 -2
View File
@@ -61,8 +61,16 @@
<!-- Output folder -->
<StackPanel Spacing="4">
<TextBlock Text="{Binding Localization[Settings_OutputFolder]}" Foreground="{DynamicResource SystemControlForegroundBaseMediumBrush}" FontSize="12" />
<TextBox Text="{Binding OutputDirectory, Mode=TwoWay}"
Watermark="{Binding Localization[Settings_OutputFolderDefault]}" />
<Grid ColumnDefinitions="*,8,Auto">
<TextBox Grid.Column="0"
Text="{Binding OutputDirectory, Mode=TwoWay}"
Watermark="{Binding Localization[Settings_OutputFolderDefault]}" />
<Button Grid.Column="2"
Name="BrowseOutputButton"
Content="{Binding Localization[Settings_Browse]}"
ToolTip.Tip="{Binding Localization[Settings_BrowseTooltip]}"
MinWidth="100" />
</Grid>
</StackPanel>
<!-- File name template -->
@@ -15,6 +15,7 @@ public partial class SettingsView : UserControl
var importButton = this.FindControl<Button>("ImportButton");
var exportButton = this.FindControl<Button>("ExportButton");
var browseOutputButton = this.FindControl<Button>("BrowseOutputButton");
if (importButton is not null)
{
@@ -24,6 +25,51 @@ public partial class SettingsView : UserControl
{
exportButton.Click += OnExportClick;
}
if (browseOutputButton is not null)
{
browseOutputButton.Click += OnBrowseOutputClick;
}
}
private async void OnBrowseOutputClick(object? sender, RoutedEventArgs e)
{
if (DataContext is not SettingsViewModel vm) return;
var top = TopLevel.GetTopLevel(this);
if (top is null) return;
// Seed the picker at whatever the user has configured (or the system default if
// the field is empty). Failing to resolve the suggested start is non-fatal — the
// picker falls back to its own default.
IStorageFolder? suggestedStart = null;
if (!string.IsNullOrWhiteSpace(vm.OutputDirectory))
{
try
{
suggestedStart = await top.StorageProvider.TryGetFolderFromPathAsync(vm.OutputDirectory);
}
catch
{
// Ignore — start elsewhere.
}
}
var folders = await top.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
{
Title = vm.Localization["Settings_BrowseTitle"],
AllowMultiple = false,
SuggestedStartLocation = suggestedStart,
});
if (folders.Count == 0) return;
var path = folders[0].TryGetLocalPath();
if (!string.IsNullOrEmpty(path))
{
// Two-way binding pushes back into AppSettings through the
// OnOutputDirectoryChanged partial handler in the VM.
vm.OutputDirectory = path;
}
}
private async void OnImportClick(object? sender, RoutedEventArgs e)
@@ -25,6 +25,18 @@ public sealed partial class AboutViewModel : ViewModelBase
Localization = localization;
_logger = logger;
// About view binds every label through `{Binding Localization[About_*]}`. Push an
// explicit PropertyChanged on culture switch so the compiled indexer bindings
// re-resolve their path — the Localization service's own Item[] notification
// isn't picked up through the intermediate property in every case.
Localization.PropertyChanged += (_, e) =>
{
if (e.PropertyName is "Item[]" or nameof(ILocalizationService.CurrentCulture))
{
OnPropertyChanged(nameof(Localization));
}
};
var asm = typeof(AboutViewModel).Assembly;
AppVersion = asm.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion
?? asm.GetName().Version?.ToString()
@@ -120,6 +120,10 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
OnPropertyChanged(nameof(TargetsCountText));
OnPropertyChanged(nameof(LoadingText));
OnPropertyChanged(nameof(EmptyStateText));
// Forces `{Binding Localization[Key]}` bindings on DashboardView to
// re-resolve the indexer path in-place (Title, Subtitle, Refresh / Arm /
// Disarm button labels). See v1.1.1 hotfix notes.
OnPropertyChanged(nameof(Localization));
}
};
@@ -52,6 +52,10 @@ public sealed partial class LogViewerViewModel : ViewModelBase
OnPropertyChanged(nameof(TogglePauseLabel));
OnPropertyChanged(nameof(EventsCountText));
OnPropertyChanged(nameof(EmptyStateText));
// Refresh the `{Binding Localization[Log_Title]}` / `[Log_Clear]` direct
// indexer bindings in the header. v1.1.1 hotfix — the service's own
// Item[] notification alone doesn't reliably re-resolve the path.
OnPropertyChanged(nameof(Localization));
}
};
@@ -88,6 +88,20 @@ public sealed partial class MainWindowViewModel : ViewModelBase
// Activate the first item by default.
SelectedNavItem = NavItems[0];
// `{Binding Localization[Nav_LogViewer]}` on the log drawer toggle (and AppTitle /
// AppVersion / tooltip bindings) need an explicit poke at the VM level when
// culture changes — Avalonia's compiled indexer binding through an intermediate
// property doesn't always refresh on the service's own Item[] notification.
Localization.PropertyChanged += OnLocalizationChanged;
}
private void OnLocalizationChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName is "Item[]" or nameof(ILocalizationService.CurrentCulture))
{
OnPropertyChanged(nameof(Localization));
}
}
partial void OnSelectedNavItemChanged(NavItemViewModel? value)
@@ -80,6 +80,9 @@ public sealed partial class HotkeyBindingViewModel : ViewModelBase, IDisposable
if (e.PropertyName is "Item[]" or nameof(ILocalizationService.CurrentCulture))
{
OnPropertyChanged(nameof(ErrorMessage));
// Bubbles through to the `{Binding Localization[Settings_Hotkey*]}` bindings
// in HotkeyRecorder.axaml so prompt + conflict-warning text refresh live.
OnPropertyChanged(nameof(Localization));
}
}
@@ -80,6 +80,22 @@ public sealed partial class SettingsViewModel : ViewModelBase
Hydrate();
_settings.Changed += (_, _) => Hydrate();
// Raise OnPropertyChanged(nameof(Localization)) on culture switch so every
// `{Binding Localization[Key]}` in SettingsView re-resolves the full path and
// picks up the new translation in-place. The service's own "Item[]" INPC fires,
// but Avalonia's compiled indexer bindings through an intermediate property do
// not always listen to that; bumping the property name at the VM level forces
// re-evaluation and matches the pattern used by NavItemViewModel.
Localization.PropertyChanged += OnLocalizationChanged;
}
private void OnLocalizationChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName is "Item[]" or nameof(ILocalizationService.CurrentCulture))
{
OnPropertyChanged(nameof(Localization));
}
}
private CultureInfo? FindCulture(string name)
@@ -56,6 +56,21 @@ public sealed partial class UpdateViewModel : ViewModelBase, IDisposable
_currentVersion = _updateService.CurrentVersion;
_updateService.LogEmitted += OnLogEmitted;
// Force `{Binding Localization[Update_*]}` bindings to refresh when the user
// switches language from Settings while the Update tab is already active —
// the service's Item[] notification alone isn't reliably picked up by
// compiled indexer bindings through the intermediate Localization property.
Localization.PropertyChanged += OnLocalizationChanged;
}
private void OnLocalizationChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (_disposed) return;
if (e.PropertyName is "Item[]" or nameof(ILocalizationService.CurrentCulture))
{
OnPropertyChanged(nameof(Localization));
}
}
public bool CanCheck => !IsBusy;
@@ -171,5 +186,6 @@ public sealed partial class UpdateViewModel : ViewModelBase, IDisposable
if (_disposed) return;
_disposed = true;
_updateService.LogEmitted -= OnLogEmitted;
Localization.PropertyChanged -= OnLocalizationChanged;
}
}