diff --git a/dashboard/ringside.html b/dashboard/ringside.html index 0dcc48b..8ba5a34 100644 --- a/dashboard/ringside.html +++ b/dashboard/ringside.html @@ -56,13 +56,12 @@ line-height: 1.5; margin: 0; } - button, select { + button { color: inherit; font: inherit; + cursor: pointer; } - button { cursor: pointer; } button:focus-visible, - select:focus-visible, iframe:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; @@ -176,10 +175,13 @@ } .artifact-tools button:hover { border-color: var(--accent); } .artifact-tools button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } - select, - .artifact-tools select { - appearance: none; - -webkit-appearance: none; + .dd { + position: relative; + display: grid; + min-width: 0; + max-width: 100%; + } + .dd-trigger { padding: 7px 30px 7px 12px; border: 1px solid var(--hairline); border-radius: 7px; @@ -190,9 +192,49 @@ color: var(--ink); font-size: 13px; line-height: 1.3; + min-width: 0; max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + text-align: left; + } + .dd-trigger:disabled { opacity: .55; cursor: default; } + .dd-menu { + position: absolute; + top: calc(100% + 5px); + left: 0; + z-index: 40; + min-width: 100%; + max-width: min(92vw, 640px); + padding: 4px; + background: var(--surface); + border: 1px solid var(--hairline); + border-radius: 9px; + box-shadow: 0 14px 34px rgba(9, 14, 22, .28); + overflow-y: auto; + overscroll-behavior: contain; + } + .dd-menu:focus { outline: none; } + .dd-menu.align-right { left: auto; right: 0; } + .dd-option { + position: relative; + padding: 7px 12px 7px 28px; + border-radius: 6px; + font-size: 12px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + cursor: pointer; + } + .dd-option.active { background: var(--hairline); } + .dd-option[aria-selected="true"]::before { + content: "✓"; + position: absolute; + left: 9px; + color: var(--accent); + font-weight: 700; } - select:focus-visible, summary.run-head:focus-visible, .run-switch:focus-visible { outline: 2px solid var(--accent); @@ -523,18 +565,17 @@ color: var(--muted); font-size: 13px; } - .artifact-tools select, + .artifact-tools .dd-trigger, .artifact-tools button { min-height: 30px; - background: var(--surface); + background-color: var(--surface); border: 1px solid var(--hairline); border-radius: 6px; color: var(--ink); font-size: 12px; } - .artifact-tools select { - min-width: 0; - padding: 0 8px; + .artifact-tools .dd-trigger { + padding: 0 28px 0 10px; } .artifact-tools button { padding: 0 10px; @@ -605,9 +646,9 @@
- +
No artifact selected.
- +
@@ -657,9 +698,9 @@ updateMessage: document.getElementById("update-message"), dismissUpdate: document.getElementById("dismiss-update"), runs: document.getElementById("runs"), - artifactPicker: document.getElementById("artifact-picker"), + artifactPicker: createDropdown(document.getElementById("artifact-picker"), pickArtifact), artifactStatus: document.getElementById("artifact-status"), - artifactVersion: document.getElementById("artifact-version"), + artifactVersion: createDropdown(document.getElementById("artifact-version"), pickVersion), frameWrap: document.getElementById("frame-wrap") }; @@ -910,18 +951,156 @@ while (have.childNodes.length > desired.length) have.lastChild.remove(); } - function syncSelect(select, desired, value) { - while (select.options.length > desired.length) select.remove(select.options.length - 1); - desired.forEach((want, index) => { - let option = select.options[index]; - if (!option) { - option = document.createElement("option"); - select.add(option); + // Native