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:
@@ -28,7 +28,7 @@ export async function PATCH(
|
||||
try {
|
||||
const { id } = await params
|
||||
const body = await request.json()
|
||||
const { name, icon, color, order, trashedAt } = body
|
||||
const { name, icon, color, order, trashedAt, parentId } = body
|
||||
|
||||
const existing = await prisma.notebook.findUnique({
|
||||
where: { id },
|
||||
@@ -49,12 +49,40 @@ export async function PATCH(
|
||||
)
|
||||
}
|
||||
|
||||
if (parentId !== undefined) {
|
||||
if (parentId !== null) {
|
||||
if (parentId === id) {
|
||||
return NextResponse.json(
|
||||
{ success: false, error: 'A notebook cannot be its own parent' },
|
||||
{ status: 400 }
|
||||
)
|
||||
}
|
||||
const target = await prisma.notebook.findFirst({
|
||||
where: { id: parentId, userId: session.user.id }
|
||||
})
|
||||
if (!target) {
|
||||
return NextResponse.json(
|
||||
{ success: false, error: 'Parent notebook not found' },
|
||||
{ status: 404 }
|
||||
)
|
||||
}
|
||||
const descendants = await getDescendantIds(id)
|
||||
if (descendants.includes(parentId)) {
|
||||
return NextResponse.json(
|
||||
{ success: false, error: 'Cannot move a notebook into its own descendant' },
|
||||
{ status: 400 }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const updateData: any = {}
|
||||
if (name !== undefined) updateData.name = name.trim()
|
||||
if (icon !== undefined) updateData.icon = icon
|
||||
if (color !== undefined) updateData.color = color
|
||||
if (order !== undefined) updateData.order = order
|
||||
if (trashedAt !== undefined) updateData.trashedAt = trashedAt
|
||||
if (parentId !== undefined) updateData.parentId = parentId
|
||||
|
||||
if (trashedAt !== undefined) {
|
||||
const descendantIds = await getDescendantIds(id)
|
||||
|
||||
Reference in New Issue
Block a user