Skip to content

Three screens pick a default flock from the capped flock list #646

Description

@mforce

Split out of #509, which is closed: #512 (PR #642) made every flock reachable through FlockPicker, gave rows their own flockName/flockStatus from the endpoint's scoped bulk read, and resolves an out-of-window id through the picker's exact GET. What it did not change is three default selections, which still come from the capped listFlocks() the screens keep for other purposes.

Screen Line Default
WaterPage.tsx 211 flocks.find(f => f.status === "Active") ?? flocks.find(f => f.status === "Depleted") — the capture form's default flock
UsersPage.tsx 258 flocks.find(f => f.status === "Active") — the assignment dialog's default
DailyEntryPage.tsx 202 firstActive — the initial selection, when there is no deep link and no remembered flock

GET /flocks still answers with DefaultPageSize = 100 ordered by name, so on a farm with more than 100 flocks all three defaults are drawn from the first alphabetical page.

Why this is P4 and not P2 like its parent

Nothing is unreachable. In every case the user can pick any flock through the picker, and the default is visible before it is committed. The failure is a poor default on a large farm, not a flock that cannot be selected or a row that shows an id fragment — those were #509's actual complaints and they are fixed.

Worth checking before fixing

Whether these three want the same answer. "First active flock by name" is arbitrary even on a small farm; the more useful default is plausibly the most recently used flock (DailyEntryPage already prefers a remembered one over firstActive) or the most recently placed. Deciding that is most of the work here; sourcing it correctly is the rest.

Related: #509 (closed), #512, #642.

Activity

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

    area:frontendReact/Vite web clientepic-1.5severity:p4Defect: tooling, CI noise or test gap; no user impact

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions