fix: optimize firmware notification action UI

This commit is contained in:
Miayui
2026-09-18 13:22:05 +08:00
parent 0ab1d76781
commit 24aa1371dc
5 changed files with 36 additions and 5 deletions
+18
View File
@@ -335,6 +335,20 @@ th:nth-child(4) { width: 28%; } th:nth-child(5) { width: 8%; } th:nth-child(6) {
.table-actions svg { width: 13px; height: 13px; } .table-actions svg { width: 13px; height: 13px; }
.table-actions .publish-action { color: white; background: var(--primary); } .table-actions .publish-action { color: white; background: var(--primary); }
.table-actions .delete-action { color: var(--danger); background: #fff0f1; } .table-actions .delete-action { color: var(--danger); background: #fff0f1; }
.table-actions .notify-action {
flex: 0 0 42px;
width: 42px;
min-width: 42px;
height: 34px;
margin-left: auto;
padding: 6px;
border-radius: 8px;
color: #fff;
background: var(--primary);
box-shadow: 0 4px 10px rgba(40, 105, 232, .2);
}
.table-actions .notify-action svg { width: 20px; height: 20px; stroke-width: 2.25; }
.table-actions .notify-action:hover { background: color-mix(in srgb, var(--primary) 86%, #132447); }
.baseline-protection { height: 26px; padding: 3px 6px; display: inline-flex; align-items: center; gap: 3px; color: var(--success); background: var(--success-soft); border-radius: 5px; font-size: 12px; white-space: nowrap; } .baseline-protection { height: 26px; padding: 3px 6px; display: inline-flex; align-items: center; gap: 3px; color: var(--success); background: var(--success-soft); border-radius: 5px; font-size: 12px; white-space: nowrap; }
.baseline-protection svg { width: 13px; } .baseline-protection svg { width: 13px; }
.status-badge[data-status="baseline"] { color: var(--success); border-color: #b9e5d3; background: var(--success-soft); } .status-badge[data-status="baseline"] { color: var(--success); border-color: #b9e5d3; background: var(--success-soft); }
@@ -600,6 +614,10 @@ body.embedded .file-cell span { line-height: 1.15; }
color: var(--danger); color: var(--danger);
background: color-mix(in srgb, var(--danger) 12%, var(--surface)); background: color-mix(in srgb, var(--danger) 12%, var(--surface));
} }
:root[data-glass-theme="dark"] .table-actions .notify-action {
color: #fff;
background: color-mix(in srgb, var(--primary) 82%, #07101e);
}
:root[data-glass-theme="dark"] .modal-backdrop { background: rgba(2, 5, 14, .68); } :root[data-glass-theme="dark"] .modal-backdrop { background: rgba(2, 5, 14, .68); }
:root[data-glass-theme="dark"] .modal { background: var(--surface); } :root[data-glass-theme="dark"] .modal { background: var(--surface); }
:root[data-glass-theme="dark"] .diff-panel p { color: var(--muted); } :root[data-glass-theme="dark"] .diff-panel p { color: var(--muted); }
+1 -1
View File
@@ -8,7 +8,7 @@
<title>座椅固件开发工作台 · 511 工程</title> <title>座椅固件开发工作台 · 511 工程</title>
<link rel="icon" href="/icons/app-icon-192.png" /> <link rel="icon" href="/icons/app-icon-192.png" />
<script src="/firmware-workbench-theme.js?v=1"></script> <script src="/firmware-workbench-theme.js?v=1"></script>
<link rel="stylesheet" href="/firmware-workbench.css?v=6" /> <link rel="stylesheet" href="/firmware-workbench.css?v=7" />
<script src="/vendor/lucide/0.468.0/lucide.min.js" defer></script> <script src="/vendor/lucide/0.468.0/lucide.min.js" defer></script>
<script src="/firmware-workbench.js?v=4" defer></script> <script src="/firmware-workbench.js?v=4" defer></script>
</head> </head>
+1 -1
View File
@@ -271,8 +271,8 @@
<button type="button" title="查看验证记录" data-artifact-action="validation" data-artifact-id="${artifact.id}">验证</button> <button type="button" title="查看验证记录" data-artifact-action="validation" data-artifact-id="${artifact.id}">验证</button>
<a href="${escapeHtml(artifact.download_url)}" title="下载固件" aria-label="下载固件" download><i data-lucide="download"></i></a> <a href="${escapeHtml(artifact.download_url)}" title="下载固件" aria-label="下载固件" download><i data-lucide="download"></i></a>
<button class="publish-action" type="button" title="发布到服务器" data-artifact-action="publish" data-artifact-id="${artifact.id}"><i data-lucide="cloud-upload"></i></button> <button class="publish-action" type="button" title="发布到服务器" data-artifact-action="publish" data-artifact-id="${artifact.id}"><i data-lucide="cloud-upload"></i></button>
${artifact.status === "published" ? `<button class="notify-action" type="button" title="通知车端" aria-label="通知车端" data-artifact-action="notify" data-artifact-id="${artifact.id}"><i data-lucide="bell"></i></button>` : ""}
${artifact.is_baseline ? `<span class="baseline-protection" title="时间控制基线固件受保护"><i data-lucide="shield-check"></i>受保护</span>` : `<button class="delete-action" type="button" title="删除固件产物" data-artifact-action="delete" data-artifact-id="${artifact.id}"><i data-lucide="trash-2"></i></button>`} ${artifact.is_baseline ? `<span class="baseline-protection" title="时间控制基线固件受保护"><i data-lucide="shield-check"></i>受保护</span>` : `<button class="delete-action" type="button" title="删除固件产物" data-artifact-action="delete" data-artifact-id="${artifact.id}"><i data-lucide="trash-2"></i></button>`}
${artifact.status === "published" ? `<button class="notify-action" type="button" title="通知车端" aria-label="通知车端" data-artifact-action="notify" data-artifact-id="${artifact.id}"><i data-lucide="bell"></i></button>` : ""}
</div></td> </div></td>
</tr>`).join(""); </tr>`).join("");
} }
+2 -2
View File
@@ -1,4 +1,4 @@
const CACHE_VERSION = "cognitive-agent-pad-v324-firmware-notification"; const CACHE_VERSION = "cognitive-agent-pad-v325-notification-ui";
const SHELL_CACHE = `${CACHE_VERSION}-shell`; const SHELL_CACHE = `${CACHE_VERSION}-shell`;
const RUNTIME_CACHE = `${CACHE_VERSION}-runtime`; const RUNTIME_CACHE = `${CACHE_VERSION}-runtime`;
const APP_SHELL = [ const APP_SHELL = [
@@ -27,7 +27,7 @@ const APP_SHELL = [
"/firmware-workbench-entry.js?v=3", "/firmware-workbench-entry.js?v=3",
"/firmware-workbench.html", "/firmware-workbench.html",
"/firmware-workbench-theme.js?v=1", "/firmware-workbench-theme.js?v=1",
"/firmware-workbench.css?v=6", "/firmware-workbench.css?v=7",
"/firmware-workbench.js?v=4", "/firmware-workbench.js?v=4",
"/assets/pets/self-extension-cat.png?v=3", "/assets/pets/self-extension-cat.png?v=3",
"/assets/pets/self-extension-cat-entrance.png?v=3", "/assets/pets/self-extension-cat-entrance.png?v=3",
@@ -58,7 +58,7 @@ def test_workbench_exposes_artifact_actions_and_always_starts_a_new_task() -> No
"/firmware-workbench-entry.js?v=3", "/firmware-workbench-entry.js?v=3",
"/firmware-workbench.html", "/firmware-workbench.html",
"/firmware-workbench-theme.js?v=1", "/firmware-workbench-theme.js?v=1",
"/firmware-workbench.css?v=6", "/firmware-workbench.css?v=7",
"/firmware-workbench.js?v=4", "/firmware-workbench.js?v=4",
): ):
assert f'"{asset}"' in worker assert f'"{asset}"' in worker
@@ -107,3 +107,16 @@ def test_peer_dialogs_share_the_expanded_desktop_size_contract() -> None:
assert 'width: min(960px, calc(100vw - 30px));' in extension assert 'width: min(960px, calc(100vw - 30px));' in extension
assert 'width: min(1180px, calc(100vw - 28px));' in extension assert 'width: min(1180px, calc(100vw - 28px));' in extension
assert 'width: min(980px, calc(100vw - 32px));' in extension assert 'width: min(980px, calc(100vw - 32px));' in extension
def test_published_artifacts_expose_the_expanded_right_aligned_notify_action() -> None:
script = source("firmware-workbench.js")
styles = source("firmware-workbench.css")
assert 'artifact.status === "published"' in script
assert 'class="notify-action"' in script
assert 'data-artifact-action="notify"' in script
assert 'margin-left: auto' in styles
assert 'flex: 0 0 42px' in styles
assert 'height: 34px' in styles
assert '.table-actions .notify-action svg { width: 20px; height: 20px;' in styles