From 693e2a788f4543595f6ec7af9908fdd98a255b20 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Thu, 12 Nov 2026 10:29:19 +0100 Subject: [PATCH] fix(dashboard): the target editor fits the window, in sections (#987) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "Prüfobjekt bearbeiten" dialog was taller than a laptop window and could not scroll, so its title and Save were out of reach; at 480px its add-reference row squeezed five controls into one line. Dialogs now stop at the window height and scroll, with the actions pinned at the bottom. The target editor is 680px wide and split into sections (artefacts, add a file, exclusions, projects); adding a reference puts kind and reference on one line and branch, token and the button on the next; the upload's archive password gets its own line; the project picker reads as a section inside a dialog. Co-Authored-By: Claude Opus 5.5 --- compliance-dashboard/assets/main.css | 110 +++++++++++++++++- .../src/components/artifact_upload.rs | 2 +- compliance-dashboard/src/pages/target.rs | 27 +++-- 3 files changed, 126 insertions(+), 13 deletions(-) diff --git a/compliance-dashboard/assets/main.css b/compliance-dashboard/assets/main.css index 435e4c9..783f188 100644 --- a/compliance-dashboard/assets/main.css +++ b/compliance-dashboard/assets/main.css @@ -1325,6 +1325,108 @@ tbody tr:last-child td { margin-top: 20px; } +/* A dialog never grows past the window: its content scrolls, and the actions + stay pinned at the bottom so Save is always reachable. */ +.modal-dialog { + max-height: calc(100vh - 32px); + max-height: calc(100dvh - 32px); + overflow-y: auto; + overscroll-behavior: contain; +} + +.modal-dialog .modal-actions { + position: sticky; + bottom: -18px; + margin: 20px -18px -18px; + padding: 12px 18px; + background: var(--bg-card-solid); + border-top: 1px solid var(--border); +} + +/* Forms with sections (the target editor). */ +.modal-dialog.modal-wide { + max-width: 680px; +} + +.modal-section { + border-top: 1px solid var(--border); + margin-top: 16px; + padding-top: 14px; +} + +.modal-section > .target-subhead { + margin-top: 0; +} + +/* A stored artifact: its reference, token state and actions on one line. */ +.artifact-row { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 8px; + padding: 6px 0; +} + +.artifact-row-ref { + flex: 1 1 100%; + font-size: 13px; + overflow-wrap: anywhere; +} + +.form-fields .artifact-row input { + flex: 1 1 200px; + width: auto; +} + +/* Adding a reference: kind and reference on one line, branch, token and the + button on the next, all filling the width. */ +.artifact-add { + display: flex; + flex-wrap: wrap; + align-items: flex-end; + gap: 10px; + margin-top: 10px; +} + +.artifact-add .form-group { + margin: 0; +} + +.artifact-add-kind { + flex: 1 1 200px; +} + +.artifact-add-ref { + flex: 1 1 280px; +} + +.artifact-add-branch { + flex: 1 1 160px; +} + +.artifact-add-token { + flex: 1 1 200px; +} + +/* Inside a dialog the project picker is a section like the others, not a + framed box. */ +.modal-dialog .project-picker { + margin: 0; + padding: 0; + border: 0; +} + +.modal-dialog .project-picker legend { + padding: 0; + margin-bottom: 6px; + font-family: var(--font-mono); + font-size: 11px; + font-weight: 500; + letter-spacing: 0.06em; + text-transform: uppercase; + color: var(--text-tertiary); +} + /* The portal's default button: surface, hairline border. */ .btn-secondary { background: var(--bg-card); @@ -5803,13 +5905,19 @@ tbody tr:last-child td { .artifact-upload-row .form-group { margin: 0; min-width: 160px; + flex: 1 1 200px; } .artifact-upload-file { - flex: 1; + flex: 2 1 260px; min-width: 220px; } +/* The archive password gets its own line: its label is long. */ +.artifact-upload-row .artifact-upload-password { + flex: 1 1 100%; +} + .artifact-upload-note { font-size: 12.5px; color: var(--success); diff --git a/compliance-dashboard/src/components/artifact_upload.rs b/compliance-dashboard/src/components/artifact_upload.rs index 6e8bfaa..f69e888 100644 --- a/compliance-dashboard/src/components/artifact_upload.rs +++ b/compliance-dashboard/src/components/artifact_upload.rs @@ -66,7 +66,7 @@ pub fn ArtifactUpload(target_id: String, on_uploaded: EventHandler<()>) -> Eleme } // Firmware images and build outputs are never unpacked. if kind() != "firmware_image" && kind() != "build_output" { - div { class: "form-group", + div { class: "form-group artifact-upload-password", label { {common::ARCHIVE_PASSWORD.get(lang)} } input { r#type: "password", diff --git a/compliance-dashboard/src/pages/target.rs b/compliance-dashboard/src/pages/target.rs index dd91fc6..db00424 100644 --- a/compliance-dashboard/src/pages/target.rs +++ b/compliance-dashboard/src/pages/target.rs @@ -573,7 +573,7 @@ fn TargetEditor( }; rsx! { div { class: "modal-overlay", - div { class: "modal-dialog form-fields", + div { class: "modal-dialog modal-wide form-fields", h3 { {tx::EDIT_TITLE.get(lang)} } div { class: "form-group", label { {tx::COL_NAME.get(lang)} } @@ -609,10 +609,11 @@ fn TargetEditor( } } } - label { style: "font-weight: 600;", {tx::ARTIFACTS.get(lang)} } + div { class: "modal-section", + h4 { class: "target-subhead", {tx::ARTIFACTS.get(lang)} } for (i, a) in edit_arts().iter().enumerate() { - div { style: "display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; flex-wrap: wrap;", - span { style: "font-size: 0.9em;", + div { class: "artifact-row", + span { class: "artifact-row-ref", span { style: "opacity: 0.7;", "{kinds::artifact_kind(&a.kind, lang)}: " } span { style: "font-family: monospace;", "{a.source_ref}" } if a.token.as_deref() == Some("") { @@ -626,7 +627,6 @@ fn TargetEditor( r#type: "password", autocomplete: "off", placeholder: tx::NEW_TOKEN.get(lang), - style: "flex: 1; min-width: 180px;", oninput: move |e| { let v = e.value(); edit_arts.write()[i].token = (!v.is_empty()).then_some(v); @@ -655,8 +655,8 @@ fn TargetEditor( } } } - div { style: "display: flex; gap: 8px; align-items: flex-end; margin-top: 8px;", - div { class: "form-group", style: "margin: 0;", + div { class: "artifact-add", + div { class: "form-group artifact-add-kind", label { {tx::KIND.get(lang)} } select { value: "{e_kind}", @@ -669,7 +669,7 @@ fn TargetEditor( } } } - div { class: "form-group", style: "margin: 0; flex: 1;", + div { class: "form-group artifact-add-ref", label { {tx::REFERENCE.get(lang)} } input { r#type: "text", @@ -678,7 +678,7 @@ fn TargetEditor( } } if e_kind() == "git_repo" { - div { class: "form-group", style: "margin: 0;", + div { class: "form-group artifact-add-branch", label { {tx::BRANCH.get(lang)} } input { r#type: "text", @@ -686,7 +686,7 @@ fn TargetEditor( oninput: move |e| e_branch.set(e.value()), } } - div { class: "form-group", style: "margin: 0;", + div { class: "form-group artifact-add-token", label { {tx::TOKEN.get(lang)} } input { r#type: "password", @@ -724,6 +724,8 @@ fn TargetEditor( if let Some(err) = e_source_err.clone() { div { style: "color: var(--danger, #d33); font-size: 0.85em;", "{err}" } } + } + div { class: "modal-section", h4 { class: "target-subhead", {tx::UPLOAD_TITLE.get(lang)} } ArtifactUpload { target_id: eid.clone(), @@ -734,7 +736,8 @@ fn TargetEditor( on_saved.call(()); }, } - div { class: "form-group", + } + div { class: "modal-section form-group", label { {tx::EXCLUDE_TITLE.get(lang)} } textarea { rows: "3", @@ -751,6 +754,7 @@ fn TargetEditor( div { style: "color: var(--danger, #d33); font-size: 0.85em;", "{err}" } } } + div { class: "modal-section", match projects.read().clone() { Some(Ok(list)) => rsx! { ProjectPicker { projects: list, selected: edit_projects } }, Some(Err(e)) => rsx! { @@ -758,6 +762,7 @@ fn TargetEditor( }, None => rsx! {}, } + } div { class: "modal-actions", button { class: "btn btn-secondary",