Make the agent's scope a line of its own: Only roles in Europe, chosen countries or Everywhere, read and written as the require gate on country

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 15:31:40 +02:00
1 parent 1c7bc72198
commit 888586c29b
5 files changed
+179 -95

No files matched your search

+10 -4
View File
@@ -128,7 +128,8 @@
};
// The place suggestion's kind, as its hint says it: a `place:` token is a
// town, a `remote:` token the remote roles a person there can take, its
// town, a `remote:` token remote roles (`remote:any` within the viewing
// agent's scope, `remote:country:DK` those a person there can take), its
// count the roles it would find (`places.suggest`).
const PLACE_KINDS = { country: "country", region: "region", place: "town", remote: "remote" };
@@ -1659,11 +1660,16 @@
placeholder: "Company", label: "Company",
});
placeChips = chipInput($("#f-place"), {
suggest: (q) => api(`/api/suggest/places?${new URLSearchParams({ q })}`)
.then((rows) => rows.map((s) => ({
suggest: (q) => {
// The viewing agent, so "Remote" counts the remote roles within its
// scope; the server may ignore it.
const p = new URLSearchParams({ q });
if (state.filter.agent !== null) p.set("agent", String(state.filter.agent));
return api(`/api/suggest/places?${p}`).then((rows) => rows.map((s) => ({
value: s.token, label: s.label,
hint: `${PLACE_KINDS[s.kind] || s.kind} · ${number.format(s.count)}`,
}))),
})));
},
onChange: (items) => {
items.forEach((i) => placeLabels.set(i.value, i.label));
setFilter({ places: items.map((i) => i.value) });