app: burn-up window charts, estimated days, full breakdown, one tooltip
agent-review agent review: fail
agent-review agent review: fail
From developer feedback on the redesign: - Week use per day draws estimated days hatched beside measured ones. - Limit history becomes a burn-up chart per window instance: even-pace diagonal, used line without point markers, forecast to the reset, the previous instance faintly, and a strip of past peaks with their real start and end. - The breakdown has its detail columns back, sorts by any column and expands "Other" to every row. - One tooltip component, a title and a label/value grid, for every chart and table. Also the review notes of #7: dated forecasts, the real span of the recent rate, keyboard focus, distinct settings names, a wheel that no longer changes selections, and version 1.1.0. Refs #5, #7
This commit is contained in:
@@ -8,7 +8,7 @@ namespace FinalToken.App;
|
||||
|
||||
public sealed class SettingsWindow : Window
|
||||
{
|
||||
public SettingsWindow(Settings initial, PluginInstallStatus status, Func<Settings, Task> save, Action? quit = null)
|
||||
public SettingsWindow(Settings initial, PluginInstallStatus status, Func<Settings, Task> save, Action? quit = null, Action<string>? openFolder = null)
|
||||
{
|
||||
Title = "FinalToken settings"; Width = 760; Height = 900; MinWidth = 600; MinHeight = 500; Ui.Theme(this);
|
||||
var body = new StackPanel { Spacing = 16, Margin = new Thickness(24) };
|
||||
@@ -42,7 +42,8 @@ public sealed class SettingsWindow : Window
|
||||
{
|
||||
try
|
||||
{
|
||||
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(DataPaths.DataDirectory) { UseShellExecute = true });
|
||||
if (openFolder is not null) openFolder(DataPaths.DataDirectory);
|
||||
else System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(DataPaths.DataDirectory) { UseShellExecute = true });
|
||||
}
|
||||
catch (Exception e) when (e is IOException or UnauthorizedAccessException or System.ComponentModel.Win32Exception or InvalidOperationException)
|
||||
{ error.Text = "Could not open the data folder."; }
|
||||
@@ -83,7 +84,7 @@ public sealed class SettingsWindow : Window
|
||||
}
|
||||
private static CheckBox Check(StackPanel parent, string label, bool value)
|
||||
{
|
||||
var c = new CheckBox { Content = label, IsChecked = value, Name = label.Replace(" ", "") }; parent.Children.Add(c); return c;
|
||||
var c = new NeutralCheckBox { Content = label, IsChecked = value, Name = label.Replace(" ", "") }; parent.Children.Add(c); return c;
|
||||
}
|
||||
private static Func<ProviderSettings, ProviderSettings> PopupControls(StackPanel parent, string name, ProviderSettings config)
|
||||
{
|
||||
@@ -91,12 +92,14 @@ public sealed class SettingsWindow : Window
|
||||
row.Children.Add(Ui.Text(name));
|
||||
var enabled = Check(row, "Popups enabled", config.PopupsEnabled);
|
||||
var ahead = Check(row, "Ahead", config.PopupAhead); var behind = Check(row, "Behind", config.PopupBehind);
|
||||
foreach (var c in row.Children.OfType<CheckBox>()) c.Name = name + c.Name;
|
||||
parent.Children.Add(row);
|
||||
return value => value with { PopupsEnabled = enabled.IsChecked == true, PopupAhead = ahead.IsChecked == true, PopupBehind = behind.IsChecked == true };
|
||||
}
|
||||
private static Func<ProviderSettings> ProviderControls(StackPanel parent, string name, ProviderSettings config)
|
||||
{
|
||||
parent.Children.Add(Ui.Text(name)); var enabled = Check(parent, "Enabled", config.Enabled);
|
||||
enabled.Name = name + "Enabled";
|
||||
parent.Children.Add(Ui.Text("CLI path (empty uses PATH)", 12, "Secondary"));
|
||||
var path = new TextBox { Name = name + "CliPath", Text = config.CliPath ?? "" }; parent.Children.Add(path);
|
||||
return () => config with { Enabled = enabled.IsChecked == true, CliPath = string.IsNullOrWhiteSpace(path.Text) ? null : path.Text.Trim() };
|
||||
|
||||
Reference in New Issue
Block a user