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
@@ -79,6 +79,8 @@ const emptySet: EditingSet = {
export function ExperienceMultipliersClient() {
const utils = trpc.useUtils();
const { data: sets, isLoading } = trpc.experienceMultiplier.list.useQuery();
const { data: liveChapters } = trpc.resource.chapters.useQuery(undefined, { staleTime: 60_000 });
const chapterOptions = liveChapters?.length ? liveChapters : CHAPTER_PRESETS;
const createMutation = trpc.experienceMultiplier.create.useMutation({
onSuccess: () => {
@@ -352,7 +354,7 @@ export function ExperienceMultipliersClient() {
</div>
<datalist id="chapter-presets">
{CHAPTER_PRESETS.map((d) => (
{chapterOptions.map((d) => (
<option key={d} value={d} />
))}
</datalist>