Added a setting to change the size of the interface (#1136)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
Paul KoudelkaandThorsten Sommer authored and GitHub committed 2026-10-30 20:01:57 +01:00
1 parent c2b62c6dbd
commit e0337a99bc
27 files changed
+1742 -27

No files matched your search

@@ -66,6 +66,49 @@ public sealed class DataApp(Expression<Func<Data, DataApp>>? configSelection = n
/// </summary>
public StartPage StartPage { get; set; } = ManagedConfiguration.Register(configSelection, n => n.StartPage, StartPage.HOME);
/// <summary>
/// How large AI Studio shows its interface on the screens the user chose a size for, the most
/// recently set first.
/// </summary>
/// <remarks>
/// Kept per screen, as the operating systems keep their scaling per monitor: a laptop calls for
/// another size than an external monitor, and the same scale looks different on screens of
/// different densities. A screen missing here gets InterfaceSize.APP_DEFAULT when it is the
/// screen of a laptop, and InterfaceSize.SYSTEM_SCALING otherwise. The
/// user's own, like the scaling of the operating system: no configuration plugin manages it.
/// </remarks>
public List<InterfaceScreenSize> InterfaceScreenSizes { get; set; } = [];
/// <summary>
/// How many screens keep their interface size. Setting the size of one more forgets the screen
/// whose size was set the longest time ago, which then gets its default size again.
/// </summary>
public const int MAX_REMEMBERED_INTERFACE_SCREENS = 20;
/// <summary>
/// What the user chose for the given screen, or null when they chose nothing for it.
/// </summary>
/// <param name="screenKey">The screen, as the runtime names it.</param>
public InterfaceScreenSize? GetInterfaceScreenSize(string screenKey) => this.InterfaceScreenSizes.FirstOrDefault(screen => screen.ScreenKey == screenKey);
/// <summary>
/// Remembers what the user chose for a screen, as the most recently set one.
/// </summary>
/// <remarks>
/// Keeps MAX_REMEMBERED_INTERFACE_SCREENS screens at most and forgets the ones beyond, those whose
/// size was set the longest time ago. Replaces the list instead of changing it, since the
/// InterfaceSizeService may read it at the same time.
/// </remarks>
/// <param name="screenSize">What the user chose for the screen.</param>
public void RememberInterfaceScreenSize(InterfaceScreenSize screenSize)
{
this.InterfaceScreenSizes = this.InterfaceScreenSizes
.Where(screen => screen.ScreenKey != screenSize.ScreenKey)
.Prepend(screenSize)
.Take(MAX_REMEMBERED_INTERFACE_SCREENS)
.ToList();
}
/// <summary>
/// Whether an alert dialog should be shown when prompt-injection content is blocked.
/// </summary>