Repository navigation
feat: add IndexedStack control - #29
Merged
Merged
Conversation
Add indexed_stack/indexedstack helpers and the IndexedStack wire type with the common layout keywords. index defaults to 0 so page updates round-trip.
2 tasks
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.
Adds the Ruby side of
IndexedStack(Work Package F, item F3). It keeps every tab body mounted and shows the one atindex. Unlikevisible, switching tabs keeps their state.Engine counterpart (renderer): AdamMusa/ruflet-engine#12
Usage
API
controls/shared/indexedstack_control.rb,RufletComponents::IndexedStackControl, TYPEindexedstack, WIREIndexedStack.indexed_stackandindexedstackin both the shared and the top-level registry.indexed_stack(children = nil, **props, &block)andindexedstackare inmaterial_control_methods.rb,shared_control_forwarders.rbanddsl.rb.alignment clip_behavior controls fit indexplus the common layout keywords (align animate_* aspect_ratio badge bottom col data disabled expand expand_loose height key left margin offset opacity right rotate rtl scale size_change_interval tooltip top visible width). Events:on_animation_end,on_size_change.indexdefaults to 0 (SPEC R5), sopage.update(body, index: n)round-trips. Flutter's own defaults coverfit(loose) andclip_behavior(hardEdge).Tests
test/indexed_stack_compatibility_test.rb(7 runs). It covers:_c, positional,controls:and block children, and the serialized props;Ruflet.control(:indexed_stack)andRuflet::DSLhelpers;indexdefault;has_handler?for the layout events;ArgumentError;page.update(body, index: 1).verify_pr.sh: ruflet_core 146/146 files, 625 runs, all green. The engine pair passes too (+712 tests, analyze clean). The wire-key audit shows 0 new findings, and IndexedStack has no unread keys.