From 96c92a5b22dc033ddc37fa833b7c0bd57bcf102e Mon Sep 17 00:00:00 2001 From: qiyinxi Date: Sat, 5 Dec 2026 19:15:06 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=BA=95=E8=89=B2=E6=96=B9=E5=9D=97=E3=80=81?= =?UTF-8?q?=E7=84=A6=E7=82=B9=E6=A1=86=E5=8F=AA=E5=9C=A8=E9=94=AE=E7=9B=98?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=B6=E6=98=BE=E7=A4=BA=E3=80=81=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=8F=90=E7=A4=BA=E5=8E=BB=E6=8E=89=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs ModAVD/ModAVD#462 --- changelog.d/issue-462-card-marks.change.md | 2 + internal/ui/web/app.css | 58 +++++++++++----------- internal/ui/web/js/app.js | 6 +++ internal/ui/web/js/cards.js | 14 +++--- scripts/test_create_cancel.mjs | 28 ++++++----- 5 files changed, 60 insertions(+), 48 deletions(-) create mode 100644 changelog.d/issue-462-card-marks.change.md diff --git a/changelog.d/issue-462-card-marks.change.md b/changelog.d/issue-462-card-marks.change.md new file mode 100644 index 00000000..1cb92af9 --- /dev/null +++ b/changelog.d/issue-462-card-marks.change.md @@ -0,0 +1,2 @@ +实例卡片标记去掉底色方块、图标更大;鼠标操作不再出现焦点框;名称悬停提示不再写编号 +Instance card marks lose the box and grow larger, the focus ring shows only for keyboard use, and the name tooltip no longer shows the index. diff --git a/internal/ui/web/app.css b/internal/ui/web/app.css index 7d90419a..1c8ee6aa 100644 --- a/internal/ui/web/app.css +++ b/internal/ui/web/app.css @@ -234,7 +234,8 @@ h1, h2, h3, p { margin: 0; } button, input, select, textarea { font: inherit; color: inherit; } button { -webkit-tap-highlight-color: transparent; } :focus { outline: none; } -:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; } +/* the focus ring only for keyboard use (html.kbd, set in app.js): WebView2 focuses a dialog's first control on open and gives\n the focus back to the opener on close, which a mouse user saw as an error frame. :where keeps the specificity of the old\n global rule, so the rules below that turn it off still win. */ +:where(html.kbd) :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; } ::selection { background: var(--accent-tint-2); } .num { font-variant-numeric: tabular-nums; } .muted { color: var(--text-3); } @@ -332,7 +333,7 @@ button { -webkit-tap-highlight-color: transparent; } /* the 开机失败 / 新建失败 label of a card: it opens 问题反馈 at the task */ .pill-link { cursor: pointer; } .pill-link:hover { box-shadow: inset 0 0 0 1px var(--td); } -.pill-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; } +html.kbd .pill-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; } .bar { position: relative; height: 4px; border-radius: 2px; background: var(--bar-track); overflow: hidden; } @@ -393,7 +394,7 @@ button { -webkit-tap-highlight-color: transparent; } } .seg label:hover span { color: var(--text); } .seg input:checked + span { background: var(--seg-on); color: var(--text); box-shadow: var(--shadow-seg); } -.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; } +html.kbd .seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; } .checkbox { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none; } .checkbox input { @@ -403,7 +404,7 @@ button { -webkit-tap-highlight-color: transparent; } } .checkbox input:checked { background: var(--accent-text) var(--tick) center / 14px no-repeat; border-color: var(--accent-text); } .checkbox.danger input:checked { background-color: var(--danger); background-image: var(--tick-w); border-color: var(--danger); } -.checkbox input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; } +html.kbd .checkbox input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; } /* ---- header ----------------------------------------------------------------------------------------------- */ @@ -422,7 +423,7 @@ button { -webkit-tap-highlight-color: transparent; } .brand-link { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: default; } .brand-link:not(:disabled) { cursor: pointer; border-radius: 7px; } .brand-link:not(:disabled):hover .brand-name { text-decoration: underline; } -.brand-link:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 3px; } +html.kbd .brand-link:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 3px; } .brand-name { font-size: 15px; font-weight: 600; letter-spacing: .01em; } .brand-ver { padding: 2px 8px; border-radius: 6px; background: var(--ver-bg); @@ -615,39 +616,40 @@ button { -webkit-tap-highlight-color: transparent; } .grid:not(.is-list) .card-meta .act-more { width: 18px; height: 18px; border-radius: 5px; } /* Marks after the instance name in the card's title line: one rule for all of them, kept in cards.js next to where they are built (the same text is there). - Every mark is a single-glyph block: 18px square, with exactly one capital letter (10px cap height, 4px above and 4px - below at 1x) or one 12px icon (3px around it) in it. No words and no second letter; what a mark means goes in its + Every mark is a single glyph with no background box and no outline: a 20px box with exactly one capital letter (15px, + 600, 11px cap height, 4.5px above and 4.5px below at 1x) or one 16px icon (2px around it) in it. The colour is --text-2 + (--tf for the adb tag and for a proxy mark in tone-warn / tone-err), a hover makes it brighter. No words and no second letter; what a mark means goes in its title and aria-label. Today: cat head = 按应用走代理, G = Google Play 商店, K = KernelSU, monitor with a slash = 无头 (headless). Always-there marks come first, marks that follow the run state come last, so one appearing never pushes the others. In the card view they are at the right end of the title line. The card view does not write 运行中 or 已关机 (the screen and the power button say it): the status label shows only for the states in between and the failed ones, and for the other two it is for screen readers only (.pill-quiet). - The card view is the title and one config line: a new state is another single-glyph block or a hover text, not a word + The card view is the title and one config line: a new state is another single glyph or a hover text, not a word and not a line. The cat head is the only mark that is a button (it opens the proxy dialog) and the only one that - can have a state colour (--tb / --tf from .tone-*), and only when something is wrong (tone-warn, tone-err): while the + can have a state colour (--tf from .tone-*; the icon only, never a background), and only when something is wrong (tone-warn, tone-err): while the proxy works it looks like the others; the others are static. */ .pmark, .smark, .kmark, .hmark { display: inline-flex; align-items: center; justify-content: center; flex: none; - width: 18px; height: 18px; padding: 0; border: 0; border-radius: 5px; - background: var(--sunken); color: var(--text-2); + width: 20px; height: 20px; padding: 0; border: 0; border-radius: 0; + background: none; color: var(--text-2); } .pmark { cursor: pointer; } -.pmark.tone-warn, .pmark.tone-err { background: var(--tb); color: var(--tf); } -.pmark:hover { box-shadow: inset 0 0 0 1px var(--td, var(--text-3)); } -.pmark:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; } -.pmark .ic, .hmark .ic { width: 12px; height: 12px; } -.smark, .kmark { font-size: 13px; font-weight: 600; line-height: 1; } +.pmark.tone-warn, .pmark.tone-err { color: var(--tf); } +.pmark:hover { color: var(--text-1); } +html.kbd .pmark:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; } +.pmark .ic, .hmark .ic { width: 16px; height: 16px; } +.smark, .kmark { font-size: 15px; font-weight: 600; line-height: 1; } /* A letter is centred on its capitals, not on its line box: the font leaves more room above the capitals than below the - baseline, so a flex-centred G sat 1.5px low. font-size-adjust fixes the capital height at 10px whatever the font - (a 14px size scaled to cap-height 10/14), text-box trims the line to cap height and baseline, and the 4px padding - leaves 4px below. The two marks become blocks because text-box does not reach the anonymous box inside a flex + baseline, so a flex-centred G sat low. font-size-adjust fixes the capital height at 11px whatever the font + (a 15px size scaled to cap-height 11/15), text-box trims the line to cap height and baseline, and the 4.5px padding + leaves 4.5px below. The two marks become blocks because text-box does not reach the anonymous box inside a flex container. A browser without either property keeps the flex centring above. */ @supports (text-box: trim-both cap alphabetic) and (font-size-adjust: cap-height 0.7) { .smark, .kmark { display: block; text-align: center; - font-size: 14px; font-size-adjust: cap-height 0.7143; - padding-top: 4px; + font-size: 15px; font-size-adjust: cap-height 0.7333; + padding-top: 4.5px; text-box: trim-both cap alphabetic; } } @@ -655,13 +657,13 @@ button { -webkit-tap-highlight-color: transparent; } .grid:not(.is-list) .card-sub { display: none; } .adb-tag { - display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; padding: 0; - border: 0; border-radius: 5px; - background: var(--tb); color: var(--tf); + display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; padding: 0; + border: 0; border-radius: 0; + background: none; color: var(--tf); cursor: pointer; } -.adb-tag .ic { width: 12px; height: 12px; } -.adb-tag:hover { box-shadow: inset 0 0 0 1px var(--td); } +.adb-tag .ic { width: 16px; height: 16px; } +.adb-tag:hover { color: var(--td, var(--tf)); opacity: .8; } .adb { display: none; } .adb-addr { color: var(--text-2); white-space: nowrap; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; } @@ -804,7 +806,7 @@ dialog > .toasts .toast.out { animation-name: toast-out-left; } } .menu-item > .ic { color: var(--text-3); } .menu-item:hover, .menu-item:focus-visible { background: var(--hover); outline: none; } -.menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); } +html.kbd .menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); } .menu-item[aria-disabled="true"] { color: var(--text-3); opacity: .55; cursor: default; } .menu-item[aria-disabled="true"]:hover { background: transparent; } .menu-item.danger, .menu-item.danger > .ic { color: var(--err); } @@ -1006,7 +1008,7 @@ fieldset.keymap-profiles { border: 0; padding: 0; margin: 0 0 16px; min-width: 0 .group::before { content: ""; margin-bottom: -1px; } .group + .group { margin-top: 8px; } .row { padding: 10px 12px; border-top: 1px solid var(--line); } -.group .row:focus-visible, .fold-head:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); } +html.kbd .group .row:focus-visible, html.kbd .fold-head:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); } .row-title { min-width: 0; color: var(--text); font-size: 14px; overflow-wrap: anywhere; } /* what a row found and what to do: all of it (an item that did not pass says what to do, and that is the point of the row); a passed item, folded away in 其余 N 项已通过, keeps to three lines */ diff --git a/internal/ui/web/js/app.js b/internal/ui/web/js/app.js index 559fb116..e17c071a 100644 --- a/internal/ui/web/js/app.js +++ b/internal/ui/web/js/app.js @@ -76,6 +76,12 @@ if (!themeParam) { // before the locale is read // ---- wiring +// the focus ring is for the keyboard only (html.kbd): WebView2 focuses a dialog's first control on open and gives the focus +// back on close, which looked like an error frame to a mouse user. Tab, the arrows, Enter, Space and Escape turn it on, a pointer turns it off. +const NAV_KEYS = new Set(['Tab', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown', 'Enter', ' ', 'Escape']); +addEventListener('keydown', (e) => { if (NAV_KEYS.has(e.key)) document.documentElement.classList.add('kbd'); }, true); +addEventListener('pointerdown', () => document.documentElement.classList.remove('kbd'), true); + initUI(); initGrid($('grid')); // ---- 卡片 / 列表 (?view= for screenshots, not remembered) diff --git a/internal/ui/web/js/cards.js b/internal/ui/web/js/cards.js index 7d9d6b29..35e2c0b9 100644 --- a/internal/ui/web/js/cards.js +++ b/internal/ui/web/js/cards.js @@ -152,9 +152,10 @@ function makeCard(i) { h('div', { class: 'prog' }, h('div', { class: 'prog-row' }, h('span', { class: 'spin' }), c.progMsg), c.progBar), c.peek); c.title = h('h2', { class: 'card-title', id: `card-t-${i}` }); - // The marks after the instance name are single-glyph blocks. The rule (the styles are in app.css, with the same text): - // - A mark is an 18px square with exactly one capital letter (10px cap height, 4px above and 4px below at 1x) or one - // 12px icon in it. No words, no second letter; what it means goes in its title and aria-label. + // The marks after the instance name are single glyphs, with no box behind them. The rule (the styles are in app.css, with the same text): + // - A mark is a 20px box with no background and no outline, with exactly one capital letter (15px, weight 600, 11px cap + // height, 4.5px above and 4.5px below at 1x) or one 16px icon in it. Colour is --text-2 (--tf for the adb tag and a + // proxy mark in tone-warn / tone-err), a hover makes it brighter. No words, no second letter; what it means goes in its title and aria-label. // - Today: cat head = 按应用走代理, G = Google Play 商店, K = KernelSU, // monitor with a slash = 无头 (headless). // - Order: marks that are always there come first; marks that come and go with the run state come last, so one @@ -166,13 +167,13 @@ function makeCard(i) { // The status label shows only for the states in between and the failed ones (开机中, 关机中, 新建中, // 开机失败, 新建失败); for the other two it stays in the DOM for screen readers only (.pill-quiet). The list view // always shows it (it has a status column). 诊断模式 is on the name's hover text in the card view. - // - The card view is the title and one config line. A new state is another single-glyph block or a hover text, not a + // - The card view is the title and one config line. A new state is another single glyph or a hover text, not a // word and not a line; the label showing or not never changes the card's height. // - There is no box under the card: nothing is added below the config line, so no state makes a card taller than // another. The reason of a failure (开机失败, 新建失败) is the status label's hover text, and clicking the label // opens 问题反馈 at that task; software rendering and a data disk that is nearly full are lines on the name's hover // text, the first start's setup (about 1–2 minutes) is a line on the screen's hover text. - // - The cat head (pmark) is a single-glyph block too: an icon-only button that opens the 按应用走代理 dialog. It is + // - The cat head (pmark) is a single glyph too: an icon-only button that opens the 按应用走代理 dialog. It is // the only mark that is clickable and the only one that can carry a state colour, and only when something is wrong: // it looks like the other marks while the proxy works (tone ok) or has nothing to report yet (tone info), and takes // tone-warn / tone-err when the guest says part of it does not work. @@ -240,7 +241,6 @@ function updateCard(c, inst) { const name = label(inst); c.el.dataset.status = v.key; setText(c.title, name); - const id = [t('编号 {index}', { index: inst.index }), inst.name].filter(Boolean).join(' · '); // diagnostics mode: the list view writes it under the name; the card view has no such line and, while running, no // status label either, so it is a line on the name's hover text (and in the status name screen readers read) const diag = inst.diagnostics ? t('诊断模式') : ''; @@ -250,7 +250,7 @@ function updateCard(c, inst) { const ds = inst.data_space; const warnings = [inst.software_renderer && t('软件渲染:显卡驱动不可用,游戏会卡'), ds && ds.message && (ds.advice ? ds.message + comma() + ds.advice : ds.message)]; - c.title.title = [id, ownTitle(inst) && name, diag, ...warnings].filter(Boolean).join('\n'); + c.title.title = [ownTitle(inst) && name, diag, ...warnings].filter(Boolean).join('\n'); const headless = inst.running && inst.window === false && v.key !== 'creating'; c.hmark.hidden = !headless; c.sub.hidden = !diag; diff --git a/scripts/test_create_cancel.mjs b/scripts/test_create_cancel.mjs index 158d64bf..dc7db181 100644 --- a/scripts/test_create_cancel.mjs +++ b/scripts/test_create_cancel.mjs @@ -558,25 +558,25 @@ test('clearing the boss key saves an empty one; a taken key on open is marked; n test('cards show diagnostics mode on the list line under the name, on the name\'s hover text and in the status name', async () => { const h = await settingsHarness(); const plain = h.makeCard({ ...h.inst, diagnostics: false }); - assert.equal(plain.title.title, '编号 3 · mas_3'); + assert.equal(plain.title.title, ''); assert.equal(plain.sub.textContent, ''); assert.equal(plain.sub.hidden, true); assert.ok(!plain.pill.getAttribute('title')); assert.ok(!plain.pill.getAttribute('aria-label')); h.patchCard(plain, { ...h.inst, title: 'Arknights Daily Main Account', diagnostics: false }); - assert.equal(plain.title.title, '编号 3 · mas_3\nArknights Daily Main Account'); + assert.equal(plain.title.title, 'Arknights Daily Main Account'); // the card view has no status label for running and shut down, so diagnostics mode is a line on the name's hover text h.patchCard(plain, { ...h.inst, title: 'Arknights Daily Main Account' }); - assert.equal(plain.title.title, '编号 3 · mas_3\nArknights Daily Main Account\n诊断模式'); + assert.equal(plain.title.title, 'Arknights Daily Main Account\n诊断模式'); for (const status of ['online', 'offline']) { const inst = { ...h.inst, status, running: status === 'online' }; h.patchCard(plain, inst); - assert.equal(plain.title.title, '编号 3 · mas_3\n诊断模式'); + assert.equal(plain.title.title, '诊断模式'); assert.equal(plain.sub.textContent, '诊断模式'); assert.equal(plain.pill.getAttribute('title'), '诊断模式'); assert.equal(plain.pill.getAttribute('aria-label'), `${plain.pillText.textContent} · 诊断模式`); h.patchCard(plain, { ...inst, diagnostics: undefined }); - assert.equal(plain.title.title, '编号 3 · mas_3'); + assert.equal(plain.title.title, ''); assert.equal(plain.sub.hidden, true); assert.ok(!plain.pill.getAttribute('title')); assert.ok(!plain.pill.getAttribute('aria-label')); @@ -760,15 +760,15 @@ test('no state puts a box under the card', async () => { test('software rendering and a nearly full disk are lines on the name hover text', async () => { const h = await settingsHarness({ diagnostics: false }); const name = inst => h.makeCard(inst).title.title; - assert.equal(name({ ...h.inst }), '编号 3 · mas_3'); - assert.equal(name({ ...h.inst, software_renderer: true }), '编号 3 · mas_3\n软件渲染:显卡驱动不可用,游戏会卡'); - assert.equal(name({ ...h.inst, data_space: lowDisk }), '编号 3 · mas_3\n数据盘只剩 1.8 GB(共 47.0 GB),改成自动扩盘:modavd set 3 --data-gb auto'); + assert.equal(name({ ...h.inst }), ''); + assert.equal(name({ ...h.inst, software_renderer: true }), '软件渲染:显卡驱动不可用,游戏会卡'); + assert.equal(name({ ...h.inst, data_space: lowDisk }), '数据盘只剩 1.8 GB(共 47.0 GB),改成自动扩盘:modavd set 3 --data-gb auto'); // a data_space without a message (the disk is fine) adds nothing; one without advice is the message alone - assert.equal(name({ ...h.inst, data_space: { state: '', message: '', advice: '' } }), '编号 3 · mas_3'); - assert.equal(name({ ...h.inst, data_space: { state: 'host_low', message: '宿主盘只剩 12.0 GB', advice: '' } }), '编号 3 · mas_3\n宿主盘只剩 12.0 GB'); + assert.equal(name({ ...h.inst, data_space: { state: '', message: '', advice: '' } }), ''); + assert.equal(name({ ...h.inst, data_space: { state: 'host_low', message: '宿主盘只剩 12.0 GB', advice: '' } }), '宿主盘只剩 12.0 GB'); // one line each, after the diagnostics line assert.equal(name({ ...h.inst, title: '星铁', diagnostics: true, software_renderer: true, data_space: lowDisk }), - '编号 3 · mas_3\n星铁\n诊断模式\n软件渲染:显卡驱动不可用,游戏会卡\n数据盘只剩 1.8 GB(共 47.0 GB),改成自动扩盘:modavd set 3 --data-gb auto'); + '星铁\n诊断模式\n软件渲染:显卡驱动不可用,游戏会卡\n数据盘只剩 1.8 GB(共 47.0 GB),改成自动扩盘:modavd set 3 --data-gb auto'); const c = h.makeCard({ ...h.inst, software_renderer: true, data_space: lowDisk }); assert.equal(c.pill.getAttribute('aria-label'), null, 'the status name for screen readers does not carry them'); }); @@ -882,8 +882,10 @@ test('the stylesheet hides the quiet status label for the card view only and kee assert.doesNotMatch(css, /pill-quiet[^{]*\{[^}]*display: none/); assert.match(rule('.grid:not(.is-list) .card-head'), /min-height: 23px/); assert.match(rule('.grid:not(.is-list) .card-tline .card-title'), /flex: 1/); - assert.doesNotMatch(rule('.pmark'), /var\(--tb\)/, 'plain by default'); - assert.match(rule('.pmark.tone-warn, .pmark.tone-err'), /background: var\(--tb\); color: var\(--tf\)/); + assert.doesNotMatch(rule('.pmark, .smark, .kmark, .hmark'), /var\(--(tb|sunken)\)/, 'no box behind a mark'); + assert.doesNotMatch(rule('.pmark.tone-warn, .pmark.tone-err'), /background/, 'the state colour is the icon only'); + assert.doesNotMatch(rule('.adb-tag'), /var\(--tb\)/); + assert.match(rule('.pmark.tone-warn, .pmark.tone-err'), /color: var\(--tf\)/); // no box under the card in either view: no styles for it, and the list row is one grid row assert.doesNotMatch(css, /\.notes\b|\.note \{|\.note-main|\.note-text|\.note-adv|\.note-links|\.is-list \.note\b/); assert.match(rule('.is-list .card'), /grid-template-areas: "pill title cfg adb power view more";/); From 795af8d25aeec7b147cf55363d1896ad3d580ac6 Mon Sep 17 00:00:00 2001 From: qiyinxi Date: Sat, 5 Dec 2026 19:22:06 +0100 Subject: [PATCH 2/4] =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E5=A2=A8=E8=BF=B9=E5=AF=B9=E9=BD=90=E5=B9=B6=E6=94=BE=E5=A4=A7?= =?UTF-8?q?=E3=80=81ADB=20=E6=A0=87=E8=AE=B0=E6=94=B9=E6=88=90=E5=AD=97?= =?UTF-8?q?=E6=AF=8D=20A=E3=80=81=E6=A0=87=E9=A2=98=E6=94=BE=E5=A4=A7=202p?= =?UTF-8?q?x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs ModAVD/ModAVD#462 --- changelog.d/issue-462-card-marks.change.md | 4 +-- internal/ui/web/app.css | 38 ++++++++++++++-------- internal/ui/web/js/cards.js | 10 +++--- internal/ui/web/js/dom.js | 1 - scripts/test_create_cancel.mjs | 14 ++++---- 5 files changed, 40 insertions(+), 27 deletions(-) diff --git a/changelog.d/issue-462-card-marks.change.md b/changelog.d/issue-462-card-marks.change.md index 1cb92af9..19185766 100644 --- a/changelog.d/issue-462-card-marks.change.md +++ b/changelog.d/issue-462-card-marks.change.md @@ -1,2 +1,2 @@ -实例卡片标记去掉底色方块、图标更大;鼠标操作不再出现焦点框;名称悬停提示不再写编号 -Instance card marks lose the box and grow larger, the focus ring shows only for keyboard use, and the name tooltip no longer shows the index. +实例卡片标记去底色、字母和图标对齐变大,标题放大;鼠标操作不再出现焦点框;名称提示不再写编号 +Instance card marks lose the box, letters and icons line up and grow, titles are larger, the focus ring shows only for keyboard use, and the tooltip drops the index. diff --git a/internal/ui/web/app.css b/internal/ui/web/app.css index 1c8ee6aa..b6474a10 100644 --- a/internal/ui/web/app.css +++ b/internal/ui/web/app.css @@ -593,7 +593,7 @@ html.kbd .brand-link:focus-visible { outline: 2px solid var(--accent, currentCol .card-body { display: flex; flex-direction: column; gap: 8px; padding: 10px 4px 0; flex: 1; } .card-head { display: flex; align-items: flex-start; gap: 12px; } .card-titles { flex: 1; min-width: 0; } -.card-title { font-size: 15px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.card-title { font-size: 17px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .card-sub, .card-cfg { color: var(--text-3); font-size: 12px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; } .card-meta { display: flex; align-items: center; gap: 8px; margin-top: -4px; } .card-cfg { flex: 1; min-width: 0; } @@ -616,11 +616,11 @@ html.kbd .brand-link:focus-visible { outline: 2px solid var(--accent, currentCol .grid:not(.is-list) .card-meta .act-more { width: 18px; height: 18px; border-radius: 5px; } /* Marks after the instance name in the card's title line: one rule for all of them, kept in cards.js next to where they are built (the same text is there). - Every mark is a single glyph with no background box and no outline: a 20px box with exactly one capital letter (15px, - 600, 11px cap height, 4.5px above and 4.5px below at 1x) or one 16px icon (2px around it) in it. The colour is --text-2 + Every mark is a single glyph with no background box and no outline: a 22px box with exactly one capital letter (17px, + 600, 12.47px cap height, 4.77px above and below at 1x) or one icon (the ink of every mark is 12.47px, the capital height of 17px type, centred in the box) in it. The colour is --text-2 (--tf for the adb tag and for a proxy mark in tone-warn / tone-err), a hover makes it brighter. No words and no second letter; what a mark means goes in its title and aria-label. Today: cat head = 按应用走代理, G = Google Play 商店, - K = KernelSU, monitor with a slash = 无头 (headless). + K = KernelSU, monitor with a slash = 无头 (headless), A = copy the ADB address. Always-there marks come first, marks that follow the run state come last, so one appearing never pushes the others. In the card view they are at the right end of the title line. The card view does not write 运行中 or 已关机 (the screen and the power button say it): the status label shows only for the states in between and the failed ones, and @@ -631,25 +631,28 @@ html.kbd .brand-link:focus-visible { outline: 2px solid var(--accent, currentCol proxy works it looks like the others; the others are static. */ .pmark, .smark, .kmark, .hmark { display: inline-flex; align-items: center; justify-content: center; flex: none; - width: 20px; height: 20px; padding: 0; border: 0; border-radius: 0; + width: 22px; height: 22px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--text-2); } .pmark { cursor: pointer; } .pmark.tone-warn, .pmark.tone-err { color: var(--tf); } .pmark:hover { color: var(--text-1); } html.kbd .pmark:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; } -.pmark .ic, .hmark .ic { width: 16px; height: 16px; } -.smark, .kmark { font-size: 15px; font-weight: 600; line-height: 1; } +/* every mark is 12.47px of ink (the capital height of the 17px letters), y 4.77–17.23 of the 22px box: the monitor drawing is 12.5px tall at + 16px, so it stays 16px; the cat head is 11.04px tall at 16px, so it is drawn at 18.07px (the same centre). */ +.pmark .ic { width: 18.07px; height: 18.07px; } +.hmark .ic { width: 16px; height: 16px; } +.smark, .kmark { font-size: 17px; font-weight: 600; line-height: 1; } /* A letter is centred on its capitals, not on its line box: the font leaves more room above the capitals than below the baseline, so a flex-centred G sat low. font-size-adjust fixes the capital height at 11px whatever the font - (a 15px size scaled to cap-height 11/15), text-box trims the line to cap height and baseline, and the 4.5px padding - leaves 4.5px below. The two marks become blocks because text-box does not reach the anonymous box inside a flex + (a 17px size scaled to cap-height 12.47/17), text-box trims the line to cap height and baseline, and the 4.77px padding + leaves 4.77px below. The two letters become blocks (the A of the ADB tag is the same, in its own rule below) because text-box does not reach the anonymous box inside a flex container. A browser without either property keeps the flex centring above. */ @supports (text-box: trim-both cap alphabetic) and (font-size-adjust: cap-height 0.7) { .smark, .kmark { display: block; text-align: center; - font-size: 15px; font-size-adjust: cap-height 0.7333; - padding-top: 4.5px; + font-size: 17px; font-size-adjust: cap-height 0.7333; + padding-top: 4.77px; text-box: trim-both cap alphabetic; } } @@ -657,12 +660,19 @@ html.kbd .pmark:focus-visible { outline: 2px solid var(--focus); outline-offset: .grid:not(.is-list) .card-sub { display: none; } .adb-tag { - display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; padding: 0; + display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 0; - background: none; color: var(--tf); + background: none; color: var(--tf); font-family: inherit; cursor: pointer; + font-size: 17px; font-weight: 600; line-height: 1; +} +@supports (text-box: trim-both cap alphabetic) and (font-size-adjust: cap-height 0.7) { + .adb-tag { + display: block; text-align: center; + font-size-adjust: cap-height 0.7333; + text-box: trim-both cap alphabetic; /* a button centres its 12.47px of cap height itself: 4.77px above and below, so no padding-top here */ + } } -.adb-tag .ic { width: 16px; height: 16px; } .adb-tag:hover { color: var(--td, var(--tf)); opacity: .8; } .adb { display: none; } .adb-addr { color: var(--text-2); white-space: nowrap; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; } diff --git a/internal/ui/web/js/cards.js b/internal/ui/web/js/cards.js index 35e2c0b9..8242ee2a 100644 --- a/internal/ui/web/js/cards.js +++ b/internal/ui/web/js/cards.js @@ -153,9 +153,11 @@ function makeCard(i) { c.peek); c.title = h('h2', { class: 'card-title', id: `card-t-${i}` }); // The marks after the instance name are single glyphs, with no box behind them. The rule (the styles are in app.css, with the same text): - // - A mark is a 20px box with no background and no outline, with exactly one capital letter (15px, weight 600, 11px cap - // height, 4.5px above and 4.5px below at 1x) or one 16px icon in it. Colour is --text-2 (--tf for the adb tag and a - // proxy mark in tone-warn / tone-err), a hover makes it brighter. No words, no second letter; what it means goes in its title and aria-label. + // - A mark is a 22px box with no background and no outline, with exactly one capital letter (17px, weight 600, 12.47px + // cap height, 4.77px above and below at 1x) or one icon in it. The ink of every mark is 12.47px, centred in the box (y 4.77–17.23); + // the cat head is drawn at 18.07px and the monitor at 16px for that, the ADB tag is the letter A like G and K. Colour is + // --text-2 (--tf for the adb tag, which is a button too, and a proxy mark in tone-warn / tone-err), a hover makes it + // brighter. No words, no second letter; what it means goes in its title and aria-label. // - Today: cat head = 按应用走代理, G = Google Play 商店, K = KernelSU, // monitor with a slash = 无头 (headless). // - Order: marks that are always there come first; marks that come and go with the run state come last, so one @@ -201,7 +203,7 @@ function makeCard(i) { c.pill = h('span', { class: 'pill', onclick: showFailure, onkeydown: (e) => { if (c.failure && (e.key === 'Enter' || e.key === ' ')) { e.preventDefault(); showFailure(); } } }, c.pillText); const copyAdb = () => A.copy(c.inst.adb_address); - c.adbTag = btn('adb-tag tone-idle', icon('robot'), copyAdb); + c.adbTag = btn('adb-tag tone-idle', 'A', copyAdb); c.adb = h('span', { class: 'adb-addr' }); c.copy = ibtn('copy', t('复制 adb 地址'), copyAdb); c.adbList = h('div', { class: 'adb' }, c.adb, c.copy); diff --git a/internal/ui/web/js/dom.js b/internal/ui/web/js/dom.js index 54b79e84..17e76b9c 100644 --- a/internal/ui/web/js/dom.js +++ b/internal/ui/web/js/dom.js @@ -93,7 +93,6 @@ const I = { refresh: '', window: '', monitorOff: '', - robot: '', eye: '', eyeOff: '', download: '', diff --git a/scripts/test_create_cancel.mjs b/scripts/test_create_cancel.mjs index dc7db181..55a8b715 100644 --- a/scripts/test_create_cancel.mjs +++ b/scripts/test_create_cancel.mjs @@ -619,13 +619,12 @@ test('cards mark a headless instance in the title line, after the G and KernelSU assert.equal(c.hmark.hidden, true, 'a create in progress runs headless but is not marked'); }); -// ModAVD/ModAVD#435: the card's ADB address is a small robot mark after the title (the full address on hover and +// ModAVD/ModAVD#435: the card's ADB address is a small letter A mark after the title (the full address on hover and // for screen readers), hidden without a port; the config line keeps its full wording on hover and for screen readers. -test('cards show the ADB robot mark and the short config line', async () => { +test('cards show the ADB letter mark and the short config line', async () => { const h = await settingsHarness(); const c = h.makeCard({ ...h.inst, adb_address: '127.0.0.1:20011' }); - assert.equal(c.adbTag.textContent, ''); - assert.equal(c.adbTag.childNodes.length, 1); + assert.equal(c.adbTag.textContent, 'A'); assert.equal(c.adbTag.hidden, false); assert.equal(c.adbTag.getAttribute('title'), '127.0.0.1:20011'); assert.equal(c.adbTag.getAttribute('aria-label'), '复制 ADB 地址 127.0.0.1:20011'); @@ -841,8 +840,8 @@ test('a failed boot or create: the reason is the status label hover text, and th assert.deepEqual(h.activity, [['j13', null]]); h.patchCard(cf, { ...created, creation_error: '', creation_log: '' }); assert.equal(cf.pill.getAttribute('title'), '新建失败:初始化没做完\n点「重试初始化」再做一次,或在「更多」里删除这台实例'); - // no 调小内存 link (it is on the task in 问题反馈), no dismiss button, no 详情 link: the visible text buttons are the retry and 画面 controls - const buttons = descendants(cf.el).filter(x => x.tagName === 'BUTTON').map(x => x.textContent.trim()).filter(Boolean); + // no 调小内存 link (it is on the task in 问题反馈), no dismiss button, no 详情 link: the visible text buttons are the retry and 画面 controls (not the A mark) + const buttons = descendants(cf.el).filter(x => x.tagName === 'BUTTON' && x !== cf.adbTag).map(x => x.textContent.trim()).filter(Boolean); assert.deepEqual(buttons, ['重试初始化', '画面']); assert.doesNotMatch(cf.el.textContent, /调小内存|不再显示|详情/); h.state.jobs.clear(); @@ -885,6 +884,7 @@ test('the stylesheet hides the quiet status label for the card view only and kee assert.doesNotMatch(rule('.pmark, .smark, .kmark, .hmark'), /var\(--(tb|sunken)\)/, 'no box behind a mark'); assert.doesNotMatch(rule('.pmark.tone-warn, .pmark.tone-err'), /background/, 'the state colour is the icon only'); assert.doesNotMatch(rule('.adb-tag'), /var\(--tb\)/); + assert.match(rule('.hmark .ic'), /width: 16px; height: 16px/, 'the monitor drawing is 12.5px of ink at 16px, the cap height of the 17px letters'); assert.match(rule('.pmark.tone-warn, .pmark.tone-err'), /color: var\(--tf\)/); // no box under the card in either view: no styles for it, and the list row is one grid row assert.doesNotMatch(css, /\.notes\b|\.note \{|\.note-main|\.note-text|\.note-adv|\.note-links|\.is-list \.note\b/); @@ -892,6 +892,8 @@ test('the stylesheet hides the quiet status label for the card view only and kee assert.match(rule('.grid:not(.is-list) .card-actions'), /display: none/); assert.match(rule('.grid:not(.is-list) .card-body'), /gap: 4px/); assert.match(rule('.adb-tag'), /display: inline-grid/); + assert.match(rule('.card-title'), /font-size: 17px/); + assert.match(rule('.smark, .kmark'), /font-size: 17px/); assert.match(rule('.pill-link'), /cursor: pointer/); }); From 5ed11e64175c963fd6a060afbc94b79b1650b21e Mon Sep 17 00:00:00 2001 From: qiyinxi Date: Sat, 5 Dec 2026 19:26:58 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E6=94=B9=E6=88=90=2018px=20=E7=BB=86=E6=A1=86=E6=97=A0?= =?UTF-8?q?=E5=BA=95=E8=89=B2=E3=80=81=E5=A2=A8=E8=BF=B9=2010px=20?= =?UTF-8?q?=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs ModAVD/ModAVD#462 --- changelog.d/issue-462-card-marks.change.md | 4 +- internal/ui/web/app.css | 46 +++++++++++----------- internal/ui/web/js/cards.js | 10 ++--- scripts/test_create_cancel.mjs | 9 +++-- 4 files changed, 35 insertions(+), 34 deletions(-) diff --git a/changelog.d/issue-462-card-marks.change.md b/changelog.d/issue-462-card-marks.change.md index 19185766..d78e9a9c 100644 --- a/changelog.d/issue-462-card-marks.change.md +++ b/changelog.d/issue-462-card-marks.change.md @@ -1,2 +1,2 @@ -实例卡片标记去底色、字母和图标对齐变大,标题放大;鼠标操作不再出现焦点框;名称提示不再写编号 -Instance card marks lose the box, letters and icons line up and grow, titles are larger, the focus ring shows only for keyboard use, and the tooltip drops the index. +实例卡片标记改成细框、无底色,ADB 改成字母 A;鼠标操作不再出现焦点框;名称提示不再写编号 +Instance card marks get a thin frame and no fill, ADB becomes the letter A, the focus ring shows only for keyboard use, and the tooltip drops the index. diff --git a/internal/ui/web/app.css b/internal/ui/web/app.css index b6474a10..f29c1256 100644 --- a/internal/ui/web/app.css +++ b/internal/ui/web/app.css @@ -593,7 +593,7 @@ html.kbd .brand-link:focus-visible { outline: 2px solid var(--accent, currentCol .card-body { display: flex; flex-direction: column; gap: 8px; padding: 10px 4px 0; flex: 1; } .card-head { display: flex; align-items: flex-start; gap: 12px; } .card-titles { flex: 1; min-width: 0; } -.card-title { font-size: 17px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.card-title { font-size: 15px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .card-sub, .card-cfg { color: var(--text-3); font-size: 12px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; } .card-meta { display: flex; align-items: center; gap: 8px; margin-top: -4px; } .card-cfg { flex: 1; min-width: 0; } @@ -616,9 +616,9 @@ html.kbd .brand-link:focus-visible { outline: 2px solid var(--accent, currentCol .grid:not(.is-list) .card-meta .act-more { width: 18px; height: 18px; border-radius: 5px; } /* Marks after the instance name in the card's title line: one rule for all of them, kept in cards.js next to where they are built (the same text is there). - Every mark is a single glyph with no background box and no outline: a 22px box with exactly one capital letter (17px, - 600, 12.47px cap height, 4.77px above and below at 1x) or one icon (the ink of every mark is 12.47px, the capital height of 17px type, centred in the box) in it. The colour is --text-2 - (--tf for the adb tag and for a proxy mark in tone-warn / tone-err), a hover makes it brighter. No words and no second letter; what a mark means goes in its + Every mark is a single glyph in an 18px cell with a 1px --line-2 frame (inset box-shadow, radius 5px) and no background colour: exactly one capital + letter (14px, 600, 10px cap height, 4px above and below at 1x) or one icon in it, whose ink is 10px too (y 4–14). The colour is --text-2 + (--tf for the adb tag and for a proxy mark in tone-warn / tone-err). The two marks that are buttons (cat head, A) darken their frame to --text-3 on hover. No words and no second letter; what a mark means goes in its title and aria-label. Today: cat head = 按应用走代理, G = Google Play 商店, K = KernelSU, monitor with a slash = 无头 (headless), A = copy the ADB address. Always-there marks come first, marks that follow the run state come last, so one appearing never pushes the others. @@ -631,28 +631,28 @@ html.kbd .brand-link:focus-visible { outline: 2px solid var(--accent, currentCol proxy works it looks like the others; the others are static. */ .pmark, .smark, .kmark, .hmark { display: inline-flex; align-items: center; justify-content: center; flex: none; - width: 22px; height: 22px; padding: 0; border: 0; border-radius: 0; - background: none; color: var(--text-2); + width: 18px; height: 18px; padding: 0; border: 0; border-radius: 5px; + background: none; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); } .pmark { cursor: pointer; } .pmark.tone-warn, .pmark.tone-err { color: var(--tf); } -.pmark:hover { color: var(--text-1); } +.pmark:hover { box-shadow: inset 0 0 0 1px var(--text-3); } /* the two marks that are buttons: the frame darkens on hover */ html.kbd .pmark:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; } -/* every mark is 12.47px of ink (the capital height of the 17px letters), y 4.77–17.23 of the 22px box: the monitor drawing is 12.5px tall at - 16px, so it stays 16px; the cat head is 11.04px tall at 16px, so it is drawn at 18.07px (the same centre). */ -.pmark .ic { width: 18.07px; height: 18.07px; } -.hmark .ic { width: 16px; height: 16px; } -.smark, .kmark { font-size: 17px; font-weight: 600; line-height: 1; } +/* every mark is 10px of ink (the capital height of the 14px letters), y 4–14 of the 18px box: the monitor drawing is 12.5px tall at 16px, + so it is drawn at 12.83px; the cat head is 11.04px tall at 16px, so it is drawn at 14.5px (the same centre). */ +.pmark .ic { width: 14.5px; height: 14.5px; } +.hmark .ic { width: 12.83px; height: 12.83px; } +.smark, .kmark { font-size: 14px; font-weight: 600; line-height: 1; } /* A letter is centred on its capitals, not on its line box: the font leaves more room above the capitals than below the - baseline, so a flex-centred G sat low. font-size-adjust fixes the capital height at 11px whatever the font - (a 17px size scaled to cap-height 12.47/17), text-box trims the line to cap height and baseline, and the 4.77px padding - leaves 4.77px below. The two letters become blocks (the A of the ADB tag is the same, in its own rule below) because text-box does not reach the anonymous box inside a flex + baseline, so a flex-centred G sat low. font-size-adjust fixes the capital height at 10px whatever the font + (a 14px size scaled to cap-height 10/14), text-box trims the line to cap height and baseline, and the 4px padding + leaves 4px below. The two letters become blocks (the A of the ADB tag is the same, in its own rule below) because text-box does not reach the anonymous box inside a flex container. A browser without either property keeps the flex centring above. */ @supports (text-box: trim-both cap alphabetic) and (font-size-adjust: cap-height 0.7) { .smark, .kmark { display: block; text-align: center; - font-size: 17px; font-size-adjust: cap-height 0.7333; - padding-top: 4.77px; + font-size: 14px; font-size-adjust: cap-height 0.7143; + padding-top: 4px; text-box: trim-both cap alphabetic; } } @@ -660,20 +660,20 @@ html.kbd .pmark:focus-visible { outline: 2px solid var(--focus); outline-offset: .grid:not(.is-list) .card-sub { display: none; } .adb-tag { - display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; padding: 0; - border: 0; border-radius: 0; + display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; padding: 0; + border: 0; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line-2); background: none; color: var(--tf); font-family: inherit; cursor: pointer; - font-size: 17px; font-weight: 600; line-height: 1; + font-size: 14px; font-weight: 600; line-height: 1; } @supports (text-box: trim-both cap alphabetic) and (font-size-adjust: cap-height 0.7) { .adb-tag { display: block; text-align: center; - font-size-adjust: cap-height 0.7333; - text-box: trim-both cap alphabetic; /* a button centres its 12.47px of cap height itself: 4.77px above and below, so no padding-top here */ + font-size-adjust: cap-height 0.7143; + text-box: trim-both cap alphabetic; /* a button centres its 10px of cap height itself: 4px above and below, so no padding-top here */ } } -.adb-tag:hover { color: var(--td, var(--tf)); opacity: .8; } +.adb-tag:hover { box-shadow: inset 0 0 0 1px var(--text-3); } .adb { display: none; } .adb-addr { color: var(--text-2); white-space: nowrap; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; } diff --git a/internal/ui/web/js/cards.js b/internal/ui/web/js/cards.js index 8242ee2a..922866bb 100644 --- a/internal/ui/web/js/cards.js +++ b/internal/ui/web/js/cards.js @@ -153,11 +153,11 @@ function makeCard(i) { c.peek); c.title = h('h2', { class: 'card-title', id: `card-t-${i}` }); // The marks after the instance name are single glyphs, with no box behind them. The rule (the styles are in app.css, with the same text): - // - A mark is a 22px box with no background and no outline, with exactly one capital letter (17px, weight 600, 12.47px - // cap height, 4.77px above and below at 1x) or one icon in it. The ink of every mark is 12.47px, centred in the box (y 4.77–17.23); - // the cat head is drawn at 18.07px and the monitor at 16px for that, the ADB tag is the letter A like G and K. Colour is - // --text-2 (--tf for the adb tag, which is a button too, and a proxy mark in tone-warn / tone-err), a hover makes it - // brighter. No words, no second letter; what it means goes in its title and aria-label. + // - A mark is an 18px cell with a 1px --line-2 frame (inset box-shadow, radius 5px) and no background colour, with exactly one capital + // letter (14px, weight 600, 10px cap height, 4px above and below at 1x) or one icon in it. The ink of every mark is 10px, y 4–14; + // the cat head is drawn at 14.5px and the monitor at 12.83px for that, the ADB tag is the letter A like G and K. Colour is + // --text-2 (--tf for the adb tag, which is a button too, and a proxy mark in tone-warn / tone-err; the icon only, never a background). + // The two buttons (cat head, A) darken the frame to --text-3 on hover. No words, no second letter; what it means goes in its title and aria-label. // - Today: cat head = 按应用走代理, G = Google Play 商店, K = KernelSU, // monitor with a slash = 无头 (headless). // - Order: marks that are always there come first; marks that come and go with the run state come last, so one diff --git a/scripts/test_create_cancel.mjs b/scripts/test_create_cancel.mjs index 55a8b715..e273dbe6 100644 --- a/scripts/test_create_cancel.mjs +++ b/scripts/test_create_cancel.mjs @@ -881,10 +881,10 @@ test('the stylesheet hides the quiet status label for the card view only and kee assert.doesNotMatch(css, /pill-quiet[^{]*\{[^}]*display: none/); assert.match(rule('.grid:not(.is-list) .card-head'), /min-height: 23px/); assert.match(rule('.grid:not(.is-list) .card-tline .card-title'), /flex: 1/); - assert.doesNotMatch(rule('.pmark, .smark, .kmark, .hmark'), /var\(--(tb|sunken)\)/, 'no box behind a mark'); + assert.doesNotMatch(rule('.pmark, .smark, .kmark, .hmark'), /var\(--(tb|sunken)\)/, 'no background colour behind a mark'); assert.doesNotMatch(rule('.pmark.tone-warn, .pmark.tone-err'), /background/, 'the state colour is the icon only'); assert.doesNotMatch(rule('.adb-tag'), /var\(--tb\)/); - assert.match(rule('.hmark .ic'), /width: 16px; height: 16px/, 'the monitor drawing is 12.5px of ink at 16px, the cap height of the 17px letters'); + assert.match(rule('.hmark .ic'), /width: 12\.83px; height: 12\.83px/, 'the monitor drawing is 12.5px of ink at 16px: 10px at 12.83px, the cap height of the 14px letters'); assert.match(rule('.pmark.tone-warn, .pmark.tone-err'), /color: var\(--tf\)/); // no box under the card in either view: no styles for it, and the list row is one grid row assert.doesNotMatch(css, /\.notes\b|\.note \{|\.note-main|\.note-text|\.note-adv|\.note-links|\.is-list \.note\b/); @@ -892,8 +892,9 @@ test('the stylesheet hides the quiet status label for the card view only and kee assert.match(rule('.grid:not(.is-list) .card-actions'), /display: none/); assert.match(rule('.grid:not(.is-list) .card-body'), /gap: 4px/); assert.match(rule('.adb-tag'), /display: inline-grid/); - assert.match(rule('.card-title'), /font-size: 17px/); - assert.match(rule('.smark, .kmark'), /font-size: 17px/); + assert.match(rule('.card-title'), /font-size: 15px/); + assert.match(rule('.smark, .kmark'), /font-size: 14px/); + assert.match(rule('.pmark, .smark, .kmark, .hmark'), /box-shadow: inset 0 0 0 1px var\(--line-2\)/, 'a thin frame, no background colour'); assert.match(rule('.pill-link'), /cursor: pointer/); }); From 45fbcb5d36b1624f80e5a7c0a60043e91ae0f12f Mon Sep 17 00:00:00 2001 From: qiyinxi Date: Sat, 5 Dec 2026 19:29:56 +0100 Subject: [PATCH 4/4] =?UTF-8?q?changelog=EF=BC=9A=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E8=A1=8C=E5=8E=8B=E5=88=B0=20120=20=E5=AD=97=E7=AC=A6=E4=BB=A5?= =?UTF-8?q?=E5=86=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs ModAVD/ModAVD#462 --- changelog.d/issue-462-card-marks.change.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/issue-462-card-marks.change.md b/changelog.d/issue-462-card-marks.change.md index d78e9a9c..df74744c 100644 --- a/changelog.d/issue-462-card-marks.change.md +++ b/changelog.d/issue-462-card-marks.change.md @@ -1,2 +1,2 @@ 实例卡片标记改成细框、无底色,ADB 改成字母 A;鼠标操作不再出现焦点框;名称提示不再写编号 -Instance card marks get a thin frame and no fill, ADB becomes the letter A, the focus ring shows only for keyboard use, and the tooltip drops the index. +Card marks get thin frames, ADB is the letter A, focus rings are keyboard-only, and the name tooltip drops the index.