fix: stabilize mobile drawer and oneliner status

This commit is contained in:
kris
2026-03-30 13:29:09 +08:00
parent 4242b40f5c
commit d88d7c0a5f
3 changed files with 18 additions and 2 deletions

View File

@@ -10475,6 +10475,7 @@ document.addEventListener("click", async (event) => {
renderAll();
} finally {
setBusy(false, "");
renderAll();
}
return;
}

View File

@@ -177,7 +177,7 @@ select {
.mobile-sidebar-backdrop {
position: fixed;
inset: 0;
z-index: 38;
z-index: 46;
background: rgba(24, 36, 51, 0.26);
opacity: 0;
pointer-events: none;
@@ -1977,7 +1977,7 @@ tbody tr:hover {
bottom: 0;
width: min(88vw, 320px);
height: 100vh;
z-index: 42;
z-index: 47;
transform: translateX(-104%);
transition: transform 0.22s ease;
border-right: 1px solid rgba(201, 220, 239, 0.82);
@@ -1991,6 +1991,12 @@ tbody tr:hover {
transform: translateX(0);
}
.mobile-sidebar-open .mobile-tabbar,
.mobile-sidebar-open .mobile-shell-bar {
opacity: 0;
pointer-events: none;
}
.brand {
gap: 10px;
padding: 4px 4px 12px;

View File

@@ -45,7 +45,10 @@ test("mobile shell styling uses safe-area padding, drawer navigation, and fixed
assert.match(CSS, /\.mobile-shell-bar\s*\{[\s\S]*position:\s*sticky/);
assert.match(CSS, /\.mobile-tabbar\s*\{[\s\S]*position:\s*fixed/);
assert.match(CSS, /\.mobile-sidebar-backdrop\s*\{[\s\S]*position:\s*fixed/);
assert.match(CSS, /\.mobile-sidebar-backdrop\s*\{[\s\S]*z-index:\s*46/);
assert.match(CSS, /\.mobile-sidebar-open\s+\.sidebar\s*\{[\s\S]*transform:\s*translateX\(0\)/);
assert.match(CSS, /@media \(max-width: 760px\)[\s\S]*\.sidebar\s*\{[\s\S]*z-index:\s*47/);
assert.match(CSS, /@media \(max-width: 760px\)[\s\S]*\.mobile-sidebar-open \.mobile-tabbar,[\s\S]*\.mobile-sidebar-open \.mobile-shell-bar\s*\{[\s\S]*pointer-events:\s*none/);
assert.match(CSS, /\.content\s*\{[\s\S]*padding-bottom:\s*calc\(110px \+ env\(safe-area-inset-bottom\)\)/);
assert.match(CSS, /\.oneliner-fab\s*\{[\s\S]*bottom:\s*calc\(96px \+ env\(safe-area-inset-bottom\)\)/);
assert.match(CSS, /@media \(max-width: 760px\)[\s\S]*\.mobile-workspace-strip\s*\{[\s\S]*display:\s*grid/);
@@ -111,6 +114,12 @@ test("mobile action sheets and oneliner runtime behave like bottom sheets", () =
assert.match(CSS, /@media \(max-width: 760px\)[\s\S]*\.oneliner-composer\s*\{[\s\S]*position:\s*sticky/);
});
test("opening OneLiner clears the transient loading state after the panel is hydrated", () => {
const actions = extractBetween(APP, "document.addEventListener(\"click\", async (event) => {", "document.addEventListener(\"submit\", async (event) => {");
assert.match(actions, /name === "open-oneliner"[\s\S]*setBusy\(true,\s*"正在打开 OneLiner\.\.\."\)/);
assert.match(actions, /name === "open-oneliner"[\s\S]*finally \{[\s\S]*setBusy\(false,\s*""\);[\s\S]*renderAll\(\);[\s\S]*\}/);
});
test("project creation and switching use in-app sheets instead of browser prompts", () => {
const createProject = extractBetween(APP, "async function createProject()", "function openPreferredModelAction()");
const projectSwitcher = extractBetween(APP, "function openDashboardProjectSwitcher()", "function openDashboardActionReasonAction(");