Fix #1: Add support for spacer items in flex layouts#18
Merged
cassdeckard merged 2 commits intomainfrom Feb 15, 2026
Merged
Conversation
- Support primitive: null and spacer: true in flex items - Update buildFlex and populateFlexItems to add nil spacer via AddItem(nil, ...) - Add Spacer field to FlexItem in config/types.go - Update nested-pages-example.yaml: spacer floats form right, fixedSize 55 - Add spacer demo to flex.yaml for acceptance test - Add unit tests (TestBuildFlex_SpacerItems, TestBuildFlex_SpacerFlag) - Add acceptance test TestAcceptance_SpacerLayout Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Implements fix for #1: adds support for spacer items in flex containers so layouts can "float" primitives (e.g. a form) to the right by consuming remaining space on the left.
Changes
spacer: truefield toFlexIteminconfig/types.gobuildFlexandpopulateFlexItemsinbuilder/builder.goto treatprimitive: nullorspacer: trueas spacers—callflex.AddItem(nil, item.FixedSize, item.Proportion, item.Focus)instead of skippingnested-pages-example.yaml: Added spacer between textView and form to float form right (fixedSize 55)flex.yaml: Added spacer for acceptance test (Flex page is reliably navigable)TestBuildFlex_SpacerItems,TestBuildFlex_SpacerFlaginbuilder/builder_test.goTestAcceptance_SpacerLayoutnavigates to Flex page and asserts snapshotUsage
Alternative:
spacer: trueon a flex item.Testing
go test ./...(library tests pass)cd example && go test -run TestAcceptance_SpacerLayout -v ./...(acceptance test passes)cd example && go test -run TestAcceptance_Layout -v ./...(layout tests pass)