From 344d02a7feddefb5c08f88dbe5f3a3f7e7da385f Mon Sep 17 00:00:00 2001 From: Bobby <30593201+luciferreeves@users.noreply.github.com> Date: Fri, 13 Mar 2026 18:25:44 +0530 Subject: feat: add letters feature with detail view and listing - Introduced new routes for letters and their details. - Created pages for displaying letter details and listing letters. - Added new types for letters, including participants, messages, and attachments. - Implemented API calls for fetching letters and managing messages (reply, edit, delete). - Enhanced stats to include unread letters and pending districts for staff users. - Updated styles for letters and their components. - Added privacy settings for letters (public and friends). - Modified user model to include letter privacy settings. - Improved error handling and user feedback in the UI. --- garden/src/components/Layout.tsx | 4 +- garden/src/index.css | 3 +- garden/src/pages/letters/detail.tsx | 348 ++++++++++++++++++++++++++++++++++ garden/src/pages/letters/index.tsx | 105 +++++++++++ garden/src/routes.ts | 2 + garden/src/store/stats.ts | 3 +- garden/src/styles/districts.css | 2 +- garden/src/styles/letters.css | 362 ++++++++++++++++++++++++++++++++++++ garden/src/types/letter.ts | 46 +++++ garden/src/types/stats.ts | 2 + scripts/seed.sh | 14 +- shrine/controllers/stats.go | 5 +- shrine/enums/privacy.go | 8 + shrine/messages/letter.go | 1 + shrine/messages/warning.go | 3 +- shrine/models/user.go | 22 ++- shrine/repositories/letter.go | 11 ++ shrine/repositories/user.go | 4 +- shrine/router/council.go | 1 - shrine/services/letter.go | 3 + shrine/services/stats.go | 14 +- shrine/services/warning.go | 2 + shrine/types/user/user.go | 10 +- 23 files changed, 945 insertions(+), 30 deletions(-) create mode 100644 garden/src/pages/letters/detail.tsx create mode 100644 garden/src/pages/letters/index.tsx create mode 100644 garden/src/styles/letters.css create mode 100644 garden/src/types/letter.ts create mode 100644 shrine/enums/privacy.go diff --git a/garden/src/components/Layout.tsx b/garden/src/components/Layout.tsx index 23d1b7e..061a480 100644 --- a/garden/src/components/Layout.tsx +++ b/garden/src/components/Layout.tsx @@ -83,7 +83,7 @@ export default function Layout(props: LayoutProps) { {((user) => ( <>
Are you sure you want to delete this message?
+Are you sure you want to leave this conversation? You will no longer receive messages.
+A really awesome cool slick ninja dinosaur thingy
' OWNER_SIG='Love and Ciao
' @@ -155,7 +155,7 @@ echo "BEGIN TRANSACTION;" > "$SQL_FILE" OWNER_BIO_ESC=$(escape_sql "$OWNER_BIO") OWNER_SIG_ESC=$(escape_sql "$OWNER_SIG") -printf "INSERT OR IGNORE INTO users (username, email, password_hash, display_name, role, email_verified, jade, honor, pronouns, location, bio, signature, birthday, last_seen_at, ip, created_at, updated_at) VALUES ('master', 'master@pagoda.local', '%s', 'Master', 'owner', 1, 1000, 500, 'sol/solis', 'The Cloud', '%s', '%s', '1904-03-15T00:00:00Z', '%s', '127.0.0.1', '%s', '%s');\n" \ +printf "INSERT OR IGNORE INTO users (username, email, password_hash, display_name, role, email_verified, jade, honor, pronouns, location, bio, signature, birthday, last_seen_at, ip, created_at, updated_at) VALUES ('master', 'master@pagoda.local', '%s', 'Master', 'owner', 1, 1000, 500, 'sol/solis', 'The Cloud', '%s', '%s', '1904-03-15 00:00:00+00:00', '%s', '127.0.0.1', '%s', '%s');\n" \ "$HASH" "$OWNER_BIO_ESC" "$OWNER_SIG_ESC" "$OWNER_SEEN" "$OWNER_DATE" "$OWNER_DATE" >> "$SQL_FILE" echo "Generating $CITIZEN_COUNT citizens..." @@ -187,16 +187,16 @@ for ((i=0; i