feat(web): add peripheral card quick controls

This commit is contained in:
Miayui
2026-09-21 16:01:42 +08:00
parent ad0c1f4ed1
commit ba5dfcd6da
14 changed files with 530 additions and 19 deletions
@@ -116,3 +116,18 @@ def test_homepage_only_reveals_nfc_devices_detected_in_this_run() -> None:
assert "const detectedNfcIds = new Set(" in unified
assert "detectedNfcIds.has(normalizeCardUid(device.cardUid))" in unified
assert "检测到已绑定的 NFC 后,外设将在本次运行期间持续显示" in unified
def test_homepage_peripheral_cards_are_single_expand_and_quick_control_surfaces() -> None:
source = SOURCE_PATH.read_text(encoding="utf-8")
unified = _function_source(
source,
" function buildUnifiedExtensionSync() {",
"\n function init()",
)
assert "expandedPeripheralDeviceId === device.id" in unified
assert 'data-hide-peripheral-card="${escapeHtml(device.id)}"' in unified
assert 'data-toggle-peripheral-card="${escapeHtml(device.id)}"' in unified
assert 'data-run-peripheral-quick-action="${escapeHtml(action.id)}"' in unified
assert "hiddenPeripheralDevices.has(device.id)" in unified