Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

💡 Stretch sizing (fill the cross axis)

Aperta
#71 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

enhancement

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bombshell-dev/tty

Tutte le issue di bombshell-dev/tty

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.