diff --git a/web/public/cloud/admin-maintenance-notices.js b/web/public/cloud/admin-maintenance-notices.js index af710be4..9f0f9bdb 100644 --- a/web/public/cloud/admin-maintenance-notices.js +++ b/web/public/cloud/admin-maintenance-notices.js @@ -197,13 +197,24 @@ if (root) { } async function openDetail(key) { const dialog = byId('maintenance-detail'); - if (!dialog.open) dialog.showModal(); + if (!dialog.open) { + const opened = window.VenixDrawerMotion?.openDrawerWithMotion(dialog); + if (!opened) dialog.showModal(); + } byId('maintenance-detail-state').textContent = '正在读取通知详情…'; byId('maintenance-detail-body').replaceChildren(); byId('maintenance-detail-cancel').hidden = true; try { renderDetail(await runtime.read(`/api/v1/admin/maintenance-notices/${encodeURIComponent(key)}`)); } catch (error) { byId('maintenance-detail-state').textContent = error.message || '详情读取失败。'; } } + async function closeDetail() { + const dialog = byId('maintenance-detail'); + if (window.VenixDrawerMotion?.closeDrawerWithMotion) { + await window.VenixDrawerMotion.closeDrawerWithMotion(dialog); + return; + } + if (dialog.open) dialog.close(); + } function uncertain(error) { if (!error?.mutationMayHaveApplied) return false; state.mutationLocked = true; @@ -260,8 +271,8 @@ if (root) { } catch (error) { if (!uncertain(error)) notify(error.message || '取消失败。', true); } finally { button.disabled = state.mutationLocked; } }); - byId('maintenance-detail-close').addEventListener('click', () => byId('maintenance-detail').close()); - byId('maintenance-detail').addEventListener('cancel', event => { event.preventDefault(); byId('maintenance-detail').close(); }); + byId('maintenance-detail-close').addEventListener('click', () => { void closeDetail(); }); + byId('maintenance-detail').addEventListener('cancel', event => { event.preventDefault(); void closeDetail(); }); byId('maintenance-notice-refresh').addEventListener('click', () => { void loadPage(state.page.page || 1); }); byId('maintenance-status-filter').addEventListener('change', () => { void loadPage(1); }); byId('maintenance-previous').addEventListener('click', () => { void loadPage(Math.max(1, Number(state.page.page || 1) - 1)); }); diff --git a/web/resources/views/venix/layout_assets.tpl b/web/resources/views/venix/layout_assets.tpl index ff674d31..cd143aa4 100644 --- a/web/resources/views/venix/layout_assets.tpl +++ b/web/resources/views/venix/layout_assets.tpl @@ -1,2 +1,2 @@ {* Shared Venix CSS/JS cache key. Increment whenever a shared browser asset changes. *} -{assign var=venix_asset_version value='2026110603' scope='global'} +{assign var=venix_asset_version value='2026110604' scope='global'} diff --git a/web/tests/AdminMaintenanceNoticeBehaviorTest.mjs b/web/tests/AdminMaintenanceNoticeBehaviorTest.mjs index cba8b196..6af742b2 100644 --- a/web/tests/AdminMaintenanceNoticeBehaviorTest.mjs +++ b/web/tests/AdminMaintenanceNoticeBehaviorTest.mjs @@ -16,6 +16,14 @@ assert.match(source, /if \(!error\?\.mutationMayHaveApplied\) return false;[\s\S 'An uncertain write must lock the composer instead of replaying it.'); assert.match(source, /VenixAdminDangerDialog\.confirm/, 'Cancellation must use the shared administrator danger dialog.'); +assert.match(source, + /async function openDetail\(key\)[\s\S]*VenixDrawerMotion\?\.openDrawerWithMotion\(dialog\)/, + 'Maintenance detail must use the shared drawer opener so transformed dialogs become visible.'); +assert.match(source, + /async function closeDetail\(\)[\s\S]*VenixDrawerMotion\.closeDrawerWithMotion\(dialog\)/, + 'Maintenance detail must use the shared drawer closer so mobile transitions finish safely.'); +assert.doesNotMatch(source, /if \(!dialog\.open\) dialog\.showModal\(\)/, + 'Opening the maintenance dialog directly leaves the drawer translated off screen.'); assert.doesNotMatch(source, /\bfetch\s*\(|innerHTML|window\.confirm/, 'The page must not bypass the request runtime or safe DOM rendering.'); diff --git a/web/tests/CloudAssetVersionContractTest.php b/web/tests/CloudAssetVersionContractTest.php index b7d144f1..e9132c9f 100644 --- a/web/tests/CloudAssetVersionContractTest.php +++ b/web/tests/CloudAssetVersionContractTest.php @@ -15,7 +15,7 @@ $assert = static function (bool $condition, string $message): void { }; $assert(is_string($assets) - && str_contains($assets, "venix_asset_version value='2026110603'") + && str_contains($assets, "venix_asset_version value='2026110604'") && is_string($cloudShell) && str_contains($cloudShell, '/cloud/app.js?v={$venix_asset_version}'), 'The cloud application entry must use the shared Venix asset version.'); diff --git a/web/tests/CloudServiceCompensationAdminPageContractTest.php b/web/tests/CloudServiceCompensationAdminPageContractTest.php index d7ffc0d2..701314e9 100644 --- a/web/tests/CloudServiceCompensationAdminPageContractTest.php +++ b/web/tests/CloudServiceCompensationAdminPageContractTest.php @@ -94,7 +94,7 @@ $assert(str_contains($instanceDetail, '补偿可用时间') 'The instance service and billing surface lost its scoped compensation shortcut.'); $assert(str_contains($assets, - "venix_asset_version value='2026110603'"), + "venix_asset_version value='2026110604'"), 'The compensation administrator assets must publish the requested cache version.'); echo "Service compensation administrator page contracts passed.\n";