feat: p2 batch 28-31 reminders lists comments bang stats
Calendar events support multiple reminder offsets with presets and per-user defaults. Lists index adds inline task entry and list property editing. Generic entity comments on list detail. New bangs.stats dashboard widget. Closes Gitea #28, #29, #30, #31. Migrations 0022 and 0023.
This commit is contained in:
@@ -4,6 +4,7 @@ import { useRouter } from "next/navigation";
|
||||
import { Archive, Plus, Trash2 } from "lucide-react";
|
||||
import { useEffect, useRef, useState, useTransition } from "react";
|
||||
import { DetailBackLink } from "@/components/detail-back-link";
|
||||
import { EntityComments } from "@/components/comments/entity-comments";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { ShareButton } from "@/components/share-button";
|
||||
@@ -18,7 +19,13 @@ import {
|
||||
updateItem,
|
||||
} from "../server/actions";
|
||||
|
||||
export function ListDetail({ initialList }: { initialList: ListDetailDto }) {
|
||||
export function ListDetail({
|
||||
initialList,
|
||||
currentUserId,
|
||||
}: {
|
||||
initialList: ListDetailDto;
|
||||
currentUserId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [list, setList] = useState(initialList);
|
||||
const [draft, setDraft] = useState("");
|
||||
@@ -156,6 +163,7 @@ export function ListDetail({ initialList }: { initialList: ListDetailDto }) {
|
||||
<ListItemRow
|
||||
key={item.id}
|
||||
item={item}
|
||||
currentUserId={currentUserId}
|
||||
onToggle={(done) => setItemDone(item, done)}
|
||||
onEdit={(text) => editItemText(item, text)}
|
||||
onCommit={() => commitItemText(item)}
|
||||
@@ -170,6 +178,7 @@ export function ListDetail({ initialList }: { initialList: ListDetailDto }) {
|
||||
<ListItemRow
|
||||
key={item.id}
|
||||
item={item}
|
||||
currentUserId={currentUserId}
|
||||
onToggle={(done) => setItemDone(item, done)}
|
||||
onEdit={(text) => editItemText(item, text)}
|
||||
onCommit={() => commitItemText(item)}
|
||||
@@ -179,18 +188,22 @@ export function ListDetail({ initialList }: { initialList: ListDetailDto }) {
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<EntityComments entityType="lists.list" entityId={list.id} currentUserId={currentUserId} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ListItemRow({
|
||||
item,
|
||||
currentUserId,
|
||||
onToggle,
|
||||
onEdit,
|
||||
onCommit,
|
||||
onRemove,
|
||||
}: {
|
||||
item: ListItemDto;
|
||||
currentUserId: string;
|
||||
onToggle: (done: boolean) => void;
|
||||
onEdit: (text: string) => void;
|
||||
onCommit: () => void;
|
||||
@@ -333,6 +346,14 @@ function ListItemRow({
|
||||
<Trash2 className="size-3.5" />
|
||||
</Button>
|
||||
</div>
|
||||
<div className="px-[14px] pb-2">
|
||||
<EntityComments
|
||||
entityType="lists.item"
|
||||
entityId={item.id}
|
||||
currentUserId={currentUserId}
|
||||
compact
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user