fix: prevent account permission editor occlusion

This commit is contained in:
inman committed 2026-09-02 16:59:53 +08:00
1 parent a618d3dd9f
commit b26001e039
6 files changed
+107 -9

No files matched your search

@@ -339,3 +339,30 @@ test('operator UI exposes role-aware accounts, executive drill-through, original
assert.doesNotMatch(retention, /DELETE FROM tasks/);
assert.doesNotMatch(retention, /DELETE FROM audit_events/);
});
test('account authorization editor uses a scroll-safe open layout without overriding the closed account list', async () => {
const [app, index, styles] = await Promise.all([
source('../../LianSyn-platform/app.js'),
source('../../LianSyn-platform/index.html'),
source('../../LianSyn-platform/styles.css')
]);
const renderStart = app.indexOf('function renderAccountAuthorizationPanel()');
const renderEnd = app.indexOf('function openAccountAuthorizationEditor(', renderStart);
const renderSource = app.slice(renderStart, renderEnd);
assert.match(renderSource, /const isOpen = Boolean\(account && account\.role !== 'admin'\)/);
assert.match(renderSource, /classList\.toggle\('is-authorizing', isOpen\)/);
assert.match(renderSource, /if \(!isOpen\)/);
const genericLayout = styles.indexOf('.channels-page .channel-panel {');
const openLayout = styles.indexOf('.channels-page .channel-panel.account-panel.is-authorizing {');
assert.ok(genericLayout >= 0, 'generic management-page layout is present');
assert.ok(openLayout > genericLayout, 'account open-state layout follows the generic layout in the cascade');
const openLayoutSource = styles.slice(openLayout, styles.indexOf('}', openLayout) + 1);
assert.match(openLayoutSource, /height:\s*max-content/);
assert.match(openLayoutSource, /grid-template-rows:\s*auto auto auto auto auto/);
assert.match(openLayoutSource, /overflow:\s*visible/);
assert.doesNotMatch(styles, /\.account-panel\s*\{\s*grid-template-rows:/);
assert.match(index, /styles\.css\?v=20260902-account-authorization-layout-1/);
assert.match(index, /app\.js\?v=20260902-account-authorization-layout-1/);
});
+2 -2
View File
@@ -1231,8 +1231,8 @@ test('operator page has a login gate and uses the durable task API', async () =>
const inpage = await readFile(new URL('../../chrome-extension/ltjt-order-assistant/inpage.js', import.meta.url), 'utf8');
assert.match(index, /id="loginPanel"/);
assert.match(index, /id="workbench"[^>]*hidden/);
assert.match(index, /styles\.css\?v=20260902-agentbus-dashboard-metrics-filter-1/);
assert.match(index, /app\.js\?v=20260902-agentbus-dashboard-metrics-filter-1/);
assert.match(index, /styles\.css\?v=20260902-account-authorization-layout-1/);
assert.match(index, /app\.js\?v=20260902-account-authorization-layout-1/);
assert.match(index, /id="statusDetailsPopover"/);
assert.match(index, /id="statusDetailsRefresh"/);
assert.match(app, /apiRequest\(`\/api\/tasks\?\$\{params\.toString\(\)\}`/);