GM Workbench: collapse the 8 bespoke generator panels into one config-driven GeneratorPanel #234
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
The two-pane Workbench shell shipped in #153 (CampaignPlanning.jsx). Each generative tool still has its own bespoke React panel — DescriptionGenerator, RumorGenerator, RandomTableGenerator, LootParcelGenerator, SessionPrepGenerator, InstantNpcGenerator, NpcVoiceGenerator, SeriesTitleSuggester — each ~150–235 LOC and largely cloned (the code literally says "Cloned from the DescriptionGenerator panel pattern"). They duplicate:
busy/error/result/rowStatusstate, the optional lore-grounding picker, ahandleGeneratecallinggenerateWorkbenchTool(campaignId, tool_id, params), and the section/loading/error chrome.Goal
Collapse those 8 into one config-driven
GeneratorPanelreading a declarative per-tool config (input fields, result renderer, action row) — so adding a Workbench tool becomes adding a config entry, mirroring how the backend already works (oneToolDefingeneration_service.GENERATOR_TOOLS). Pure internal DRY refactor; no user-facing behavior change.Heterogeneity the config must cover
WorkbenchResultActionsalready shared).Keep behavior identical; keep/port the per-panel
*.test.jsx. Consider also renaming the page header "GM Planning" → "GM Workbench" for consistency (separate small change).Context
Deferred from #153 to avoid rewriting tested-but-unvalidated code while Dev had no live LLM. Now unblocked — all tools validated live on Dev (PR #225). Frontend-only. Target v3.10.0.
🤖 Generated with Claude Code
Scope additions (design review, 2026-07-21): folding two adjacent items into this refactor.
Shared lore-grounding picker. The grounding control — today a flat checkbox list of all lore in Rumor/Random Table, a single-select in Description, and an npc-filtered select in NPC Voice — becomes one shared
lore-pickercontrol in the config-driven panel. Redesign (chosen A+D): a searchable chip/token multi-select with results grouped by entry_type, opening pre-seeded with smart-relevant suggestions (entries linked to the target session, in open plot threads, and recently updated). Replaces the flat checkbox list, which doesn't scale to large campaigns. Every grounding tool inherits it for free once it's a config field type.Header fix + rename. Rename the page header "GM Planning" → "GM Workbench", and fix the header overflow: the "Pre-generating name suggestions…" status wraps the header because the flex row doesn't constrain child widths — constrain the left group (
min-w-0+ truncate the campaign name) and make the statusshrink-0 whitespace-nowrap(or relocate it).🤖 Generated with Claude Code
Done — shipped in v3.10.0 (merged via #225). The 8 bespoke Workbench panels are collapsed onto one config-driven
GeneratorPanel(sync / async-poll / instant-draw) reading per-tool configs inworkbenchTools.jsx; the flat lore-checkbox lists are replaced by a shared searchable, type-grouped, chip-basedLorePicker(server-side search, scales to large campaigns). Page renamed "GM Planning" → "GM Workbench", and the header bug fixed (root cause was NavBar rendered outside the<header>, unique to this page). Old panels removed; tests ported toLorePicker/GeneratorPanel/workbenchTools. Validated live on dev againstqwen3.5.