Skip to content

feat: add Search and Households to navigation drawer - #2

Merged
spdotdev merged 1 commit into
mainfrom
feat/drawer-search-households
Jun 29, 2026
Merged

spdotdev merged 1 commit into
mainfrom
feat/drawer-search-households

Conversation

@spdotdev

Copy link
Copy Markdown
Owner

Summary

  • Added Search entry to the top drawer section (disabled when no households exist; navigates using the first household's ID)
  • Added Households entry to the top drawer section for quick access to household management without going through Settings

Test plan

  • Open drawer with no households — Search item is greyed out, Households is tappable
  • Open drawer with households — Search navigates to the Search screen for the first household
  • Households link navigates to the Households screen
  • Both items close the drawer before navigating

Search is disabled when the user has no households; uses the first
household's ID when tapped (consistent with how search is scoped).
Households link surfaces household management without going through Settings.
@spdotdev
spdotdev merged commit c9e893c into main Jun 29, 2026
1 of 3 checks passed
@spdotdev
spdotdev deleted the feat/drawer-search-households branch June 29, 2026 16:24
spdotdev added a commit that referenced this pull request Jul 14, 2026
…for the 8 CI-only instrumented races

CI logcat from the actual failing run (fetched via `gh run download`) showed
these 8 tests are NOT reproducible locally (API 34/google_apis/pixel_6/
swiftshader, animations off, even CPU-throttled to 2 cores — CI's own
`cores: 2` — across three separate full/partial local runs, 65/65 clean).
The failure is CI-hardware-speed-dependent, not API-level-dependent.

Two real findings from the CI evidence, not guesswork:

1. REAL APP BUG (LeaveHouseholdFlowTest): HouseholdEditScreen's
   `viewModel: HouseholdsViewModel = hiltViewModel()` default resolves
   against ITS OWN back-stack entry, a different ViewModelStoreOwner than
   HouseholdsScreen's — despite the screen's own doc comment claiming they
   share one instance with "no extra round trip". Navigating list -> edit
   silently constructs a SECOND HouseholdsViewModel; its init{} re-runs the
   same cached-render-then-refreshSilent() sequence as the first, firing an
   untracked GET /households the test's mock queue never anticipated (traced
   directly in the CI logcat: a 3rd /households hit landing on an exhausted
   queue, 2.2s after the list screen's own load). Fixed by scoping
   HouseholdEditScreen's viewModel to the HOUSEHOLDS back-stack entry via
   `hiltViewModel(navController.getBackStackEntry(Routes.HOUSEHOLDS))` —
   same instance, still lazily constructed (an earlier attempt hoisting it
   as a default param on InventoryNavHost itself was reverted: that runs the
   ViewModel's eager init{} fetch at app start, before login, which broke
   HouseholdFlowTest — caught by the local regression suite).

   Sharing one instance also means `HouseholdsUiState.left` (one-shot,
   consumed via HouseholdEditScreen's LaunchedEffect) had to become
   `leftHouseholdId: Long?` instead of a boolean — a boolean would stay
   stuck true after the first leave() this session and auto-navigate the
   user back out of the next household-edit visit for any OTHER household.

2. Four shelf/location tests (DeleteShelfFlowTest, DeleteShelfStrategyFlowTest
   x4, DeleteLocationFlowTest x2) click a row by TEXT right after entering
   edit mode, with only waitForIdle() to gate it. ShelvesViewModel.load() /
   StorageOverviewViewModel.load() take a cached-render + unsynchronized
   refreshSilent() path whenever HierarchyStore's login-triggered walk has
   already warmed the shared repository cache — confirmed via CI logcat to
   be the ALWAYS-taken path here, not a rare race, since the location tile
   these tests click can't even render until that walk has finished.
   waitForIdle() has no visibility into that background network work
   (confirmed: no IdlingResource is registered anywhere in this suite), so a
   click can race a still-in-flight background refresh under CI's slower,
   2-vCPU conditions in ways this dev box's much faster hardware never hit,
   even throttled to the same core count. EditableRow gets a stable
   testTag ("shelf-row-<id>" / "location-row-<id>"), and the 6 affected
   tests now wait for that specific tag before clicking — a deterministic,
   edit-mode-only handle instead of racing generic text against the
   tab/list view transition and any concurrent state update.

No assertion weakened or removed. testDebugUnitTest, ktlintCheck, detekt,
and a full 57/57 connectedDebugAndroidTest run all green locally (API 34
AVD matching CI). Local green does not by itself confirm the CI race is
fixed for #2 (that's the whole reason this was hard to pin down) — a real
CI run against this commit is the actual verification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant