refactor(splitter): Improved ARIA semantics and code organization#2145
Open
rkaraivanov wants to merge 1 commit intomasterfrom
Open
refactor(splitter): Improved ARIA semantics and code organization#2145rkaraivanov wants to merge 1 commit intomasterfrom
rkaraivanov wants to merge 1 commit intomasterfrom
Conversation
Replace `[start-collapsed]` / `[end-collapsed]` reflected attributes with CSS custom states via ElementInternals (`addInternalsController`). Collapsed panes are now exposed as `:state(start-collapsed)` / `:state(end-collapsed)`, keeping the public API surface clean. - Extract internal types (`PanePosition`, `SplitterPaneState`, `PaneResizeSnapshot`, `SplitterResizeState`, event maps) into a dedicated `types.ts` module - Embed `StyleInfo` directly in `SplitterPaneState` to eliminate separate `_startPaneInternalStyles` / `_endPaneInternalStyles` / `_barInternalStyles` fields - Replace mutation-by-spread with direct property assignment on pane state objects - Rename `_barRef` → `_separatorRef` for semantic clarity; remove `_updateCursor()` (cursor now set inline via `styleMap` in `_renderSeparator()`) - Unify `_handleExpanderStartAction` / `_handleExpanderEndAction` into `_handleExpanderAction(pane)` and simplify `_resolvePartNames` - Add `_isCollapsed(which)`, `_getPaneState(which)`, and `_isHorizontal` helpers to reduce repetitive conditionals - Extract `_renderSeparator()` and `_renderAccessibleLabel()` render helpers; add an `igc-visually-hidden` label announcing current collapse state to assistive tech; set `aria-labelledby` on the separator element - Pass pre-computed `totalSize` into `_createPaneState`, `_setMinMaxInPx`, `_setPaneMinMaxSizes`, etc. to avoid redundant `getBoundingClientRect` calls - Register `IgcVisuallyHiddenComponent` as a sub-dependency - Extract `KEYBOARD_RESIZE_STEP = 10` constant - Update base SCSS and all spec assertions to use `:state(...)` selectors - Expand Storybook: add `Vertical`, `WithConstraints`, and `ProgrammaticCollapse` stories; improve all control and component descriptions; fix `NestedSplitters` to pass inner splitters directly into named slots
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.
Description
Replace
[start-collapsed]/[end-collapsed]reflected attributes with CSS custom states via ElementInternals (addInternalsController). Collapsed panes are now exposed as:state(start-collapsed)/:state(end-collapsed), keeping the public API surface clean.PanePosition,SplitterPaneState,PaneResizeSnapshot,SplitterResizeState, event maps) into a dedicatedtypes.tsmoduleStyleInfodirectly inSplitterPaneStateto eliminate separate_startPaneInternalStyles/_endPaneInternalStyles/_barInternalStylesfields_barRef→_separatorReffor semantic clarity; remove_updateCursor()(cursor now set inline viastyleMapin_renderSeparator())_handleExpanderStartAction/_handleExpanderEndActioninto_handleExpanderAction(pane)and simplify_resolvePartNames_isCollapsed(which),_getPaneState(which), and_isHorizontalhelpers to reduce repetitive conditionals_renderSeparator()and_renderAccessibleLabel()render helpers; add anigc-visually-hiddenlabel announcing current collapse state to assistive tech; setaria-labelledbyon the separator elementtotalSizeinto_createPaneState,_setMinMaxInPx,_setPaneMinMaxSizes, etc. to avoid redundantgetBoundingClientRectcallsIgcVisuallyHiddenComponentas a sub-dependencyKEYBOARD_RESIZE_STEP = 10constant:state(...)selectorsVertical,WithConstraints, andProgrammaticCollapsestories; improve all control and component descriptions; fixNestedSplittersto pass inner splitters directly into named slotsType of Change
Checklist