Skip to content

App Store rows remount on every re-render because Item is declared inside Store #234

Closed

Description

@nixfred

What happens

Item is a component defined inside the body of Store (web/src/screens/Store.tsx, line 90, const Item = ({app}) => ...). Every time Store renders, Item is a new function, so React sees a different component type and unmounts and remounts every row (and every shelf card) instead of updating it.

Store re-renders when the search text or category changes, when the refresh mutation changes state, and when the installed-apps query (useApps) delivers changed data. That query is polled every 1.5 s while any app is busy (installing, starting, ...) and every 6 s otherwise, and an install reports progress through it.

Consequences:

  • Typing in the search box recreates every row's DOM on each keystroke.
  • While an install is running and its progress changes, all rows are rebuilt. A button that has keyboard focus (Get or Open) loses focus when its row is rebuilt, and a click whose mouse-down and mouse-up straddle a rebuild can be lost because the button under the pointer was replaced.
  • Each row's AppIcon is recreated and loses its failed state, so an icon that failed to load is tried again on every rebuild.

How to reproduce

Found by reading the code; I did not run it in a browser. Steps: start an install of any app, open the App Store, press Tab until a Get or Open button has focus, and watch whether focus leaves it as progress updates arrive.

Suggested fix

Move Item out of Store to module level and pass installed, pick and onOpenInstalled as props.

Environment

Omarchy Server main (0786ba9, 0.9.50), Node 26.

Activity

  1. added a commit that references this issue on Nov 21, 2026
    556b66b
  2. calledtoconstruct commented on Nov 21, 2026

    @calledtoconstruct
    Collaborator

    Thank you @nixfred. App Store rows keep their own state when the list refreshes. The row component is no longer created inside the list render. This is on main in #858.

    🤖 Generated with Grok 4.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions