💡 flex-shrink and flex-basis
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- c, typescript
Línea de trabajo
Empieza con el test que falla en test/flex-shrink.test.ts y luego lee clay/clay.h alrededor de las líneas 2318 y 2358-2401 para entender la distribución del tamaño y del overflow. Sigue el recorrido del wire a través de src/clayterm.c:365 y de ops.ts:16 y 216. Se considera terminado cuando el shrink ponderado y el comportamiento de basis funcionan de extremo a extremo, el comportamiento predeterminado conserva no-shrink y la repro renderiza los tres glifos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 42
- Forks
- 2
- Merge medio
- 2 d 5 h
- PR fusionados (30 d)
- 12
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bombshell-dev/tty
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
bombshell-dev/tty#61 · 1 reacción ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
bombshell-dev/tty#129 ·
-
question
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
bombshell-dev/tty#112 ·
-
enhancement high priority
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
bombshell-dev/tty#83 · 2 comentarios ·
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
bombshell-dev/tty#82 ·
Todos los issues de bombshell-dev/tty
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
fil-donadoni/tolaria#4409 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
corsairdev/corsair#1764 ·