From 3e5da3f55fe2b1085d98392d9f76b6152f19da2b Mon Sep 17 00:00:00 2001 From: adnan-bhaldar Date: Wed, 2 Dec 2026 11:34:48 +0530 Subject: [PATCH 1/4] feat(theme): choose how long the progress ring stays Add Settings -> Theme -> Progress ring -> "Show the ring for", four buttons in the style of the Light / Dark / System buttons: 5 seconds (default), 10 seconds, 15 seconds and Always. Always keeps the ring until the conversion ends, so the progress card does not open for that job. A failed conversion, Esc, a click elsewhere or a new drag still hand the job to the progress card. A missing or unknown value reads as 5 seconds, so settings from before need no schema step. Co-authored-by: Claude --- CHANGELOG.md | 10 ++- src/Filee.App/Assets/i18n/ar.json | 6 ++ src/Filee.App/Assets/i18n/bn-BD.json | 6 ++ src/Filee.App/Assets/i18n/de.json | 6 ++ src/Filee.App/Assets/i18n/en.json | 6 ++ src/Filee.App/Assets/i18n/es.json | 6 ++ src/Filee.App/Assets/i18n/fa.json | 6 ++ src/Filee.App/Assets/i18n/fr.json | 6 ++ src/Filee.App/Assets/i18n/hi.json | 6 ++ src/Filee.App/Assets/i18n/id.json | 6 ++ src/Filee.App/Assets/i18n/it.json | 6 ++ src/Filee.App/Assets/i18n/ja.json | 6 ++ src/Filee.App/Assets/i18n/ko.json | 6 ++ src/Filee.App/Assets/i18n/mn.json | 6 ++ src/Filee.App/Assets/i18n/ne.json | 6 ++ src/Filee.App/Assets/i18n/pl.json | 6 ++ src/Filee.App/Assets/i18n/pt-BR.json | 6 ++ src/Filee.App/Assets/i18n/pt-PT.json | 6 ++ src/Filee.App/Assets/i18n/ru.json | 6 ++ src/Filee.App/Assets/i18n/th.json | 6 ++ src/Filee.App/Assets/i18n/tr.json | 6 ++ src/Filee.App/Assets/i18n/vi.json | 6 ++ src/Filee.App/Assets/i18n/zh-CN.json | 6 ++ src/Filee.App/Assets/i18n/zh-TW.json | 6 ++ src/Filee.App/Services/RadialController.cs | 18 +++-- src/Filee.App/Styles/Icons.axaml | 2 + .../ViewModels/Pages/ThemePageViewModel.cs | 17 ++++ src/Filee.App/Views/Pages/ThemePage.axaml | 59 ++++++++++++++ src/Filee.Core/Settings/AppSettings.cs | 18 +++++ .../Filee.App.Tests/ProgressRingTimeTests.cs | 79 +++++++++++++++++++ .../Filee.App.Tests/RadialControllerTests.cs | 13 +++ .../ProgressRingSettingsTests.cs | 39 +++++++++ 32 files changed, 387 insertions(+), 6 deletions(-) create mode 100644 tests/Filee.App.Tests/ProgressRingTimeTests.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 64f25f35f..d0b59bbaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -114,6 +114,8 @@ ko: 3D Studio 모델(.3ds)을 OBJ, GLB, STL 같은 3D 형식이나 PNG 미리보 en: 3D Studio models (.3ds) convert to OBJ, GLB, STL and the other 3D formats, and to a PNG preview ko: PDF·Word·웹 페이지의 표를 Excel로 바꿀 때 머리글 병합은 남기고 여러 행에 걸친 분류는 행마다 채우도록 고를 수 있어서 필터와 피벗 테이블에 쓰기 좋아요 (새 프리셋의 기본값) en: Tables from PDF, Word and web pages can keep their header merges in Excel and fill categories into every row, ready for filters and pivot tables (new presets do this by default) +ko: 설정 → 테마의 진행 링 카드에서 링을 보여 주는 시간(5·10·15초 또는 항상)을 고를 수 있어요 +en: The progress ring's time at the cursor (5, 10, 15 seconds or Always) can be set in Settings → Theme --> - **No update notice over full-screen games** (#1897). The "new version" card in the bottom-right corner could appear @@ -500,6 +502,12 @@ en: Tables from PDF, Word and web pages can keep their header merges in Excel an belong to the Maps field (off by default in Settings → Fields), and any PNG preset can pick the colour ramp in its editor while Maps is on. +- **Choose how long the progress ring stays** (by @adnan-bhaldar). After a drop, the ring at your cursor used to give + way to the progress card at the bottom right after 5 seconds. In **Settings → Theme**, the *Progress ring* card now + has **Show the ring for**, four buttons: **5 seconds** (as before, and still the default), **10 seconds**, + **15 seconds** and **Always**. With *Always* the ring stays until the conversion ends and the card doesn't open for + that job. A failed conversion, Esc, a click elsewhere or a new drag still hand the job to the progress card. + ## 2.5.0 + + + + + + + + + + diff --git a/src/Filee.Core/Settings/AppSettings.cs b/src/Filee.Core/Settings/AppSettings.cs index 6e1f5824e..b03996c66 100644 --- a/src/Filee.Core/Settings/AppSettings.cs +++ b/src/Filee.Core/Settings/AppSettings.cs @@ -77,6 +77,24 @@ public sealed class ThemeSettings /// public ProgressRingStyle ProgressRing { get; set; } = ProgressRingStyle.Arc; + /// The seconds the progress ring stays at the cursor, unless the user changes it. + public const int DefaultProgressRingSeconds = 5; + + /// The choices Settings → Theme offers for , in the order shown (0 = always). + public static readonly IReadOnlyList ProgressRingSecondsChoices = [DefaultProgressRingSeconds, 10, 15, 0]; + + /// + /// How long the donut's progress ring stays at the cursor while a conversion runs, before the progress card at the + /// bottom right takes over: 5, 10 or 15 seconds, or 0 to keep the ring until the job finishes. A missing value + /// (settings from before it) reads as 5, today's time, so it needs no schema step. Any other number (a hand-edited + /// file) also reads as 5. + /// + public int ProgressRingSeconds { get; set; } = DefaultProgressRingSeconds; + + /// The value stands for: itself when it is one of the choices, else 5. + public static int NormalizeProgressRingSeconds(int seconds) => + ProgressRingSecondsChoices.Contains(seconds) ? seconds : DefaultProgressRingSeconds; + public ThemeSettings Clone() => (ThemeSettings)MemberwiseClone(); } diff --git a/tests/Filee.App.Tests/ProgressRingTimeTests.cs b/tests/Filee.App.Tests/ProgressRingTimeTests.cs new file mode 100644 index 000000000..85116a0be --- /dev/null +++ b/tests/Filee.App.Tests/ProgressRingTimeTests.cs @@ -0,0 +1,79 @@ +// The "Show the ring for" buttons on the Theme page (Settings → Theme → Progress ring): 5 seconds is on to begin with, +// each button saves its choice and is the only one marked on, and a saved choice is on when the page opens again. + +using Avalonia.Headless.XUnit; +using Filee.App.Services; +using Filee.App.ViewModels.Pages; +using Filee.Core.Localization; +using Filee.Core.Platform; +using Filee.Core.Settings; + +namespace Filee.App.Tests; + +public class ProgressRingTimeTests +{ + private static ThemePageViewModel NewPage(UserDataStore store) => + new(store, AppHost.Get(), AppHost.Get()); + + [AvaloniaFact] + public void The_ring_time_buttons_save_their_choice_and_mark_only_the_one_that_is_on() + { + TestServices.EnsureInitialized("en"); + var directory = Directory.CreateTempSubdirectory("filee-ring-time-").FullName; + try + { + var store = new UserDataStore(directory); + store.Load(); + var vm = NewPage(store); + + // Nothing changes for anyone who doesn't touch it: 5 seconds. + Assert.Equal(5, vm.ProgressRingSeconds); + Assert.True(vm.IsRing5); + Assert.False(vm.IsRing10 || vm.IsRing15 || vm.IsRingAlways); + + vm.SetProgressRingSecondsCommand.Execute("10"); + Assert.Equal(10, store.Settings.Theme.ProgressRingSeconds); + Assert.True(vm.IsRing10); + Assert.False(vm.IsRing5 || vm.IsRing15 || vm.IsRingAlways); + + vm.SetProgressRingSecondsCommand.Execute("15"); + Assert.Equal(15, store.Settings.Theme.ProgressRingSeconds); + Assert.True(vm.IsRing15); + + vm.SetProgressRingSecondsCommand.Execute("0"); + Assert.Equal(0, store.Settings.Theme.ProgressRingSeconds); + Assert.True(vm.IsRingAlways); + Assert.False(vm.IsRing5 || vm.IsRing10 || vm.IsRing15); + + // Saved to settings.json: the page opens with Always on after a restart. + var reloaded = new UserDataStore(directory); + reloaded.Load(); + Assert.True(NewPage(reloaded).IsRingAlways); + } + finally + { + Directory.Delete(directory, true); + } + } + + [AvaloniaFact] + public void A_ring_time_that_is_not_offered_opens_as_5_seconds() + { + TestServices.EnsureInitialized("en"); + var directory = Directory.CreateTempSubdirectory("filee-ring-time-").FullName; + try + { + var store = new UserDataStore(directory); + store.Load(); + store.Settings.Theme.ProgressRingSeconds = 7; // a hand-edited settings.json + var vm = NewPage(store); + + Assert.Equal(5, vm.ProgressRingSeconds); + Assert.True(vm.IsRing5); + } + finally + { + Directory.Delete(directory, true); + } + } +} diff --git a/tests/Filee.App.Tests/RadialControllerTests.cs b/tests/Filee.App.Tests/RadialControllerTests.cs index 4a6e5cc83..2268ae6d0 100644 --- a/tests/Filee.App.Tests/RadialControllerTests.cs +++ b/tests/Filee.App.Tests/RadialControllerTests.cs @@ -392,6 +392,19 @@ public void A_later_launch_does_not_join_a_donut_that_is_closed_or_open_for_some } } + [Theory] + [InlineData(5, 5)] + [InlineData(10, 10)] + [InlineData(15, 15)] + [InlineData(7, 5)] // not one of the choices (a hand-edited file): today's 5 seconds + [InlineData(-1, 5)] + public void The_ring_hands_over_to_the_progress_card_after_the_time_chosen(int setting, int seconds) => + Assert.Equal(TimeSpan.FromSeconds(seconds), RadialController.HandOffDelay(setting)); + + [Fact] + public void Always_keeps_the_ring_until_the_job_ends_so_no_hand_off_timer_starts() => + Assert.Null(RadialController.HandOffDelay(0)); + [Fact] public void Folder_archive_presets_keep_folders_while_image_presets_take_only_files() { diff --git a/tests/Filee.Core.Tests/ProgressRingSettingsTests.cs b/tests/Filee.Core.Tests/ProgressRingSettingsTests.cs index 018e90888..a0260c3f4 100644 --- a/tests/Filee.Core.Tests/ProgressRingSettingsTests.cs +++ b/tests/Filee.Core.Tests/ProgressRingSettingsTests.cs @@ -38,4 +38,43 @@ public void Settings_from_before_it_keep_the_arc_and_the_choice_is_saved() Assert.Equal("#1D9E75", reloaded.Settings.Theme.Accent); Assert.Equal(ProgressRingStyle.Ticks, reloaded.Settings.Theme.Clone().ProgressRing); } + + [Fact] + public void New_settings_keep_the_ring_for_5_seconds() + { + using var dir = new TempDir(); + Assert.Equal(5, NewStore(dir).Settings.Theme.ProgressRingSeconds); + } + + [Fact] + public void Settings_from_before_the_ring_time_read_5_seconds_and_the_choice_is_saved() + { + using var dir = new TempDir(); + File.WriteAllText(Path.Combine(dir.Path, "settings.json"), + $$"""{ "schemaVersion": {{AppSettings.CurrentSchemaVersion}}, "theme": { "cornerRadius": 8, "progressRing": "Ticks" } }"""); + var store = NewStore(dir); + Assert.Equal(5, store.Settings.Theme.ProgressRingSeconds); + Assert.Equal(ProgressRingStyle.Ticks, store.Settings.Theme.ProgressRing); + + foreach (var seconds in new[] { 10, 15, 0 }) + { + store.Settings.Theme.ProgressRingSeconds = seconds; + store.SaveSettings(); + var reloaded = NewStore(dir); + Assert.Equal(seconds, reloaded.Settings.Theme.ProgressRingSeconds); + Assert.Equal(seconds, reloaded.Settings.Theme.Clone().ProgressRingSeconds); + Assert.Equal(ProgressRingStyle.Ticks, reloaded.Settings.Theme.ProgressRing); + } + } + + [Theory] + [InlineData(5, 5)] + [InlineData(10, 10)] + [InlineData(15, 15)] + [InlineData(0, 0)] + [InlineData(-3, 5)] + [InlineData(7, 5)] + [InlineData(600, 5)] + public void Only_the_offered_ring_times_are_kept(int stored, int expected) => + Assert.Equal(expected, ThemeSettings.NormalizeProgressRingSeconds(stored)); } From be0cd3652049fd88c6fb78f166444c707b23f6dc Mon Sep 17 00:00:00 2001 From: adnan-bhaldar Date: Wed, 2 Dec 2026 15:49:11 +0530 Subject: [PATCH 2/4] test(theme): count only the Appearance buttons in the mode test The progress ring's time buttons use the same mode-btn style as the System / Light / Dark buttons, so the test counted 7 instead of 3. Count only the buttons that hold a theme mode. Co-authored-by: Claude --- tests/Filee.App.Tests/ThemePageTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Filee.App.Tests/ThemePageTests.cs b/tests/Filee.App.Tests/ThemePageTests.cs index 15b53a778..dea6b24b5 100644 --- a/tests/Filee.App.Tests/ThemePageTests.cs +++ b/tests/Filee.App.Tests/ThemePageTests.cs @@ -125,7 +125,8 @@ public void Appearance_buttons_switch_the_mode_and_mark_the_one_that_is_on() window.Show(); RenderTests.Pump(); - var buttons = page.GetVisualDescendants().OfType