feat(kol): expand variable schema and polish KOL UI
- Add length/range limits to KOL variable definitions: max_length and default_value for input/textarea, min_value/max_value/default_number for number. Backend validates and normalizes; frontend renders limit inputs in KolVariableConfig and applies limits at runtime in KolDynamicForm. - Sort workspace cards by most recent prompt/package update, falling back to granted_at. Adds updated_at to KolWorkspaceCard. - Polish TemplatesView, WorkspaceView, and KOL package management UI; route create/update/publish/archive/delete toasts through i18n and expand package form copy and status labels. - Remove stale KnowledgeView.vue.patch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -163,6 +163,7 @@ func (q *Queries) GetRecentArticles(ctx context.Context, tenantID int64) ([]GetR
|
||||
|
||||
const listKolCardsForTenant = `-- name: ListKolCardsForTenant :many
|
||||
SELECT sp.id AS subscription_prompt_id, sp.granted_at,
|
||||
GREATEST(p.updated_at, k.updated_at)::timestamptz AS updated_at,
|
||||
p.name AS prompt_name, p.platform_hint,
|
||||
k.name AS package_name, k.cover_url AS package_cover,
|
||||
pf.display_name AS kol_display_name
|
||||
@@ -174,13 +175,14 @@ WHERE sp.tenant_id = $1::bigint
|
||||
AND sp.status = 'active'
|
||||
AND p.status = 'active'
|
||||
AND p.published_revision_no IS NOT NULL
|
||||
ORDER BY sp.granted_at DESC
|
||||
ORDER BY GREATEST(p.updated_at, k.updated_at)::timestamptz DESC, sp.granted_at DESC
|
||||
LIMIT 8
|
||||
`
|
||||
|
||||
type ListKolCardsForTenantRow struct {
|
||||
SubscriptionPromptID int64 `json:"subscription_prompt_id"`
|
||||
GrantedAt pgtype.Timestamptz `json:"granted_at"`
|
||||
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
||||
PromptName string `json:"prompt_name"`
|
||||
PlatformHint pgtype.Text `json:"platform_hint"`
|
||||
PackageName string `json:"package_name"`
|
||||
@@ -200,6 +202,7 @@ func (q *Queries) ListKolCardsForTenant(ctx context.Context, tenantID int64) ([]
|
||||
if err := rows.Scan(
|
||||
&i.SubscriptionPromptID,
|
||||
&i.GrantedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.PromptName,
|
||||
&i.PlatformHint,
|
||||
&i.PackageName,
|
||||
|
||||
Reference in New Issue
Block a user