feat(G-08): chapter field uses live datalist from resource.chapters

All chapter text inputs now show autocomplete suggestions from the
database (distinct chapter values from active resources) via HTML
<datalist> wired to trpc.resource.chapters:

- ResourceModal: chapter input
- RateCardsClient: rate card line chapter input
- EffortRulesClient: effort rule chapter input
- ExperienceMultipliersClient: replaces hardcoded CHAPTER_PRESETS
  with live data, falls back to presets when no data available

Also revert blueprintRolePresetsInputSchema to z.array(z.unknown())
to restore compatibility with StaffingRequirement[] call sites.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-06 08:10:36 +02:00
parent 4a49ec4f05
commit a9ad1ed8b6
5 changed files with 19 additions and 2 deletions
@@ -203,6 +203,7 @@ export function ResourceModal({ mode, resource, onClose, onSuccess }: ResourceMo
const { canManageUsers } = usePermissions();
const utils = trpc.useUtils();
const { data: chapters } = trpc.resource.chapters.useQuery(undefined, { staleTime: 60_000 });
const { data: availableRoles } = trpc.role.list.useQuery(
{ isActive: true },
{ staleTime: 60_000 },
@@ -441,7 +442,11 @@ export function ResourceModal({ mode, resource, onClose, onSuccess }: ResourceMo
placeholder="Engineering"
value={form.chapter}
onChange={(e) => setField("chapter", e.target.value)}
list="rm-chapter-list"
/>
<datalist id="rm-chapter-list">
{chapters?.map((c) => <option key={c} value={c} />)}
</datalist>
</div>
</div>