Part of
#89946 — OptionRowLHN compound component decomposition
Step
1 of 12 — first step, no dependencies.
What
Create RowContext and OptionRow.Provider in src/components/LHNOptionsList/.
- Define the shared context interface:
{state, actions, meta}
state — derived display values (focused, hovered, viewMode, brickRoadIndicator, etc.)
actions — press handlers
meta — report/optionItem references consumed by leaves
- Export
useRowContext() hook (throws if used outside provider)
- New files:
RowContext.ts, Provider.tsx (exported as OptionRow.Provider from the index)
Why
All leaf subcomponents will read from this context instead of taking individual props, enabling the main OptionRowLHN component to stay under 30 LOC and allowing future provider swaps without touching leaves.
Acceptance criteria
RowContext is typed with {state, actions, meta}; no any
useRowContext() throws a clear error if used outside OptionRow.Provider
- No existing behavior changes (provider not yet wired into
OptionRowLHN)
Issue Owner
Current Issue Owner: @DylanDylann
Part of
#89946 — OptionRowLHN compound component decomposition
Step
1 of 12 — first step, no dependencies.
What
Create
RowContextandOptionRow.Providerinsrc/components/LHNOptionsList/.{state, actions, meta}state— derived display values (focused, hovered, viewMode, brickRoadIndicator, etc.)actions— press handlersmeta— report/optionItem references consumed by leavesuseRowContext()hook (throws if used outside provider)RowContext.ts,Provider.tsx(exported asOptionRow.Providerfrom the index)Why
All leaf subcomponents will read from this context instead of taking individual props, enabling the main
OptionRowLHNcomponent to stay under 30 LOC and allowing future provider swaps without touching leaves.Acceptance criteria
RowContextis typed with{state, actions, meta}; noanyuseRowContext()throws a clear error if used outsideOptionRow.ProviderOptionRowLHN)Issue Owner
Current Issue Owner: @DylanDylann