- Shipped
- August 21, 2026 at 3:34 AM UTC
- Author
- kamo
- Commit
- 2b7d71d
The Assigned Agent control on a lead's assignment pane was a local component in LeadViewClient. Two other places wanted exactly it, so it moves to **************** and takes the picker dialog with it. The assignment pane is unchanged in look and behaviour — it just no longer owns the code. Reserve Opportunity — a member holding EDIT_OPPORTUNITIES, the right that gates managing opportunities on /leads/opportunities/reserved, now gets a Sales agent field naming who the reservation is for. It opens on themselves, so filing their own request costs nothing extra. Unlike the lead's assigned agent it cannot be emptied: a reservation is somebody's claim, and an unowned one is not a state the record can hold. That is the whole of `clearable={false}` — no clear button on the field, and no Remove in the picker. The /leads Agent filter was a Select fed by a fetch of the entire staff directory, which is where its options came from and why it could only ever offer one page of an org that may run to five figures of people. It moves onto the same picker, which searches a page at a time, so the filter can now reach every name — and the whole-directory fetch, its module cache and its ACTIVE filter are gone with it, the same cleanup the assignment pane already did. That filter's useful answers include three that are not people, so MemberPickerDialog grows `quickOptions`: rows pinned above the results, here Myself first, then All Leads, then Unassigned Leads for a member allowed to see those. Myself leads because it is the answer wanted most often and the one a directory search makes hardest to reach — otherwise you type your own name and pick yourself out of the namesakes. The **************** sentinels move into leadGridQuery beside the mapping that reads them. They were string literals in both places, and a drift between the two would not fail to compile: the query would treat the unrecognised sentinel as a member id, filter on a member nobody is, and show an empty grid — which reads as "you have no leads" rather than as a bug. The session carries a member id and an email but no display name, so seeding the reserve form with "you" resolves it once through the directory search. The match is on the member id, never on the email that produced the page: a shared mailbox returns several people, and taking the first would file an opportunity for a colleague who never asked for it. Also drops getAgentFilterMemberId, which had no callers and parseInt'd a 19-digit member id.