What problem does it solve?
Building list, table, or grid UIs in Positron often leads developers to wrap the grid in a React component that mediates props into a DataGridInstance via useEffect, which is an anti-pattern. This Skill teaches the correct architecture where the DataGridInstance subclass itself owns data, layout, selection, and events.
Core Features & Use Cases
- Correct Architecture Guidance: Explains that a DataGridInstance subclass IS the data grid, with <PositronDataGrid /> acting only as a thin renderer.
- Two Data Strategies: Covers the embed strategy (e.g. PositronListInstance with setItems) for small datasets and the fetchData strategy (e.g. TableDataDataGridInstance) for large virtualized datasets backed by comms or files.
- Anti-Pattern Detection: Lists symptoms of the wrong approach, such as piles of useEffects pushing props into the instance or re-creating instances when options change.
- Use Case: When adding a new column picker or data preview panel in Positron, subclass DataGridInstance, create one instance via useState, subscribe to its events, dispose on unmount, and render with <PositronDataGrid instance={instance} />.
Quick Start
Ask the assistant to scaffold a new virtualized grid UI in Positron following the DataGridInstance pattern for your dataset size.