From c946b3c347e31428685687f24b44630a50cc697e Mon Sep 17 00:00:00 2001 From: Alessandro <155005371+3clyp50@users.noreply.github.com> Date: Tue, 13 Oct 2026 14:57:02 +0200 Subject: [PATCH] fix(model-config): keep selector menus within viewport Cap preset and agent profile menus to the space above the selector when opening or resizing the window. Keep the full scroll track reachable without changing its width, and preserve shared overflow positioning. Add browser regression coverage for short viewports, resize, native scrollbar dragging, wheel scrolling, and preset selection through overflow. Update the plugin contracts and README. Validation: 11 focused tests passed; live UI verified at localhost:32081. --- plugins/_model_config/AGENTS.md | 1 + plugins/_model_config/README.md | 2 +- .../model-switcher.html | 18 +++- tests/test_webui_overflow.py | 102 ++++++++++++++++++ 4 files changed, 119 insertions(+), 4 deletions(-) diff --git a/plugins/_model_config/AGENTS.md b/plugins/_model_config/AGENTS.md index 4b1b7dda5..020c73f21 100644 --- a/plugins/_model_config/AGENTS.md +++ b/plugins/_model_config/AGENTS.md @@ -39,6 +39,7 @@ - Presets may change outside the editor, so the `open_modal_before` hook reloads them before every preset-editor open, including `/presets`, and resolves the chat's active preset unless `openPresetEditor()` pinned one. - The preset editor maps each model provider's API-key field to the shared API-key store; saving the editor persists dirty keys separately and never writes secrets into preset YAML. - The compact chat selector label combines the effective preset with only the leaf name of its main model; utility and provider text stay out of the closed selector. +- Preset and agent-profile menus cap their height to the space above the selector on opening and window resize, keeping the full scroll track inside the viewport. Overflow submenus retain the shared `x-overflow` positioning limits. - The compact selector strip exposes `model-context-strip-end` after the agent profile selector so adjacent bundled controls can stay plugin-owned. - The selector strip uses the shared `x-overflow` directive for built-in and plugin controls. Its root must remain shrinkable; overflow entries open the original selector panels and retain their Alpine state. The profile avatar uses `data-overflow-icon` so its color, initials, or image also appear in overflow. diff --git a/plugins/_model_config/README.md b/plugins/_model_config/README.md index b4542fba1..a9c21f114 100644 --- a/plugins/_model_config/README.md +++ b/plugins/_model_config/README.md @@ -31,7 +31,7 @@ The normal plugin resolution order selects the most specific available reference - Agent Settings shows the global selection, its three resolved models, and actions for preset editing, API keys, and per-project/agent settings. - The full plugin settings modal uses the generic scope selector and stores only the chosen preset at that scope. -- The closed chat switcher shows the effective preset plus the main model's short name; its menu supports a chat-only selection or returning to the scoped preset. +- The closed chat switcher shows the effective preset plus the main model's short name; its menu supports a chat-only selection or returning to the scoped preset. Preset and profile menus shrink to fit short windows so the full scroll track stays reachable. - The adjacent profile switcher shows the active agent's effective title and avatar and links to Create, Edit, and Manage agents. - The preset editor exposes the shared API key for each selected provider and saves key changes separately from secret-free preset definitions. - Project Settings selects from the same global preset definitions. diff --git a/plugins/_model_config/extensions/webui/chat-input-progress-start/model-switcher.html b/plugins/_model_config/extensions/webui/chat-input-progress-start/model-switcher.html index da6db099c..f5ad0a6cc 100644 --- a/plugins/_model_config/extensions/webui/chat-input-progress-start/model-switcher.html +++ b/plugins/_model_config/extensions/webui/chat-input-progress-start/model-switcher.html @@ -5,7 +5,15 @@