feat: journal dashboard widgets, agent polish, and edit-mode live previews
Journal dashboard widgets and quick-add; rich-text quick-add dialogs. Dashboard draft sync for live edit previews; assistant bubble + API tools. Journal UX: stress slider, mood grid, query cap fix.
This commit is contained in:
@@ -2,7 +2,8 @@ import { notFound } from "next/navigation";
|
||||
import { Suspense } from "react";
|
||||
import { getCurrentSession } from "@/lib/session";
|
||||
import { parseDashboardLayout, widgetContentKey } from "@/lib/dashboard";
|
||||
import { computeDefaultLayout } from "@/lib/dashboard.server";
|
||||
import { readEditorDraftLayout } from "@/lib/dashboard-editor-draft";
|
||||
import { computeDefaultLayout, normalizeDashboardLayout } from "@/lib/dashboard.server";
|
||||
import { getWidget, getWidgetMetas } from "@/modules/_core";
|
||||
import { getDashboardBySlug } from "@/app/d/actions";
|
||||
import { DashboardEditor } from "@/components/dashboard-editor";
|
||||
@@ -49,7 +50,9 @@ export default async function DashboardPage({
|
||||
const dashboard = await getDashboardBySlug(slug);
|
||||
if (!dashboard) notFound();
|
||||
|
||||
const layout = parseDashboardLayout(dashboard.layout) ?? computeDefaultLayout();
|
||||
const storedLayout = parseDashboardLayout(dashboard.layout) ?? computeDefaultLayout();
|
||||
const draftLayout = isEditing ? await readEditorDraftLayout(dashboard.id) : null;
|
||||
const layout = normalizeDashboardLayout(draftLayout ?? storedLayout);
|
||||
const widgetMetas = getWidgetMetas();
|
||||
|
||||
if (isEditing) {
|
||||
@@ -67,6 +70,7 @@ export default async function DashboardPage({
|
||||
|
||||
return (
|
||||
<DashboardEditor
|
||||
key={`${dashboard.id}:${JSON.stringify(layout.widgets)}`}
|
||||
dashboard={{ id: dashboard.id, name: dashboard.name, slug: dashboard.slug }}
|
||||
layout={layout}
|
||||
widgetMetas={widgetMetas}
|
||||
|
||||
Reference in New Issue
Block a user