v0.1.22: 灯下春秋(双 UI 修复)+ 文档同步

【速度暂停根因】onYearPaper 岁末族簿弹出时强制 speed:0——缓行一年整遇年报即'自动变暂停'
→ 修复:年报不打断自动速度(弹窗与时间流解耦;玩家随手翻页)

【弹框层级根因】MemberModal/EventModal 渲染于 .main-left(z-index:1) 内部,
层叠上下文被 tabs(z-index:2) 压制——'弹框出现在宗族/谱系菜单下面'
→ 修复:ModalShell 全量走 React Portal 到 document.body(免疫一切祖先层叠上下文)
+ .modal-outer z-index 50→100 双保险

【测试】1018 全绿(纯 UI 修复,引擎基线 0.1.21 不动);build 通过
This commit is contained in:
2026-08-23 15:40:29 +08:00
parent 8f9c3c9a72
commit 4a1a034f1e
7 changed files with 14 additions and 8 deletions
+6 -1
View File
@@ -1,4 +1,5 @@
import { useEffect, type ReactNode } from 'react'
import { createPortal } from 'react-dom'
export interface ModalShellProps {
title: string
@@ -41,7 +42,9 @@ export function ModalShell({
return () => window.removeEventListener('keydown', onKey)
}, [onClose])
return (
// Portal 到 document.body:任何祖先(.main-left z1 / .app)的层叠上下文都无法压住弹框,
// 顶部菜单/主域均在其下(0.1.22 修复:弹框出现在宗族/谱系菜单下方的 z-index 越界)。
const shell = (
<div className="modal-outer" onClick={allowOuter ? onClose : undefined}>
<div className="modal" style={{ width: `min(92vw, ${width}px)` }} onClick={(e) => e.stopPropagation()} data-modal-kind="shell">
<button className="modal-close" onClick={onClose} title={closeLabel} aria-label={closeLabel}>
@@ -58,4 +61,6 @@ export function ModalShell({
</div>
</div>
)
if (typeof document === 'undefined') return shell
return createPortal(shell, document.body)
}
+1 -1
View File
@@ -210,7 +210,7 @@ export default function SettingsPanel() {
· <br />
·
</div>
<div className="dim2" style={{ marginTop: 8 }}> 0.1.21 · Chronicle of the Immortal Clan</div>
<div className="dim2" style={{ marginTop: 8 }}> 0.1.22 · Chronicle of the Immortal Clan</div>
</div>
</div>
)
+2 -1
View File
@@ -286,7 +286,8 @@ export const useGameStore = create<GameStore>((set, get) => ({
onYearPaper: (report) => {
if (report.year >= 2) {
sPaper()
set({ paperReport: report, speed: 0 })
// 0.1.22:年报不打断自动速度(旧:speed:0 导致「缓行过一月就变暂停」)
set({ paperReport: report })
}
},
+1 -1
View File
@@ -1237,7 +1237,7 @@ html[data-blade] .battle-lines {
display: flex;
align-items: center;
justify-content: center;
z-index: 50;
z-index: 100; /* 0.1.22 高于顶栏/菜单(2)与警讯(60)——配合 body Portal 双保险 */
}
.modal {
position: relative;