feat: grid item - #19
Merged
Merged
Conversation
Transparent wrapper that carries col_span/row_span/area placement metadata for a child mounted inside a Grid cell. Renders its child with no visible markup of its own, so wrapping a widget never changes how it looks, only where/how big its cell is.
Grid resolves each child's placement before mounting it into its cell: a GridItem wrapper's col_span/row_span apply as grid-column/grid-row spans, or its area places the cell into a new template_areas region. Bare (unwrapped) children keep today's 1x1 row-major behaviour.
A cell's child previously kept its own intrinsic width/height (e.g. Stat's inline-block sizing), so a spanned or full-width cell left the visible card sitting at its natural narrow size instead of filling the wider track. Cells are now flex containers with their child set to flex: 1 1 auto, so any mounted widget stretches to fill its cell regardless of its own display value.
columns now accepts either an int (today's N-equal-columns behaviour) or a raw grid-template-columns track string (e.g. "200px 1fr"), for a sidebar narrower than the main content instead of a forced 50/50 split.
template_rows is a raw grid-template-rows track string (e.g. "auto 1fr auto") for a thin header/footer with a tall middle row; height gives the Grid itself a defined size so fr tracks have space to distribute, matching how CSS Grid's own 1fr row sizing requires a defined container height to mean anything.
…izing Adds GridItem's page under the Layout nav section, and documents col_span/row_span, template_areas, the columns track-string form, and template_rows/height on Grid and GridItem's own doc pages.
GridItem wasn't listed in build_skill_reference.py's GROUPS, so it fell into the unsectioned "Other" catch-all and got skipped entirely from the generated per-widget API reference. Regenerated widgets-api.md to match (CI's "Skill reference is up to date" check diffs this file against a fresh regen).
Member
|
@dzole0311 shall we merge this? I think once we have this merged, I can make a 0.2.0 release? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sketch based on comments in: #17 (comment)
Screen.Recording.2026-08-11.at.12.48.40.mov
cc @batpad @wrynearson