💡 Multi-line flex wrapping (flexWrap)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- c, typescript
- Ambito
- cli
Direzione di ricerca
Esegui il test che fallisce in test/flex-wrap.test.ts e confronta il diff di nm/repro/flex-wrap con main. Segui il gruppo di layout in ops.ts attraverso la decodifica in src/clayterm.c:499 e la configurazione di clay/clay.h vendored. È completato quando wrap, nowrap e wrap-reverse producono il posizionamento di riga richiesto, con nowrap che rimane il valore predefinito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem?
A flex container lays every child out on a single main-axis line, so children that exceed the container's main-axis size overflow past it instead of breaking. In a row container 2 cells wide with children A (1 wide) and BC (2 wide), BC is placed at x:1 and overflows to x:3—past width:2—and the grid prints ABC on one row. There's no way to ask a container to wrap, which makes column-of-cards / tag-cloud layouts impossible without measuring and chunking children by hand on the JS side.
Describe the solution you'd like
A container set to wrap should start a new line when a child no longer fits along the main axis (accumulated child main size + gaps exceeds the container's main-axis size), stacking the lines along the cross axis. For the example above, BC should land at {x:0, y:1, width:2, height:1} and the grid should print A then BC on two rows.
open("root", {
layout: {
width: fixed(2),
height: fixed(4),
direction: "ltr",
flexWrap: "wrap", // "nowrap" (default) | "wrap" | "wrap-reverse"
},
});
flexWrap should mirror the CSS flex-wrap property. Default to "nowrap", support "wrap" and "wrap-reverse".
Describe alternatives you've considered
We can pre-measure children in JS, chunk them into rows by hand, and emit a column of explicit ltr rows. That falls apart the moment sizing is fit/grow (we'd be duplicating the renderer's own measurement) and it doesn't survive a resize without re-chunking.
Additional context
Failing test case on nm/repro/flex-wrap (test · diff).
A wrap field needs to thread through the wire format and the layout pass: the layout group in ops.ts, the layout decode in reduce (src/clayterm.c:499), and Clay_LayoutConfig in the vendored clay/clay.h, which is single-line today.
- 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 74/100
ontola/atomic-server#1625 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
melgarafael/DeskcommCRM#1451 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
-
bug via-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
midnightntwrk/midnight-sdk#403 ·