fix(dashboard): 扫码登录飞书弹层 portal 到 body,修复居中被顶到视口下方 - #730
Merged
deepcoldy merged 2 commits intoAug 7, 2026
Conversation
改头像/改名缺登录态时弹出的「扫码刷新飞书登录态」弹层,此前内联渲染在 头像组件的 DOM 深处,而该处位于 .app-shell(height:100dvh + overflow:hidden 的滚动容器)内部。position:fixed 被这个滚动容器约束,弹层被顶到视口下方, 用户第一眼看到的是盖满屏的半透明遮罩(像黑屏),要往下滚动才看得到二维码。 改为 createPortal 到 document.body(与 auth-expired-overlay 一致,也是本 仓库既有约定),弹层回到视口正中稳定居中。overlay 追加 overflow:auto 作为 极矮视口下的兜底,弹层高于视口时仍可滚动。 Co-Authored-By: Claude <noreply@anthropic.com>
- style.css: .feishu-login-modal 加 margin:auto。原 overflow:auto 兜底在 纯 flex 居中(align-items:center)下失效——modal 高于视口时上下等量溢出、 顶部滚不回,标题/关闭按钮够不着。auto margin 负可用空间归 0 使子元素落到 滚动起点、顶部可达,正常视口仍居中。 - bot-defaults-page.tsx: 订正 portal 根因注释。真正建立 fixed 包含块的是祖先 .page 的 dashboard-page-enter 动画(fill-mode:both 填充期 transform 被算成 identity matrix,非关键字 none),与主题无关;不是 .app-shell 的 overflow:hidden (overflow 不建立 fixed 包含块)。
deepcoldy
added a commit
to xiaoxueSunn/botmux
that referenced
this pull request
Aug 7, 2026
master 前进到 7ec6d4b(含 deepcoldy#775/deepcoldy#730/deepcoldy#750/deepcoldy#762),与 deepcoldy#597 二次冲突 6 文件。 本 worktree merge origin/master 解冲突(admin-squash 时拍平)。 6 文件逐点取舍: - core/reply-target.ts: union 两套并存的 per-turn 记录——deepcoldy#597 turnReplyContexts(frozen dispatch target)+ deepcoldy#750 replyTargets(mention-back 参与者窗口)。dedupeParticipants/buildTurnParticipantsFrom/collectTurnWindowParticipants/frozenReplyContextForTurn 全保留。 - cli.ts: replyTargets 类型取 master 更全版 + 保 deepcoldy#597 codex-app 字段;flash footer 取 master 对象式(deepcoldy#762),删除会话用 result.mode(非 master 误用的 result.via);replyTargetSenderOpenId 回退链 union:VC → deepcoldy#597 frozenTurnDispatch → deepcoldy#750 turnReplyTarget.senderOpenId → legacy。 - daemon.ts: 三处 registration-race 取 deepcoldy#597 结构化 claimNewDaemonSession + routeToCanonicalOwner/handleThreadReplyAdmitted;destructure union routeToCanonicalOwner + senderIsBot。修真实回归:CAS-loser 经 handleThreadReplyAdmitted 重算 post @s 只读 data.message 漏 ctx.forwardSeedData → 双 race 丢种子转发 post @。两处重算补 forward-seed 参数(codex 合并不变量deepcoldy#1)。 - 3 测试文件: import union;initial-passthrough-ownership 取 deepcoldy#597 claim 断言;cli-send-hook-context + daemon-turn-reply-sender-wiring 迁写到 deepcoldy#597 模型(forwardSeed 重算)并保 deepcoldy#750 mention-back 断言并存。 验证: pnpm build✅; 受影响套件全绿(reply-target-fallback 41/daemon-turn-reply-sender-wiring 7/cli-send-hook-context 14/send-policy 46/initial-passthrough-ownership 8/daemon-rename-route 55/command-handler 235/transfer-session 71/dashboard-create-session 41/trigger-session-root-message 41/restore-zombie-close 33/scheduler-silent-execute 24/session-resume 39); deepcoldy#597 核心 steer worker-routing 8+bridge 66+dispatch 6+transfer-gate 2+initial-user-turn 28。codex-app-runner 1 项既有 bounded-history flake 无关。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
如何发现
用户(孙晓雪)在 dashboard 给 bot 换头像,扫码登录飞书后反馈「黑屏」,需要滚动到很下面才看到二维码。
.feishu-login-overlay的半透明遮罩,但二维码弹层被顶到视口下方,第一眼看着像黑屏/空遮罩。用户看到什么
根因(经双 reviewer live 复审订正)
FeishuLoginModal直接内联渲染在头像组件(BotAvatarControl/BotProfileIdentity)的 DOM 里,而该处位于页面容器.page内部。.page带animation: dashboard-page-enter .35s ease both,关键帧动画transform(translateY(6px)→none)。animation-fill-mode: both下动画结束后持续「填充」最终帧,浏览器(Blink)把.page的 computedtransform算成 identity matrixmatrix(1,0,0,1,0,0),而不是关键字none——「非 none 的 transform」会为后代position:fixed建立包含块,于是弹层不再相对视口、被约束进.page的几何范围(本地复现 overlaytop=88, height=1954),modal 被居中到y≈881(视口外)。对照同仓库正常居中的
auth-expired-overlay——它渲染在 app 顶层(.page之外),不受此包含块影响。改了什么
bot-defaults-page.tsx:FeishuLoginModal改用createPortal(node, document.body),把弹层挂到 body 顶层,逃出任何祖先包含块(与auth-expired-overlay一致,也是本仓库既有约定——sessions-page、insights-page、skills-page都这么做)。加typeof document === 'undefined'守卫兼容 SSR/无 DOM 环境。同时把根因注释订正为准确版本(.page填充式 transform 动画,非overflow:hidden)。style.css:.feishu-login-overlay追加overflow: auto,作为极矮视口下弹层高于视口时的兜底滚动。.feishu-login-modal追加margin: auto。纯 flex 居中(align-items:center)下,modal 高于视口时会上下等量溢出,顶部溢出无法滚回(flexbox 通用行为),标题/关闭按钮够不着;margin:auto在负可用空间下归 0、子元素落到滚动起点使顶部可达,正常视口仍由 auto margin 居中。这样overflow:auto兜底才真正生效。两处
FeishuLoginModal调用点(头像、改名)共用同一组件,一处修复全部生效。影响面
纯 dashboard 前端改动:
.tsx仅调整渲染挂载点 + 注释,.css仅两条声明。不涉及 daemon / worker / 任何 CLI 适配器 / 后端逻辑,构建产物只进 dashboard bundle。portal 后经核对:.feishu-login-*专属样式全为纯类名或:where()列表(不依赖 DOM 位置)、:root主题变量仍继承、z-index 仍生效、backdrop/close/retry 事件语义不变;retry 按钮圆角由 999px→12px 属向对标的auth-expired-dialog收敛(后者本就在.page外、同为 12px),不是回归。测试验证
pnpm build:✅(domain audit +tsc --noEmit+ dashboard bundle + dist audit 全过)。git diff --check:✅。style.css,未注入补丁):top=0,height=599),modaltop=116.5,height=366,横纵中心误差 0px。top=20,关闭按钮/标题顶部完整可达(overlayscrollHeight=406, maxScrollTop=146)。margin:auto同时覆盖正/负 free-space 场景。transform: matrix(1,0,0,1,0,0),与订正后的源码注释一致;console 无新增错误。截图依次为:旧 inline(弹层被顶到视口下方)、portal 后正常视口居中、260px 极矮视口滚动起点顶部可达、滚动终点底部可达。