From d15b47e7d877840b80f90363b31165d6a4b20e82 Mon Sep 17 00:00:00 2001 From: Samuel Lison Date: Thu, 30 Jul 2026 18:12:28 +1000 Subject: [PATCH] fix(builder): point first-time creators at Content when a picker is empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found in real use: with no gatherables authored yet, the Build form's Resource field has no ⌄ picker (there's nothing to cycle) and nothing explains where entries come from — so the very first no-code run dead-ends at the moment the flow should feel best. A field that references authored content now shows "No Gatherables yet — create one →" when that category is empty, which jumps straight to the right Content page. Not a mutation, so it isn't wrapped in a ChangeHistory recording. Co-Authored-By: Claude Opus 4.8 --- plugin/BuildAdminUi.luau | 21 +++++++++++++++++++++ plugin/init.server.luau | 7 +++++++ 2 files changed, 28 insertions(+) diff --git a/plugin/BuildAdminUi.luau b/plugin/BuildAdminUi.luau index d602e04..6aebc05 100644 --- a/plugin/BuildAdminUi.luau +++ b/plugin/BuildAdminUi.luau @@ -220,6 +220,27 @@ function BuildAdminUi.mount(container: Frame, BuildAdmin: any, ContentAdmin: any }) row.LayoutOrder = i row.Parent = panel + + -- First-run dead end: a field that points at authored content is useless until some + -- exists, and the picker simply isn't there to hint at it. Say where to go, and + -- offer to take them. + if spec.ref and (not choices or #choices == 0) then + local cat = ContentAdmin.CATEGORIES and ContentAdmin.CATEGORIES[spec.ref] + local catTitle = (cat and cat.title) or spec.ref + local jump = Theme.button({ + Size = UDim2.new(1, 0, 0, 22), + Text = `No {catTitle} yet — create one →`, + TextColor3 = Theme.COLOR.ACCENT, + TextSize = 11, + LayoutOrder = i, + }) + jump.Parent = panel + jump.MouseButton1Click:Connect(function() + if actions.selectPage then + actions.selectPage("content/" .. spec.ref) + end + end) + end end end diff --git a/plugin/init.server.luau b/plugin/init.server.luau index bd2ed18..bc212dc 100644 --- a/plugin/init.server.luau +++ b/plugin/init.server.luau @@ -138,6 +138,13 @@ local buildActions = { return BuildAdmin.resetField(instance, spec) end) end, + -- Not a mutation (no recording): jump to a Content page so a field that references authored + -- content can send a first-time creator somewhere useful instead of dead-ending. + selectPage = function(id: string) + if nav then + nav.selectPage(id) + end + end, } -- ── Content callbacks (authored + overrides), bundled for the pages ──────────