💡 Parent-relative min/max (percent) constraints for sizing
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- 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 bị lỗi trong test/percent-sizing.test.ts và diff nm/repro/percent-sizing của nó, sau đó đọc Clay_SizingMinMax trong clay/clay.h:316-328. Theo dõi cách các giới hạn kích thước đến được layout engine và xác định những thay đổi cần thiết đối với API và wire. Công việc được hoàn tất khi các giới hạn dưới và trên tương đối theo parent vẫn giữ nguyên hành vi của các ô tuyệt đối và test vượt qua.
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 size an element relative to its parent as a constraint rather than a fixed size. We can say "exactly 50% of the parent" with percent(0.5), but not "at least 50%" or "at most 50%" while still letting content drive the actual size. A sidebar that should be ≥50% tall but grow with its content, or a panel capped at half the viewport, can't be expressed: percent(0.5) pins to exactly 6 rows in a 12-row parent regardless of content, and fit()/grow() only take absolute cell counts in their min/max slots. (Passing a percent into a min/max slot today corrupts layout—it's coerced into a garbage float.)
Describe the solution you'd like
A way to express parent-relative floors and caps, not just fixed sizes, so an element can be bounded by a fraction of its parent while content still determines the size within those bounds. The exact API is open; a few directions worth weighing:
- Percent in the existing min/max slots —
fit(percent(0.5))/fit(0, percent(0.5)). Smallest surface, but overloads the min/max args. - Dedicated clamp helpers —
clamp(min, max)orminmax(min, max)accepting cells orpercent(...), composing withfit()/grow(). More explicit about intent. min()/max()constraint helpers — CSS-like, e.g.max(fit(), percent(0.5)). Most general, largest surface.
Whatever the shape: numeric bounds must keep exact absolute-cell semantics (additive only), and a percent bound should clamp content-aware—a floor still lets content grow past it, a cap still lets content shrink below it.
Describe alternatives you've considered
Measure the parent first (info.get(parent).bounds), compute the cell count, and feed an absolute number back on a second pass—but that needs two renders, goes stale on resize, and can't express floor-plus-content-grows in one pass. The whole-axis percent() is the existing primitive that falls short here.
Additional context
Failing test case on nm/repro/percent-sizing (test · diff). Whichever shape wins, the clamp lives deepest in the layout engine: Clay_SizingMinMax (clay/clay.h:316-328) is absolute float cells with no parent-relative bound, so it needs a percent-aware min/max on the wire and in the engine.
- Ngôn ngữ chính
- TypeScript
- Star
- 43
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 ·
-
Track terminfo capability follow-upsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ 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 ·
-
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 ·
-
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 ·
-
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 ·
Tất cả issue của bombshell-dev/tty
Issue tương tự
-
Upgrade node-libzim to 4.7.0Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
openzim/mwoffliner#2933 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Use the README category name for website links and submissionsCó thể đã có người làm @dajiaohuang đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
birobirobiro/awesome-shadcn-ui#647 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Add: Valea Prahovei TV RO SDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/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
Urigo/accounter-fullstack#4604 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày