Files
orca/mobile/src/worktree
Jinwoo HongandE2E Test b887483e55 fix(sidebar): the phone reads projects and project groups from main's sidebar feed, installed with the rows (#31102)
* fix(sidebar): the phone reads projects and project groups from main's sidebar feed, installed with the rows

The phone built its project sections from a catalog the desktop window published through a
side channel (mobileRelay.projectSections). That copy changed on a timer after the event that told
the phone to re-read it, and a re-read asked for during a read in flight was dropped, so the phone
could keep an old grouping (a project under the wrong group, a group missing) indefinitely.

Main now publishes the catalog (repos with their group and order, project groups, projects and
host setups, every host's including paired servers') as a projectCatalog domain of the sidebar
feed, from its own store and its own reads of each paired server. The phone reads it from the same
install as the rows. mobileRelay.projectSections stays, answered from the same builder, for pages
that predate the domain; a page on a desktop without the domain still reads it, now re-reading
when an invalidation lands mid-read. The phone e2e list helper runs the page's real refresh
lifecycle instead of re-reading on every assertion, and covers a group move while a read is held.

* test(mobile): stand AppState in for the screen hooks' react-native mocks, and tolerate a world with no project rows in the parity catalog

* fix(sidebar): main files a server's copy of a grouped project under its group, and reads a server's catalog only on catalog events

- The window gives an ungrouped paired-server repo the group of an existing copy of the same project
  (applyInheritedProjectGroups). That function now lives in src/shared and main's catalog builder
  folds each server's repos through it, so the phone files the copy where the desktop does.
- A paired server's change watch now says whether the event can carry a catalog change. Only
  ready, a replay and reposChanged mark the catalog stale; worktreesChanged (pins, unread, sort
  stamps) reads rows only.
- The parity fixture now builds the server side from raw server answers, folded through the
  window's mergeFetchedReposForHost and through main's own server read and builder, with a server
  copy of a grouped project and a partial saved manual order. It fails without the inheritance.

* fix(sidebar): parse a paired server's catalog rows with a schema instead of reading keys reflectively

* fix(mobile): sync the feed ref after render and re-read queued project sections without an await loop

* fix(mobile): spell the AppState shape the refresh reads, so the e2e helper pulls in no React Native types

* test(sidebar): give the merged builder test's feed domains a project catalog

---------

Co-authored-by: E2E Test <e2e@test.local>
2026-10-20 09:34:02 -04:00
..