Repository navigation
fix(client): 面板锚点按最近包含块换算(修复皮肤下偏到屏幕右侧) - #14
Merged
Merged
Conversation
fix(host): use session.snapshotEvents() for dsh-session >= 0.1.2-rc.1
…session >= 0.1.2-rc.1) - fix(host): adapt /usage route to use session.snapshotEvents() for dsh-session >= 0.1.2-rc.1 with fallback to legacy session.events (Max-Samson#7) - test: add coverage for snapshotEvents() preference and fallback under /usage - docs: update README and CHANGELOG to 1.1.4 - chore: bump version to 1.1.4 in package.json and package-lock.json
adj: add 4.1 flash and price change 0910
…ly time ctx.effect(() => fileSource.dispose(), ...) calls dispose while the fiber is being built and registers undefined as the disposer: the file source is dead before its first read, so pricing.json is never applied and the change watcher never fires. Return a disposer instead. Test mocks now follow cordis semantics (run setup, keep the returned disposer, release it in after()) and a /pricing route regression test covers the override path - it fails against the old form.
A position:fixed box is laid out against its containing block, not the viewport: any ancestor with transform / filter / backdrop-filter / contain / container-type takes that role. The maid-atelier skin blurs the dock children ([data-slot='conversation.composer.dock'] > *, backdrop-filter: blur(2px)), so the popover was offset by the indicator row's own origin and flew off to the right of the screen. Look up the nearest containing block and convert the viewport anchor into its coordinate space; also guard the clamp range on narrow windows.
rezon-aki
force-pushed
the
pr/panel-containing-block
branch
from
September 20, 2026 00:40
ed11bd5 to
3851fad
Compare
Max-Samson
self-requested a review
September 23, 2026 15:19
Owner
|
非常感谢这个极其细致且专业的修复! 在支持现代 CSS 特效(如
|
rezon-aki
added a commit
to rezon-aki/dsh-usage-chart
that referenced
this pull request
Sep 23, 2026
- 上游 v1.1.7 已收录本 fork 早先提的 4 项修复(PR Max-Samson#10/Max-Samson#12/Max-Samson#14/Max-Samson#15)与合并事故修复 (9753856),fork 不再重复维护它们;README / FORK_NOTES 改为「已并入上游」的口径。 - fork 独有改动只剩「面板可拖动」:panel-position.ts(持久化 + 包含块夹取)+ UsageIndicator 把手/双击复位 + i18n/styles + tests/panel-position.test.mjs, 直接取自上游 v1.1.7 基线上的实现(与本地 live 仓库同一份代码)。 - CHANGELOG 中英新增 [1.1.7-dsh.1] 段。
4 of 5 tasks
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.
这个改动带来什么
现象
装了会给输入框所在 dock 的祖先加
backdrop-filter(或其它「创建包含块」属性)的皮肤时 —— 例如 maid-atelier 给[data-slot='conversation.composer.dock'] > *加了backdrop-filter: blur(2px)—— 用量面板会跑到「用量」按钮右侧很远处,而不是贴在按钮上方。根因
position: fixed的定位基准是最近的包含块,不是视口。transform、translate/rotate/scale、perspective、filter、backdrop-filter、contain、container-type以及匹配的will-change都会让该祖先成为包含块。锚点是用视口坐标算的,直接写进left/bottom:存在这样的祖先时,视口坐标被相对它又应用了一次(落点约等于按钮 left + 视口 left)。修法
left - base.left、base.bottom - rect.top + 8)。base为undefined,偏移取0与window.innerHeight,与原来的视口算法完全一致。backdropFilter/containerType/translate的旧浏览器保持现有行为。innerWidth - width - 8小于 8 时left仍保持在屏幕内。1 个文件,+25/−2,无新增依赖。
验证
npm run typecheck:0 错误。npm test:41/41 通过(node 22,dsh 0.1.5-rc.2)。backdrop-filter时面板在按钮上方展开;不带时落点与改动前一致。