fix(cloud): isolate task center drawer

go
codex 1 month ago
parent d821d65d02
commit 92179b6eb9

@ -1,4 +1,4 @@
import { initializeTaskCenter } from './task-center.js?v=2026102305';
import { initializeTaskCenter } from './task-center.js?v=2026102306';
const pageModules = Object.freeze({
instances: '/cloud/instances.js',

@ -112,7 +112,8 @@ html.panel-task-open .panel-sidebar { transform: translate3d(0, calc(0px - var(-
.panel-task-drawer.is-drawer-visible::backdrop,
.panel-account-drawer.is-drawer-visible::backdrop { background: rgba(16,29,44,.46); }
.panel-announcements-drawer,
.panel-task-drawer { position: fixed; inset: 0 0 0 auto; width: min(540px, 100%); max-width: 100%; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #fff; color: #25384e; box-shadow: -12px 0 48px rgba(19,42,65,.16); overflow: hidden; }
.panel-task-drawer { position: fixed; inset: 0 0 0 auto; z-index: 1200; isolation: isolate; width: min(540px, 100%); max-width: 100%; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #fff; color: #25384e; box-shadow: -12px 0 48px rgba(19,42,65,.16); overflow: hidden; }
.panel-task-drawer:not([open]) { display: none; }
.panel-announcements-drawer[open],
.panel-task-drawer[open] { display: flex; flex-direction: column; }
.panel-task-header { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 24px 18px; border-bottom: 1px solid #e5edf2; }

@ -41,6 +41,9 @@
</main>
</div>
</div>
{if empty($smarty.get.drawer)}
{include file='user/task_center_drawer.tpl'}
{/if}
{if $cloud_page == 'detail'}{include file='cloud/console.tpl'}{/if}
<div id="toast" class="cloud-toast-region" role="region" aria-live="polite" aria-atomic="false" hidden></div>
<script type="module" src="/cloud/app.js?v={$venix_asset_version}"></script>

@ -1,2 +1,2 @@
{* Shared Venix CSS/JS cache key. Increment whenever a shared browser asset changes. *}
{assign var=venix_asset_version value='2026102305' scope='global'}
{assign var=venix_asset_version value='2026102306' scope='global'}

@ -29,7 +29,6 @@
<script src="/cloud/user-dialog.js?v={$venix_asset_version|escape:'html'}"></script>
{if empty($smarty.get.drawer)}
<script src="/cloud/drawer-motion.js?v={$venix_asset_version|escape:'html'}"></script>
{if $panel_cloud_mode}{include file='user/task_center_drawer.tpl'}{/if}
{include file='user/announcement_drawer.tpl'}
{include file='user/account_drawer.tpl'}
{/if}

@ -87,6 +87,17 @@ $assert(str_contains($cloudShell, "file='user/panel_sidebar.tpl'")
&& str_contains($userLayout, "file='user/panel_sidebar.tpl'"), 'Cloud and account pages must share one sidebar partial');
$assert(str_contains($cloudShell, "file='user/panel_topbar.tpl'")
&& str_contains($userLayout, "file='user/panel_topbar.tpl'"), 'Cloud and account pages must share one topbar partial');
$taskDrawerInclude = "{include file='user/task_center_drawer.tpl'}";
$assert(!str_contains($sharedTopbar, $taskDrawerInclude)
&& substr_count($cloudShell, $taskDrawerInclude) === 1
&& strpos($cloudShell, $taskDrawerInclude) > strpos($cloudShell, '</div>\n</div>'),
'The task center drawer must be a body-level cloud shell sibling, never nested in the scrolling main area');
$assert(preg_match('/\.panel-task-drawer:not\(\[open\]\)\s*\{[^}]*display:\s*none[^}]*\}/s',
$clientStyles) === 1,
'The task center drawer must remain hidden without relying on browser dialog defaults');
$assert(preg_match('/\.panel-task-drawer\s*\{(?=[^}]*isolation:\s*isolate)(?=[^}]*z-index:\s*[1-9][0-9]*)[^}]*\}/s',
$clientStyles) === 1,
'The task center drawer fallback must own an isolated layer above the user page');
$assert(preg_match('/\.panel-topbar\s*\{(?=[^}]*position:\s*sticky)(?=[^}]*top:\s*0)(?=[^}]*z-index:\s*[1-9][0-9]*)[^}]*\}/s',
$clientStyles) === 1,
'The shared user topbar must remain visible while the page content scrolls');

Loading…
Cancel
Save