Wire ShareButton into list/note/calendar pages; fix nav and calendar select labels

- Add ShareButton to list detail, note editor, and calendar event panel
- Add Settings gear icon to AppNav (core page not in module registry)
- Fix calendar event dialog showing raw UUID: pass explicit children to
  SelectValue so labels display before SelectContent mounts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ginnoir
2026-05-06 14:41:10 -05:00
co-authored by Claude Sonnet 4.6
parent 39aa5704f9
commit 734268cb75
4 changed files with 33 additions and 7 deletions
+8
View File
@@ -1,4 +1,5 @@
import Link from "next/link";
import { Settings } from "lucide-react";
import { getRegistry } from "@/modules/_core/registry";
export function AppNav() {
@@ -19,6 +20,13 @@ export function AppNav() {
{item.label}
</Link>
))}
<Link
href="/settings"
className="ml-auto text-muted-foreground hover:text-foreground transition-colors"
aria-label="Settings"
>
<Settings className="size-4" />
</Link>
</nav>
);
}
@@ -11,6 +11,7 @@ import { useMemo, useState, useTransition } from "react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { ShareButton } from "@/components/share-button";
import {
Select,
SelectContent,
@@ -307,7 +308,9 @@ export function CalendarShell({
}
>
<SelectTrigger aria-label={`${calendar.name} visibility`}>
<SelectValue />
<SelectValue>
{calendar.visibility === "household" ? "Household" : "Private"}
</SelectValue>
</SelectTrigger>
<SelectContent>
<SelectItem value="household">Household</SelectItem>
@@ -353,7 +356,9 @@ export function CalendarShell({
}
>
<SelectTrigger aria-label="Calendar visibility">
<SelectValue />
<SelectValue>
{calendarVisibility === "household" ? "Household" : "Private"}
</SelectValue>
</SelectTrigger>
<SelectContent>
<SelectItem value="household">Household</SelectItem>
@@ -431,7 +436,9 @@ export function CalendarShell({
}
>
<SelectTrigger id="event-calendar">
<SelectValue />
<SelectValue>
{calendarRows.find((c) => c.id === selectedEvent.calendarId)?.name ?? "Select a calendar"}
</SelectValue>
</SelectTrigger>
<SelectContent>
{calendarRows.map((calendar) => (
@@ -483,16 +490,21 @@ export function CalendarShell({
}
/>
<div className="flex items-center justify-between gap-2 pt-2">
<div>
<div className="flex gap-2">
{selectedEvent.id && (
<Button variant="destructive" onClick={removeSelectedEvent}>
Delete event
</Button>
)}
</div>
<Button onClick={saveSelectedEvent} disabled={!selectedEvent.title || isPending}>
Save event
</Button>
<div className="flex gap-2">
{selectedEvent.id && (
<ShareButton entityType="calendar.event" entityId={selectedEvent.id} />
)}
<Button onClick={saveSelectedEvent} disabled={!selectedEvent.title || isPending}>
Save event
</Button>
</div>
</div>
</div>
</div>
@@ -5,6 +5,7 @@ import { Archive, GripVertical, Plus, Trash2 } from "lucide-react";
import { useEffect, useRef, useState, useTransition } from "react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { ShareButton } from "@/components/share-button";
import type { ListDetailDto, ListItemDto } from "../server/queries";
import { getList } from "../server/queries";
import {
@@ -109,6 +110,7 @@ export function ListDetail({ initialList }: { initialList: ListDetailDto }) {
{list.type} / {list.openCount} open / {list.doneCount} done
</div>
</div>
<ShareButton entityType="lists.list" entityId={list.id} canWrite={true} />
<Button variant="outline" onClick={archiveCurrentList} disabled={isPending}>
<Archive />
Archive list
@@ -6,6 +6,7 @@ import { useState, useTransition } from "react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { ShareButton } from "@/components/share-button";
import type { NoteDto } from "../server/queries";
import { createNote, deleteNote, setNotePinned, updateNote } from "../server/actions";
import { MarkdownPreview } from "./markdown-preview";
@@ -76,6 +77,9 @@ export function NoteEditor({ note }: { note?: NoteDto }) {
{pinned ? "Unpin note" : "Pin note"}
</Button>
) : null}
{currentNote ? (
<ShareButton entityType="notes.note" entityId={currentNote.id} />
) : null}
{currentNote ? (
<Button variant="destructive" onClick={removeNote} disabled={isPending}>
<Trash2 />