Private
Public Access
1
0

Phase 7: Search, filters, templates, and archive UI

Add full-text card search (PostgreSQL tsvector + GIN index) with navbar
SearchBar, client-side board filters (label/assignee/due date), board
templates (3 system templates + save-as-template API), and archive
toggle for both board listing and board view.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Catherine Renelle
2026-02-26 00:42:20 -05:00
parent e5f2c64e14
commit 6ed0349507
14 changed files with 727 additions and 27 deletions
+28 -4
View File
@@ -1,12 +1,18 @@
import type { PageServerLoad } from './$types.js';
import { withTenant } from '$lib/server/rls.js';
import { prisma } from '$lib/server/db.js';
export const load: PageServerLoad = async ({ locals }) => {
export const load: PageServerLoad = async ({ locals, url }) => {
const tenant = locals.tenant;
if (!tenant) return { boards: [], categories: [] };
if (!tenant) return { boards: [], categories: [], templates: [] };
const showArchived = url.searchParams.get('archived') === 'true';
const result = await withTenant(tenant.id, async (tx) => {
const where: any = { tenantId: tenant.id, archived: false };
const where: any = { tenantId: tenant.id };
if (!showArchived) {
where.archived = false;
}
if (!locals.user) {
where.visibility = 'PUBLIC';
@@ -40,5 +46,23 @@ export const load: PageServerLoad = async ({ locals }) => {
return { boards, categories };
});
return result;
// Fetch templates (system + tenant) — only if logged in
let templates: any[] = [];
if (locals.user) {
const [systemTemplates, tenantTemplates] = await Promise.all([
prisma.boardTemplate.findMany({
where: { tenantId: null },
orderBy: { name: 'asc' }
}),
withTenant(tenant.id, async (tx) => {
return tx.boardTemplate.findMany({
where: { tenantId: tenant.id },
orderBy: { name: 'asc' }
});
})
]);
templates = [...systemTemplates, ...tenantTemplates];
}
return { ...result, templates };
};