💡 flex-shrink and flex-basis
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- c, typescript
Direzione di ricerca
Inizia con il test che fallisce in test/flex-shrink.test.ts, poi leggi clay/clay.h intorno alle righe 2318 e 2358-2401 per comprendere la distribuzione delle dimensioni e dell’overflow. Traccia il percorso wire attraverso src/clayterm.c:365 e ops.ts:16 e 216. Il lavoro è completo quando lo shrink ponderato e il comportamento di basis funzionano end-to-end, il comportamento predefinito conserva no-shrink e la repro esegue il rendering di tutti e tre i glifi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem?
When children overflow their parent along the main axis, we can't absorb the overflow by shrinking sized children. The solver only redistributes free space across grow children and excludes fixed/percent from compression, so an overflowing row keeps every child at its declared size and pushes trailing children off-grid. A width-10 row with two fixed(6) children plus a trailing fit() lays A at width 6, B at 6, and C at x=12—off the 10-wide grid—so C never renders, giving "A B " instead of all three glyphs.
Describe the solution you'd like
A child should support a flex-basis as the solver's starting main size plus a shrink weight controlling how much overflow it absorbs. shrinkWeight (exact name TBD) should mirror the CSS flex-shrink property and default to 0, preserving today's no-shrink behavior; basis mirrors CSS flex-basis and seeds the main size before the solver runs. For the scene above, marking both width-6 children shrinkable by 1 distributes the 3-column overflow (6→5, 6→4), landing C at x=9 and rendering "A B C".
open("a", {
layout: {
width: {
...fixed(6),
basis: 6,
shrinkWeight: 1,
},
height: fixed(1),
},
});
Describe alternatives you've considered
A JS-side workaround means measuring intrinsic sizes, computing the negative-free-space split, and re-emitting each child as a fixed() of the shrunk width before render. That duplicates the solver in the bindings, can't see wrapped-text or nested intrinsic sizes the way Clay does, and breaks the moment a parent resizes.
Additional context
Failing test case on nm/repro/flex-shrink (test · diff). Today A and B stay at width 6 and C lands at x=12. Likely spans the Clay solver and the wire format: clay/clay.h:2318 skips FIXED/PERCENT from resizableContainerBuffer, clay/clay.h:2358-2401 runs the sizeToDistribute < 0 loop with no per-child shrink weight, src/clayterm.c:365 decode_axis has no basis/shrink word, and ops.ts:16 packAxis plus the ops.ts:216 SizingAxis union would need a basis/shrink-aware shape.
- Lingua principale
- TypeScript
- Stelle
- 42
- Fork
- 2
- Merge medio
- 2g 5h
- PR unite (30g)
- 12
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bombshell-dev/tty
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bombshell-dev/tty#61 · 1 reazione ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
bombshell-dev/tty#129 ·
-
question
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
bombshell-dev/tty#112 ·
-
enhancement high priority
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
bombshell-dev/tty#83 · 2 commenti ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
bombshell-dev/tty#82 ·
Tutte le issue di bombshell-dev/tty
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
fil-donadoni/tolaria#4409 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
corsairdev/corsair#1764 ·