feat: design system overhaul — sidebar, AI chats, settings, brainstorm, color cleanup
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 12s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 12s
- Sidebar: dynamic brand-accent colors, brainstorm section restyled - AI chat general: popup panel with expand/collapse, hides when contextual AI open - AI chat contextual: tabs reordered (Actions first), X close button, height fix - Settings: all tabs restyled, 6 new color presets (sage, terracotta, iron, etc.) - Global color cleanup: emerald/orange hardcoded → brand-accent dynamic - Brainstorm page: orange → brand-accent throughout - PageEntry animation component added to key pages - Floating AI button: bg-brand-accent instead of hardcoded black - i18n: all 15 locales updated with new AI/billing keys - Billing: freemium quota tracking, BYOK, stripe subscription scaffolding - Admin: integrated into new design - AGENTS.md + CLAUDE.md project rules added
This commit is contained in:
@@ -22,6 +22,7 @@ model User {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
cardSizeMode String @default("variable")
|
||||
accentColor String @default("#A47148")
|
||||
accounts Account[]
|
||||
agents Agent[]
|
||||
aiFeedback AiFeedback[]
|
||||
@@ -43,6 +44,9 @@ model User {
|
||||
sessions Session[]
|
||||
aiSettings UserAISettings?
|
||||
workflows Workflow[]
|
||||
subscription Subscription?
|
||||
usageLogs UsageLog[]
|
||||
apiKeys UserAPIKey[]
|
||||
}
|
||||
|
||||
model Account {
|
||||
@@ -256,6 +260,7 @@ model AiFeedback {
|
||||
@@index([noteId])
|
||||
@@index([userId])
|
||||
@@index([feature])
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
model MemoryEchoInsight {
|
||||
@@ -630,3 +635,95 @@ model DocumentChunk {
|
||||
@@index([attachmentId])
|
||||
@@index([attachmentId, chunkIndex])
|
||||
}
|
||||
|
||||
// ===== BYOK (Story 3.5) =====
|
||||
|
||||
model UserAPIKey {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
provider String
|
||||
alias String @default("")
|
||||
encryptedKey String
|
||||
keyHash String
|
||||
model String?
|
||||
isActive Boolean @default(true)
|
||||
lastUsedAt DateTime?
|
||||
lastUsedFor String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([userId, provider])
|
||||
@@index([userId])
|
||||
@@index([keyHash])
|
||||
}
|
||||
|
||||
// ===== SUBSCRIPTION MODELS =====
|
||||
|
||||
enum SubscriptionTier {
|
||||
BASIC
|
||||
PRO
|
||||
BUSINESS
|
||||
ENTERPRISE
|
||||
}
|
||||
|
||||
enum SubscriptionStatus {
|
||||
ACTIVE
|
||||
PAST_DUE
|
||||
CANCELED
|
||||
TRIALING
|
||||
INACTIVE
|
||||
}
|
||||
|
||||
model Subscription {
|
||||
id String @id @default(cuid())
|
||||
userId String @unique
|
||||
tier SubscriptionTier @default(BASIC)
|
||||
status SubscriptionStatus @default(ACTIVE)
|
||||
|
||||
stripeCustomerId String? @unique
|
||||
stripeSubscriptionId String? @unique
|
||||
stripePriceId String?
|
||||
|
||||
trialEndsAt DateTime?
|
||||
currentPeriodStart DateTime
|
||||
currentPeriodEnd DateTime
|
||||
|
||||
canceledAt DateTime?
|
||||
cancelAtPeriodEnd Boolean @default(false)
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model UsageLog {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
feature String
|
||||
periodStart DateTime
|
||||
periodEnd DateTime
|
||||
requestsCount Int @default(0)
|
||||
tokensUsed Int @default(0)
|
||||
|
||||
syncedAt DateTime?
|
||||
metadata String?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([userId, feature, periodStart])
|
||||
@@index([userId, periodStart])
|
||||
@@index([periodStart])
|
||||
}
|
||||
|
||||
model FeatureFlag {
|
||||
id String @id @default(cuid())
|
||||
key String @unique
|
||||
enabled Boolean @default(false)
|
||||
tiers String[]
|
||||
metadata String?
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user