💡 Signed margin: offset a box without consuming content width
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- c, typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
Bắt đầu với test/signed-margin.test.ts và repro diff, sau đó đọc cách đóng gói padding trong ops.ts và phần giải mã layout quanh src/clayterm.c:499. Theo dõi cách Clay_LayoutConfig và clip path hiện có xử lý hình học của box. Hoàn tất khi các margin dương và âm có dấu giữ nguyên chiều rộng nội dung, dịch chuyển box, cắt phần overflow ở đầu và vượt qua signed-margin test.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem?
There's no way to offset a box's position within its parent's flow. The only per-side knob is layout.padding, which shrinks the content box instead of moving the box: "Hello W" (7 cells) fits on one line in a fixed(8) box, but padding: { left: 2 } drops content to 6 cells and wraps to two lines. Padding also can't be negative—each side is an unsigned byte, so padding: { left: -3 } wraps to garbage (the box returns height: 511). There's no primitive for placing a box before its parent's content origin and clipping the overflow.
Describe the solution you'd like
A signed layout.margin that moves a box without shrinking its content, mirroring the CSS margin property: it sits outside the content box and may be negative. margin: { left: 2 } keeps the box's width and stays on one line; a negative left margin places the origin before the parent's content origin, so with the parent clipping, the leading cells are suppressed and the rest renders flush to the edge.
open("box", {
layout: { width: fixed(12), margin: { left: -3 } },
});
Describe alternatives you've considered
padding as a stand-in fails both ways: it shrinks content and corrupts geometry on negative input (unsigned packing). Pre-clipping strings in JS can't reflow or re-clip on resize and doesn't generalize to nested boxes.
Additional context
Failing test case on nm/repro/signed-margin (test · diff). margin needs its own signed word (the ops.ts padding packing is 4×uint8 and can't be reused) and a post-layout offset step in the layout decode (src/clayterm.c:499); Clay_LayoutConfig has no margin, so it's a new primitive on top of Clay that leans on the existing clip path.
- Ngôn ngữ chính
- TypeScript
- Star
- 42
- Fork
- 2
- Merge trung bình
- 21 giờ 40 phút
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bombshell-dev/tty
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
bombshell-dev/tty#61 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
bombshell-dev/tty#129 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
question
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
bombshell-dev/tty#112 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement high priority
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
bombshell-dev/tty#83 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
bombshell-dev/tty#82 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của bombshell-dev/tty
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
external-issue to-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
diegosouzapw/OmniRoute#15401 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Sign the pledgeĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
input-output-hk/devx-updates#163 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
code-yeongyu/oh-my-openagent#9454 ·
Maintainer thường phản hồi trong vòng 1 ngày