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.
Split out of #509, which is closed: #512 (PR #642) made every flock reachable through
FlockPicker, gave rows their ownflockName/flockStatusfrom 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 cappedlistFlocks()the screens keep for other purposes.WaterPage.tsxflocks.find(f => f.status === "Active") ?? flocks.find(f => f.status === "Depleted")— the capture form's default flockUsersPage.tsxflocks.find(f => f.status === "Active")— the assignment dialog's defaultDailyEntryPage.tsxfirstActive— the initial selection, when there is no deep link and no remembered flockGET /flocksstill answers withDefaultPageSize = 100ordered 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.