Skip to content

feat(list-builder-view-grids): add new state architecture (Phase 1 & 2)#6

Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1768171069-phase1-state-architecture
Open

feat(list-builder-view-grids): add new state architecture (Phase 1 & 2)#6
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1768171069-phase1-state-architecture

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Jan 11, 2026

feat(list-builder-view-grids): add new state architecture (Phase 1 & 2)

Summary

This PR implements Phase 1 and Phase 2 of the state management refactoring for the list-builder-view-grids component. It introduces a new state architecture using BehaviorSubjects to expose individual observables, eliminating timing issues that currently require scan operator workarounds.

Phase 1 - State Foundation:

  • NewGridState - State class with BehaviorSubjects for columns and displayedColumns, exposing both full AsyncList observables and convenience item array observables
  • NewGridStateDispatcher - Dispatcher with direct methods (loadColumns, loadDisplayedColumns, updateColumn, updateDisplayedColumn) replacing the action/orchestrator pattern

Phase 2 - New Components:

  • NewSkyListViewGridComponent (624 lines) - Refactored grid component that removes scan operator workarounds in getGridItems(), getSelectedIds(), and onViewActive() methods
  • NewSkyListColumnSelectorActionComponent (195 lines) - Column selector using combineLatest with individual observables instead of subscribing to entire state object

All classes are exported from the public API and modules are updated to declare/export the new components.

Review & Testing Checklist for Human

  • Critical: Verify the new components behave identically to the original components - the refactoring removes scan operators but should maintain the same functionality. Test with actual data to confirm timing issues are resolved.
  • Verify the AsyncList constructor parameter order matches the class definition: (items, lastUpdate, loading, count) - see new-grid-state-dispatcher.ts lines 34-39, 56-63
  • Review whether adding ~1000 lines of new code to a deprecated module aligns with team strategy (the entire @skyux/list-builder-view-grids module is deprecated)
  • Consider if the spread operator approach in updateColumn/updateDisplayedColumn could cause issues with SkyGridColumnModel objects that have methods or getters
  • No unit tests are included (tests are planned for Phase 3) - consider if basic tests should be added before merging

Test plan:

  1. Run npm run lint:affected to verify lint passes (already done)
  2. Create a test application using NewSkyListViewGridComponent with sample data
  3. Verify column selection, sorting, multiselect, and search functionality work correctly
  4. Test rapid state updates to confirm timing issues are resolved without scan operators
  5. Compare behavior with original SkyListViewGridComponent to ensure parity

Notes

  • This is Phase 1 & 2 of a 5-phase refactoring plan documented in the JIRA tickets
  • Phase 3 will add testing infrastructure
  • The classes are marked @internal but exported for use within the library
  • New components use selectors sky-new-list-view-grid and sky-new-list-column-selector-action

Link to Devin run: https://app.devin.ai/sessions/f149bdc8b43449f095ba57c71390edf5
Requested by: @bcmake

…(Phase 1)

- Add NewGridState class with BehaviorSubject observables for columns and displayedColumns
- Add NewGridStateDispatcher class for direct state updates without action/orchestrator pattern
- Export new classes from public API

This implements the foundation for refactoring from 'state object observable with static properties'
to 'static state object with observable properties' pattern, eliminating timing issues that
required scan operator workarounds.

Co-Authored-By: benc@cognition.ai <Benc@windsurf.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

…hitecture (Phase 2)

- Add NewSkyListViewGridComponent that removes scan operator workarounds
- Add NewSkyListColumnSelectorActionComponent using combineLatest with individual observables
- Update modules to declare and export new components
- Export new components from public API

The new components use direct subscriptions to BehaviorSubject observables from Phase 1,
eliminating timing issues without needing scan operator workarounds.

Co-Authored-By: benc@cognition.ai <Benc@windsurf.com>
@devin-ai-integration devin-ai-integration Bot changed the title feat(list-builder-view-grids): add new state architecture foundation (Phase 1) feat(list-builder-view-grids): add new state architecture (Phase 1 & 2) Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants