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:
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import dynamic from "next/dynamic";
|
||||
import { useEffect, useMemo, useState, useTransition } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
@@ -20,8 +21,21 @@ import {
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { createEvent } from "@/modules/calendar/server/actions";
|
||||
import { richTextToPlainText } from "@/components/rich-text";
|
||||
import { listCalendars, type CalendarDto } from "@/modules/calendar/server/queries";
|
||||
|
||||
const RichTextEditor = dynamic(
|
||||
() => import("@/components/rich-text/rich-text-editor").then((mod) => mod.RichTextEditor),
|
||||
{
|
||||
ssr: false,
|
||||
loading: () => (
|
||||
<div className="min-h-24 rounded-lg border border-input px-3 py-2 text-sm text-muted-foreground animate-pulse">
|
||||
Loading editor…
|
||||
</div>
|
||||
),
|
||||
},
|
||||
);
|
||||
|
||||
type Props = {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
@@ -30,7 +44,7 @@ type Props = {
|
||||
export function CalendarEventCreateDialog({ open, onOpenChange }: Props) {
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="sm:max-w-md">
|
||||
<DialogContent className="sm:max-w-2xl">
|
||||
{open ? <CalendarEventCreateForm onDone={() => onOpenChange(false)} /> : null}
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
@@ -71,7 +85,7 @@ function CalendarEventCreateForm({ onDone }: { onDone: () => void }) {
|
||||
endAt: new Date(endAt),
|
||||
allDay: false,
|
||||
location: location || null,
|
||||
notes: notes || null,
|
||||
notes: richTextToPlainText(notes) ? notes : null,
|
||||
remindMinutesBefore: remind ? 30 : null,
|
||||
});
|
||||
onDone();
|
||||
@@ -146,13 +160,15 @@ function CalendarEventCreateForm({ onDone }: { onDone: () => void }) {
|
||||
onChange={(e) => setLocation(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-1.5">
|
||||
<div className="space-y-1.5 min-w-0">
|
||||
<Label htmlFor="qa-event-notes">Notes</Label>
|
||||
<textarea
|
||||
<RichTextEditor
|
||||
id="qa-event-notes"
|
||||
className="min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-sm outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50"
|
||||
aria-label="Notes"
|
||||
value={notes}
|
||||
onChange={(e) => setNotes(e.target.value)}
|
||||
onChange={setNotes}
|
||||
disabled={isPending}
|
||||
placeholder="Add details…"
|
||||
/>
|
||||
</div>
|
||||
<label className="flex items-center gap-2 text-sm">
|
||||
|
||||
Reference in New Issue
Block a user