Skip to content

fix(blocks): preserve tooltip triggers and honor resource write support - #60

Merged
yyyyaaa merged 2 commits into
mainfrom
fix/ai-tooltip-trigger-render
Nov 6, 2026
Merged

yyyyaaa merged 2 commits into
mainfrom
fix/ai-tooltip-trigger-render

Conversation

@yyyyaaa

@yyyyaaa yyyyaaa commented Nov 6, 2026

Copy link
Copy Markdown
Contributor
  • Preserve the trigger element when shadcn installs the AI and Schema Builder blocks with base-nova. Use explicit tooltip renders for prompt actions, message actions, source chips, and the Schema Builder’s truncated table names, where the transform would drop asChild on expression children.
  • Show only supported create, edit, and delete actions in Resource Kit lists, details, and related lists. Existing definitions still default to full CRUD.
  • Prefill opted-in date and datetime fields from the reader’s local clock when a create form opens. Explicit form defaults take precedence, and edits use stored values.
Resource Kit Before After
Append-only row actions Row menu with Open, Edit, and Delete Row menu with Open only
Create form dates Empty datetime and date fields Datetime and date fields filled with local values

@tenki-reviewer

tenki-reviewer Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Review complete. No blocking issues — approved ✅; 1 nitpick below.

🧹 Nitpicks (1) — 🟢 1 low
  • 🟢 operations type rejects objects the runtime accepts (types.ts:100) — ResourceDefinition.operations (packages/ui/src/components/resource-kit/types.ts:100) requires all three keys { create: boolean; update: boolean; delete: boolean }, but the runtime gate added in the same PR treats any key that is not exactly false as enabled (operations?.create !== false in packages/ui/src/components/resource-kit/record-dialogs.tsx:47-49).

This PR extends the resource kit with per-verb operations toggles and createDefault value prefill (including a 'now' sentinel) for new-record dialogs, wires readOnly through ResourcePage, RecordDetail, and RelatedList, and updates the resource-kit demo and tests accordingly. Separately, tooltip triggers in the AI chat components and the Schema Builder sidebar migrate from Radix asChild composition to render prop composition, plus a shared helper import in the docs app config.

Files Change
packages/ui/src/components/resource-kit/types.ts, form-values.ts, record-dialogs.tsx Add operations and createDefault to the public types, resolve 'now'/explicit defaults for new records, and gate create/edit/remove callbacks by readOnly and operations.
packages/ui/src/components/resource-kit/resource-page.tsx, record-detail.tsx, related-list.tsx Thread the new gating through the page, detail, and related-list surfaces with guarded callbacks.
packages/ui/test/resource-kit.test.tsx Add flow-level tests for operations gating and 'now' prefill with a mocked clock.
apps/blocks/src/lib/app-kit/resource-kit.ts Update the demo resource definition to exercise the new operations and default-prefill options.
packages/ui/src/components/ai/message.tsx, prompt-input.tsx, source.tsx; packages/schema-builder/.../schema-builder-sidebar.tsx Migrate tooltip triggers from asChild to the render prop for cleaner element composition.

Reviewed commit: 5e49160

@yyyyaaa
yyyyaaa merged commit da1ff83 into main Nov 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant