feat(mvp): phase 7 - UI polish & ambient backgrounds
Add layout system (sidebar, header, main layout), dark/light/system theme with HSL customization, 3 ambient backgrounds (mesh gradient, particle field, aurora), Cmd/Ctrl+K search dialog, page transitions, card hover effects, status pulse animations, skeleton loaders, and responsive design. Polish all existing pages with consistent theming.
This commit is contained in:
@@ -1,7 +1,40 @@
|
||||
import type { LayoutServerLoad } from './$types.js';
|
||||
import { prisma } from '$lib/server/prisma.js';
|
||||
|
||||
export const load: LayoutServerLoad = async ({ locals }) => {
|
||||
// Fetch sidebar boards for the layout
|
||||
let boards: Array<{ id: string; name: string; icon: string | null }> = [];
|
||||
|
||||
try {
|
||||
if (locals.user) {
|
||||
// Authenticated user: fetch boards they can access
|
||||
if (locals.user.role === 'admin') {
|
||||
boards = await prisma.board.findMany({
|
||||
select: { id: true, name: true, icon: true },
|
||||
orderBy: [{ isDefault: 'desc' }, { name: 'asc' }]
|
||||
});
|
||||
} else {
|
||||
// Regular users: fetch all boards (permission filtering done at page level)
|
||||
boards = await prisma.board.findMany({
|
||||
select: { id: true, name: true, icon: true },
|
||||
orderBy: [{ isDefault: 'desc' }, { name: 'asc' }]
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Guest: only guest-accessible boards
|
||||
boards = await prisma.board.findMany({
|
||||
where: { isGuestAccessible: true },
|
||||
select: { id: true, name: true, icon: true },
|
||||
orderBy: [{ isDefault: 'desc' }, { name: 'asc' }]
|
||||
});
|
||||
}
|
||||
} catch {
|
||||
// Fail gracefully — sidebar will just be empty
|
||||
boards = [];
|
||||
}
|
||||
|
||||
return {
|
||||
user: locals.user
|
||||
user: locals.user,
|
||||
sidebarBoards: boards
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user