💡 Full floating attach corners (element + parent)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- c, typescript
Research direction
Start at ops.ts:168 and the failing test on nm/repro/floating-attach/test/floating-attach.test.ts. Compare the packing there with the field decoding described at src/clayterm.c:546, including the numeric attach-point form and parent default. Done means both reported dot.x cases anchor to the requested parent corner, zIndex is preserved, and existing number-form behavior still works.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 42
- Forks
- 2
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 12
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bombshell-dev/tty
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bombshell-dev/tty#61 · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
bombshell-dev/tty#129 ·
-
question
Difficulty 5/5 Over a week Newbie friendliness 38/100
bombshell-dev/tty#112 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
bombshell-dev/tty#82 ·
-
bug
bombshell-dev/tty#81 · 1 assignee ·
All issues in bombshell-dev/tty
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·