💡 Stretch sizing (fill the cross axis)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- c, typescript
- Ambito
- frontend
Direzione di ricerca
Inizia da test/stretch-sizing.test.ts e dal diff referenziato, quindi segui decode_axis in src/clayterm.c e gli helper di sizing e il caso packAxis in ops.ts. Segui il passaggio di layout in cui viene applicato il dimensionamento dell’asse trasversale; è terminato quando stretch() è supportato e il test stretch-sizing che fallisce passa per un figlio che riempie l’asse trasversale disponibile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem?
There's no sizing mode that fills the cross axis. grow() expands a child along the container's main axis, but on the cross axis a child only ever sizes to its content (fit) unless you hardcode a fixed(). In a top-to-bottom container 12 cells wide, a fit-content child holding X computes width: 1—there's no way to say "fill the container's width" so it spans all 12.
Describe the solution you'd like
A stretch() sizing axis, sibling to grow() / fit() / fixed(), that expands the element to fill the available cross-axis space:
open("child", {
layout: {
width: stretch(),
height: fixed(3),
},
});
The name is stretch (not grow, which is main-axis flex-grow, nor fill)—it's the cross-axis analog, matching the CSS width: stretch sizing keyword. Flexbox also expresses the same fill behavior as align-self: stretch, so this is the sizing-side counterpart to per-child align-self (#70). A stretch width in a ttb container makes the child span the full container width.
Describe alternatives you've considered
Setting width: fixed(containerWidth) works only when the container size is known and static—it hardcodes the dimension, breaks on resize, and can't follow a grow/fit parent. The renderer already knows the cross-axis extent at layout time; stretch just opts the child into it.
Additional context
Failing test case on nm/repro/stretch-sizing (test · diff).
decode_axis (src/clayterm.c:365) handles only FIT / GROW / PERCENT / FIXED; this needs a new stretch axis type there, a stretch() helper and packAxis case in ops.ts, and the cross-axis grow applied in the layout pass.
- 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 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
bug v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
modelcontextprotocol/inspector#2458 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
carbon-design-system/ibm-products#9907 ·