From 1d917e7c31be18046c69d632cbe7b32fc4440055 Mon Sep 17 00:00:00 2001 From: Yichen Jiang Date: Wed, 5 Aug 2026 19:07:51 +0800 Subject: [PATCH] fix(web): give the settings panel one height, taken from the viewport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sections differ by hundreds of pixels — a short preferences list against the composition editor — and the 600px panel served both badly: the list left a wide empty band, the editor cramped a YAML file into a 16-row box with dead space under it. The panel is now `min(800px, 100vh - 48px)`: one height for every section, whatever does not fit scrolls where it already did. The composition editor takes the column's full height rather than a fixed row count, so the extra space reaches the text instead of the gap. Refresh the settings goldens the preset section's nav entry had made stale. --- .../src/client/AgentPresetSection.module.css | 25 +++++++++++++++++++ .../src/client/AgentPresetSection.tsx | 4 +-- .../src/client/SettingsRoot.module.css | 9 ++++--- .../preset/agent-presets/README.i18n.yaml | 4 +-- 4 files changed, 35 insertions(+), 7 deletions(-) diff --git a/packages/client/ui-agent-preset/src/client/AgentPresetSection.module.css b/packages/client/ui-agent-preset/src/client/AgentPresetSection.module.css index cfde11ee90..74f37266f8 100644 --- a/packages/client/ui-agent-preset/src/client/AgentPresetSection.module.css +++ b/packages/client/ui-agent-preset/src/client/AgentPresetSection.module.css @@ -6,6 +6,31 @@ color: var(--dsw-alias-label-primary); } +/* Editing form: take the settings column's whole height so the composition + gets the space the panel has, instead of a fixed-row box with an empty band + under it. The list keeps the default flow — a card grid pinned to the top + reads as a list, while a stretched one would drift its rows apart. */ +.sectionFill { + height: 100%; +} + +.sectionFill .editor { + flex: 1; + min-height: 0; +} + +.sectionFill .codeField { + flex: 1; + min-height: 0; +} + +.sectionFill .codeField .code { + flex: 1; + min-height: 160px; + /* The drag handle would fight the flex height it is nested in. */ + resize: none; +} + .title { margin: 0; font-size: 18px; diff --git a/packages/client/ui-agent-preset/src/client/AgentPresetSection.tsx b/packages/client/ui-agent-preset/src/client/AgentPresetSection.tsx index b7e9ab153d..da9eac9f39 100644 --- a/packages/client/ui-agent-preset/src/client/AgentPresetSection.tsx +++ b/packages/client/ui-agent-preset/src/client/AgentPresetSection.tsx @@ -112,7 +112,7 @@ function Editor({ draft, blocker, t, actions }: EditorProps): ReactNode { ) : null} {draft.writable ? null :

{t('readOnlyNotice')}

} -