Skip to content

Investigate Editor Mode virtualization with focus/a11y support #85

@GitAddRemote

Description

@GitAddRemote

Summary

Capture findings on Editor Mode virtualization tradeoffs and focus/a11y constraints to revisit later.

Background

We explored virtualizing the compact inventory list to reduce DOM/render work. react-window doesn’t export FixedSizeList in our build, and its unmount/remount cycle complicates our focusController and inline draft/error persistence. Given the ~250-row target and keyboard/a11y requirements, gains seem small vs. added complexity.

Notes/Findings

  • Value: virtualization helps at very large row counts (hundreds–thousands) by shrinking DOM size and scroll work. At ~250 rows, expected gains are modest.
  • Risks: Unmounting offscreen rows drops inline state/errors unless explicitly persisted; focusController registration must handle rows that appear/disappear; sticky header + pinned new-row must sit outside the window.
  • Keyboard/a11y: Need deterministic focus jumps across windows, scroll-to-index helpers for focusController, and possibly aria-rowcount/rowindex handling. Screen-reader announcements may be needed.
  • react-window friction: module exports differ (List only), and integrating would require focus/state plumbing and fixed row heights.

Proposed approach (if we revisit)

  • Build an Editor-aware windowing helper: fixed-height window with spacer, external registry for focus callbacks, and persisted inline draft/error state keyed by row id.
  • Keep header/pinned new-row outside the virtualizer; only window the existing items.
  • Provide scrollToIndex + focus registration so keyboard navigation can span windows.
  • Add tests for focus across windows, state persistence on unmount/remount, and error/draft retention.

Definition of Done (future)

  • Compact mode virtualized without breaking focusController and inline/new-row flows; pinned header/template remain visible.
  • Inline state/errors persist when rows leave/enter the window.
  • Keyboard-only navigation works across window boundaries; focus lands correctly after scroll.
  • A11y is validated (aria metadata, no focusable offscreen elements).

Labels

  • performance
  • tech-story
  • frontend
  • inventory

Metadata

Metadata

Assignees

No one assigned

    Labels

    frontendFrontend app and dashboardinventoryInventory system featuresperformancePerformance and scalingtech-storyTechnical implementation story

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions