Add database-driven Templates admin with chain template support#36
Open
Add database-driven Templates admin with chain template support#36
Conversation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Port templates from static JSON to a database-backed system with full CRUD admin UI at /admin/templates. Templates are seeded from the existing 9 templates.json entries. The /create flow now fetches templates from the API instead of importing the static file. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The OSS and Pro repos share the same Neon database. Pro's migration 033_20251218_add_templates_table already created the table and seeded the 9 templates. No migration needed on the OSS side. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add multi-session chain template management to the admin UI. Chain templates define a sequence of sessions where results from session N inform the context of session N+1 via configurable context injection modes (none, previous_summary, all_summaries, custom). - Add template_type and chain_config fields to schema - Create types.ts with ChainStep, ChainConfig interfaces - Update API routes to handle chain fields - Rewrite page.tsx with card grid, tab filters, and vertical pipeline editor for chain template step management Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/admin/templatesChanges
Database
templatestable already exists from Pro — no migration neededtemplate_type(text, default 'single') andchain_config(jsonb) columns via direct SQLBackend
src/lib/schema.ts— AddedTemplatesTablewithtemplate_typeandchain_configfieldssrc/lib/db.ts— 5 CRUD functions: getTemplates, getTemplateById, createTemplate, updateTemplate, deleteTemplatesrc/app/api/admin/templates/— GET/POST/PUT/DELETE API routes handling chain fieldsFrontend
src/app/admin/templates/types.ts— ChainStep, ChainConfig, Template interfacessrc/app/admin/templates/page.tsx— Full redesign with:src/app/admin/Sidebar.tsx— Templates nav linksrc/app/create/choose-template.tsx— Fetch from API instead of static JSONTest plan
/admin/templates— existing 9 templates show as "Single" type in card gridnpx tsc --noEmitpasses clean🤖 Generated with Claude Code