web: Reduce FlowTable Redux subscriptions from O(rows) to O(1) by ariel42 · Pull Request #8104 · mitmproxy/mitmproxy

and others added 3 commits

February 27, 2026 15:35
Lift shared state (displayColumnNames, flowIndex) from per-row/per-cell
useAppSelector calls to the FlowTable parent component. This eliminates
N identical Redux subscriptions across all visible rows.

Changes:
- FlowTable.tsx: Fetch displayColumnNames from state.options.web_columns
  in mapStateToProps; pass as prop to FlowRow along with flowIndex.
- FlowRow.tsx: Accept displayColumnNames and flowIndex as props instead
  of useAppSelector. Remove unused useAppSelector import.
- FlowColumns.tsx: Accept optional flowIndex prop in index column;
  use it instead of per-cell useAppSelector(_listIndex).
- FlowTableHead.tsx: Add null guard on displayColumnNames for
  edge-case during initial state hydration.
- FlowRowSpec.tsx: Update test to pass new required props.
The index column now uses flowIndex prop instead of
useAppSelector. Pass flowIndex={0} in the generic column
render loop so the snapshot matches the expected numeric
output.

@ariel42 ariel42 marked this pull request as ready for review

February 27, 2026 14:30

mhils