增加分栏后可以全屏和还原的功能

This commit is contained in:
allen2fuc
2026-05-13 17:46:05 +08:00
parent b3d3f0edcb
commit db4d8e5090
6 changed files with 67 additions and 11 deletions
+14
View File
@@ -10,6 +10,20 @@ import {
} from "react";
const SPLIT_STORAGE_KEY = "luxsin-ai-split-pct";
/** sessionStorage: left-pane route before jumping from split to full-screen `#/ai` (desktop). */
export const AI_SPLIT_RESTORE_PATH_KEY = "luxsin_ai_restore_path";
export function readAndClearAiSplitRestorePath(): string {
try {
const s = sessionStorage.getItem(AI_SPLIT_RESTORE_PATH_KEY);
sessionStorage.removeItem(AI_SPLIT_RESTORE_PATH_KEY);
if (s && typeof s === "string" && s.startsWith("/") && !s.includes("..")) return s;
} catch {
/* ignore */
}
return "/";
}
const SPLIT_MIN = 28;
const SPLIT_MAX = 72;