💡 Full floating attach corners (element + parent)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- c, typescript
调研方向
从 ops.ts:168 和 nm/repro/floating-attach/test/floating-attach.test.ts 中失败的测试开始。将那里的打包方式与 src/clayterm.c:546 所描述的字段解码进行比较,包括数值 attach-point 形式和 parent 默认值。完成的标准是:报告的两个 dot.x 情况都锚定到请求的 parent 角点,保留 zIndex,并且现有的数字形式行为仍然有效。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem?
A floating element can choose where it attaches, but not where it attaches on its parent. The floating.attachTo: PARENT path always anchors to the parent's top-left corner, so a width:5 parent's float that asks to sit at the parent's right edge should land at dot.x = parent.x(0) + parent.width(5) = 5 but lands at 0. Underneath, we pack zIndex directly over the parent-corner slot and never write the z-index bits, so floating.zIndex: 5 actually sets the parent corner and the requested z-index is dropped.
Describe the solution you'd like
Make the parent corner first-class via a structured attachPoints.{element, parent} (exact names TBD), each one of Clay's 9 attach points; the element corner anchors onto the chosen parent corner:
open("dot", {
floating: {
attachTo: ATTACH_TO_PARENT,
attachPoints: {
element: 0,
parent: 6,
}, // element LEFT_TOP onto parent RIGHT_TOP
},
});
The 9 attach points form a 3×3 grid around the parent, mirroring CSS anchor positioning's position-area. C already decodes both corners and z-index, so the fix is JS-side: pack element into bits 8-15, parent into 16-23, and move zIndex to 24-31. The number form keeps working as the element corner with parent defaulting to LEFT_TOP.
Describe alternatives you've considered
Compute the offset yourself—read the parent's info bounds from a prior render and set floating.x to parent.width. That needs a two-pass render, breaks on resize, can't express vertical anchors, and leaves zIndex unusable.
Additional context
Failing test case on nm/repro/floating-attach (test · diff); both cases report dot.x = 0 today. The change likely lives in ops.ts:168 (pack mis-slots attachPoints/zIndex); src/clayterm.c:546 already reads parent from bits 16-23 and zIndex from 24-31.
- 主要语言
- TypeScript
- 星标
- 42
- 派生
- 2
- 平均合并
- 21 小时 40 分钟
- 30 天内合并 PR
- 9
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bombshell-dev/tty 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 76/100
bombshell-dev/tty#61 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
bombshell-dev/tty#129 ·
维护者通常 1 天内回复
-
question
难度 5/5 一周以上 新手友好度 38/100
bombshell-dev/tty#112 ·
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 48/100
bombshell-dev/tty#82 ·
维护者通常 1 天内回复
-
🐛 VS16 (U+FE0F) emoji measured at the wrong width可能重新可做 @natemoo-re 于 117 天前认领,目前没有进行中的 PR。 未关闭bug
bombshell-dev/tty#81 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 bombshell-dev/tty 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 68/100
aiko-chan-ai/DiscordBotClient#380 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
vercel/ai-elements#507 ·
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 2 天内回复
-
难度 2/5 半天 新手友好度 84/100
anaclumos/qa-interns#148 · 1 条评论 ·
维护者通常 1 天内回复