chore(seed): polish demo data with realistic multi-user content

This commit is contained in:
Steven 2026-03-02 21:50:47 +08:00
parent 6b37fcc01b
commit dfab67f035
2 changed files with 38 additions and 24 deletions

View File

@ -1,39 +1,53 @@
-- Demo User
-- Demo User (Admin) — password: demo
INSERT INTO user (id,username,role,nickname,password_hash) VALUES(1,'demo','ADMIN','Demo User','$2a$10$c.slEVgf5b/3BnAWlLb/vOu7VVSOKJ4ljwMe9xzlx9IhKnvAsJYM6');
-- Welcome Memo (Pinned)
INSERT INTO memo (id,uid,creator_id,content,visibility,pinned,payload) VALUES(1,'welcome2memos001',1,replace('# Welcome to Memos!\\n\\nA privacy-first, lightweight note-taking service. Easily capture and share your great thoughts.\\n\\n## Key Features\\n\\n- **Privacy First**: Your data stays with you\\n- **Markdown Support**: Full CommonMark + GFM syntax\\n- **Quick Capture**: Jot down thoughts instantly\\n- **Organize with Tags**: Use #tags to categorize\\n- **Open Source**: Free and open source software\\n\\n---\\n\\nStart exploring the demo memos below to see what you can do! #welcome #getting-started','\\n',char(10)),'PUBLIC',1,'{"tags":["welcome","getting-started"],"property":{"hasLink":false}}');
-- Alice (User) — password: demo
INSERT INTO user (id,username,role,nickname,description,password_hash) VALUES(2,'alice','USER','Alice','Developer & avid reader 📚','$2a$10$c.slEVgf5b/3BnAWlLb/vOu7VVSOKJ4ljwMe9xzlx9IhKnvAsJYM6');
-- Travel Bucket List Demo
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(2,'travelbucket01',1,replace('## 🌍 My Travel Bucket List #travel #bucketlist\\n\\n### Places I''ve Been\\n- [x] Paris, France - Amazing food and art!\\n- [x] Shanghai, China - Modern skyline meets ancient temples\\n- [x] Grand Canyon, USA - Breathtaking views\\n- [x] Barcelona, Spain - Gaudí''s architecture is incredible\\n\\n### Dream Destinations\\n- [ ] Northern Lights in Iceland\\n- [ ] Safari in Tanzania\\n- [ ] Great Barrier Reef, Australia\\n- [ ] Machu Picchu, Peru\\n- [ ] Santorini, Greece\\n- [ ] New Zealand road trip\\n\\n### 2025 Plans\\n- [ ] Book tickets to Iceland for winter\\n- [ ] Research best time to visit Patagonia\\n- [ ] Save up for Australia trip','\\n',char(10)),'PUBLIC','{"tags":["travel","bucketlist"],"property":{"hasTaskList":true,"hasIncompleteTasks":true}}');
-- 1. Welcome Memo (Pinned)
INSERT INTO memo (id,uid,creator_id,content,visibility,pinned,payload) VALUES(1,'welcome2memos001',1,replace('# Welcome to Memos!\n\nA privacy-first, lightweight note-taking service. Capture thoughts, build knowledge, stay organized.\n\n## Key Features\n\n- **Write anything**: Quick notes, long-form writing, technical docs\n- **Markdown**: Full CommonMark + GFM syntax\n- **Task Lists**: Track to-dos inline with `- [ ]` syntax\n- **Tags**: Use #hashtags to organize your memos\n- **Attachments**: Images, videos, documents — drag & drop\n- **Location**: Geotag memos to remember where ideas struck\n- **Reactions & Comments**: Engage with any memo\n- **Relations**: Connect and reference related memos\n\n---\n\nExplore the demo memos below to see what''s possible! #welcome #getting-started','\n',char(10)),'PUBLIC',1,'{"tags":["welcome","getting-started"],"property":{"hasLink":false}}');
-- Recipe Demo
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(3,'cookierecipe01',1,replace('## 🍪 The Perfect Chocolate Chip Cookies #cooking #recipe\\n\\nMy grandma''s secret recipe that never fails!\\n\\n### Ingredients\\n\\n```\\n2¼ cups all-purpose flour\\n1 tsp baking soda\\n1 tsp salt\\n1 cup (2 sticks) butter, softened\\n¾ cup granulated sugar\\n¾ cup packed brown sugar\\n2 large eggs\\n2 tsp vanilla extract\\n2 cups chocolate chips\\n```\\n\\n### Instructions\\n\\n1. Preheat oven to 375°F (190°C)\\n2. Mix flour, baking soda, and salt in a bowl\\n3. Beat butter and sugars until creamy\\n4. Add eggs and vanilla, beat well\\n5. Gradually blend in flour mixture\\n6. Stir in chocolate chips\\n7. Drop rounded tablespoons onto ungreased baking sheets\\n8. Bake 9-11 minutes or until golden brown\\n9. Cool on baking sheet for 2 minutes\\n\\n**Pro tip**: Slightly underbake them for chewier cookies! 😋','\\n',char(10)),'PUBLIC','{"tags":["cooking","recipe"],"property":{"hasCode":true}}');
-- 2. Sponsor Memo (Pinned)
INSERT INTO memo (id,uid,creator_id,content,visibility,pinned,payload) VALUES(2,'sponsor0000001',1,replace('**[Warp](https://go.warp.dev/memos)**: A modern terminal reimagined to work with AI, helping developers build faster and more efficiently.\n\n[![Warp](https://raw.githubusercontent.com/warpdotdev/brand-assets/main/Github/Sponsor/Warp-Github-LG-02.png)](https://go.warp.dev/memos)\n\n#sponsor','\n',char(10)),'PUBLIC',1,'{"tags":["sponsor"],"property":{"hasLink":true}}');
-- Movie Watchlist with Table
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(4,'moviewatch001',1,replace('## 🎬 February Movie Marathon #movies #watchlist\\n\\nCatching up on films I''ve been meaning to watch!\\n\\n### This Month''s Queue\\n\\n| Movie | Genre | Status | Rating |\\n|-------|-------|--------|--------|\\n| The Grand Budapest Hotel | Comedy/Drama | ✅ Watched | ⭐⭐⭐⭐⭐ |\\n| Inception | Sci-Fi | ✅ Watched | ⭐⭐⭐⭐⭐ |\\n| Spirited Away | Animation | ✅ Watched | ⭐⭐⭐⭐⭐ |\\n| Dune: Part Two | Sci-Fi | 📅 This weekend | - |\\n| Barbie | Comedy | 📋 Queued | - |\\n| Oppenheimer | Biography | 📋 Queued | - |\\n\\n### Notes\\n- Grand Budapest Hotel: Wes Anderson''s visual style is *chef''s kiss*\\n- Inception: Need to watch again to catch all the details\\n- Spirited Away: Studio Ghibli never disappoints!\\n\\n---\\n\\n**Next month**: Planning a Miyazaki marathon! 🎨','\\n',char(10)),'PUBLIC','{"tags":["movies","watchlist"],"property":{"hasLink":false}}');
-- 3. AI Skills — boojack/skills workflow, references the example definition doc
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(3,'aiskillsrepo001',1,replace('Been diving into AI agent programming lately — trying to figure out how to make AI actually reliable for complex dev tasks.\n\nThe core problem I keep running into: AI starts writing code before it fully understands the problem, then goes off in the wrong direction. The fix is surprisingly simple — force it through a pipeline: define the issue first, then design, then plan, then execute. Each stage has a concrete artifact, so there''s no room to skip ahead.\n\n**[boojack/skills](https://github.com/boojack/skills)** packages exactly this into four slash commands — `/defining-issues`, `/writing-designs`, `/planning-tasks`, `/executing-tasks` — that work with Claude Code, Cursor, Gemini CLI, and more.\n\n```bash\nnpx skills add boojack/skills\n```\n\n> 📄 Linked below: an example issue definition generated with `/defining-issues`.\n\n#ai #programming','\n',char(10)),'PUBLIC','{"tags":["ai","programming"],"property":{"hasLink":true,"hasCode":true},"location":{"placeholder":"San Francisco, California, United States","latitude":37.7749,"longitude":-122.4194}}');
-- Quick Thought
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(5,'randomthought01',1,'🤔 **Random thought**: If you could have dinner with any three people (living or historical), who would you choose? I''d go with Carl Sagan, Marie Curie, and Robin Williams. #thoughts #questions','PUBLIC','{"tags":["thoughts","questions"],"property":{"hasLink":false}}');
-- 4. Example issue definition doc produced by /defining-issues (referenced by AI Skills memo)
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(4,'markdownshowcs1',1,replace('## 📄 Issue Definition: Add Full-Text Search to Memos #ai #programming\n\n*Generated with `/defining-issues` from [boojack/skills](https://github.com/boojack/skills)*\n\n---\n\n### Background\n\nUsers rely on tag filtering and manual scrolling to find memos. As the memo count grows, discoverability becomes a pain point with no way to search by keyword.\n\n### Issue Statement\n\nThere is no full-text search capability. Users cannot search memo content by keyword, making it hard to resurface older notes or find related ideas.\n\n### Current State\n\n- Tag-based filtering works via `#hashtag` syntax\n- No search index exists in the database\n- The API has no search endpoint\n- Browsing is limited to chronological scroll or tag drill-down\n\n### Proposed Scope\n\n- Add a search input to the main UI\n- Implement SQLite FTS5 full-text indexing on `memo.content`\n- Return ranked results via `GET /api/memos?search=<query>`\n- Highlight matched terms in search results\n\n### Non-Goals\n\n- Semantic / vector search\n- Search across attachments or comments\n- Cross-user search for admins\n\n### Open Questions\n\n1. Should search respect memo visibility (`PUBLIC` / `PRIVATE`)?\n2. Do we index archived memos?\n3. Real-time results as-you-type, or on submit?\n4. Should tags be weighted higher than body text in ranking?','\n',char(10)),'PUBLIC','{"tags":["ai","programming"],"property":{"hasLink":true,"hasCode":true}}');
-- Reading List Demo
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(6,'readinglist001',1,replace('## 📚 2025 Reading Challenge #books #reading\\n\\n**Goal**: Read 24 books this year (2 per month)\\n**Progress**: 3/24 books completed\\n\\n### Currently Reading\\n- [ ] *The Midnight Library* by Matt Haig (45% done)\\n- [ ] *Sapiens* by Yuval Noah Harari (just started)\\n\\n### Finished This Year\\n- [x] *Project Hail Mary* by Andy Weir - ⭐⭐⭐⭐⭐\\n- [x] *Atomic Habits* by James Clear - ⭐⭐⭐⭐\\n- [x] *The House in the Cerulean Sea* by TJ Klune - ⭐⭐⭐⭐⭐\\n\\n### Up Next\\n- [ ] *Tomorrow, and Tomorrow, and Tomorrow*\\n- [ ] *The Martian* (re-read)\\n- [ ] *How to Take Smart Notes*','\\n',char(10)),'PUBLIC','{"tags":["books","reading"],"property":{"hasTaskList":true,"hasIncompleteTasks":true}}');
-- 5. Travel Bucket List (has location: Paris)
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(5,'travelbucket01',1,replace('## 🌍 My Travel Bucket List #travel #bucketlist\n\n### Places I''ve Been\n- [x] Paris, France — Amazing food and art!\n- [x] Shanghai, China — Modern skyline meets ancient temples\n- [x] Grand Canyon, USA — Breathtaking views\n- [x] Barcelona, Spain — Gaudí''s architecture is incredible\n\n### Dream Destinations\n- [ ] Northern Lights in Iceland\n- [ ] Safari in Tanzania\n- [ ] Great Barrier Reef, Australia\n- [ ] Machu Picchu, Peru\n- [ ] Santorini, Greece\n- [ ] New Zealand road trip\n\n### 2025 Plans\n- [ ] Book tickets to Iceland for winter\n- [ ] Research best time to visit Patagonia\n- [ ] Save up for Australia trip','\n',char(10)),'PUBLIC','{"tags":["travel","bucketlist"],"property":{"hasTaskList":true,"hasIncompleteTasks":true},"location":{"placeholder":"Paris, Île-de-France, France","latitude":48.8566,"longitude":2.3522}}');
-- Fun Fact
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(7,'funfact000001',1,'🦦 **Fun fact I learned today**: Otters have a favorite rock that they keep in a pocket of skin under their forearm! They use it to crack open shellfish. Some otters keep the same rock their whole lives. #todayilearned #nature','PUBLIC','{"tags":["todayilearned","nature"],"property":{"hasLink":false}}');
-- 6. Movie Watchlist — posted by Alice
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(6,'moviewatch00001',2,replace('## 🎬 February Movie Marathon #movies #watchlist\n\nCatching up on films I''ve been meaning to watch!\n\n### This Month''s Queue\n\n| Movie | Genre | Status | Rating |\n|-------|-------|--------|--------|\n| The Grand Budapest Hotel | Comedy/Drama | ✅ Watched | ⭐⭐⭐⭐⭐ |\n| Inception | Sci-Fi | ✅ Watched | ⭐⭐⭐⭐⭐ |\n| Spirited Away | Animation | ✅ Watched | ⭐⭐⭐⭐⭐ |\n| Dune: Part Two | Sci-Fi | 📅 This weekend | — |\n| Oppenheimer | Biography | 📋 Queued | — |\n\n### Notes\n- Grand Budapest Hotel: Wes Anderson''s visual style is *chef''s kiss* ✨\n- Inception: Need to watch again to catch all the details\n- Spirited Away: Studio Ghibli never disappoints!\n\n---\n\n**Next month**: Planning a full Miyazaki marathon 🎨','\n',char(10)),'PUBLIC','{"tags":["movies","watchlist"],"property":{"hasLink":false}}');
-- Sponsor Message (Pinned)
INSERT INTO memo (id,uid,creator_id,content,visibility,pinned,payload) VALUES(8,'sponsor0000001',1,replace('**[Warp](https://go.warp.dev/memos)**: A modern terminal reimagined to work with AI, helping developers build faster and more efficiently.\\n\\n[![Warp](https://raw.githubusercontent.com/warpdotdev/brand-assets/main/Github/Sponsor/Warp-Github-LG-02.png)](https://go.warp.dev/memos)\\n\\n#sponsor','\\n',char(10)),'PUBLIC',1,'{"tags":["sponsor"],"property":{"hasLink":true}}');
-- 7. Comment on Welcome (by Alice)
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(7,'welcomecmt00001',2,'Just set up my own instance — this is exactly the note-taking app I''ve been looking for! The interface is so clean 🙌','PUBLIC','{"property":{"hasLink":false}}');
-- 8. Comment on AI Skills (by Alice)
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(8,'aiskillscmt0001',2,'Just tried `/defining-issues` on a backlog item that''s been vague for weeks — the output `definition.md` was clearer than anything I''d written by hand. The "no solution language" constraint really forces you to think. 🤯','PUBLIC','{"property":{"hasLink":false}}');
-- 9. Reply on AI Skills (by Demo)
INSERT INTO memo (id,uid,creator_id,content,visibility,payload) VALUES(9,'aiskillscmt0002',1,'Exactly — and once you have a solid `definition.md`, `/writing-designs` is scary good. It actually cites real engineering references instead of just making things up 🚀','PUBLIC','{"property":{"hasLink":false}}');
-- Memo Relations
INSERT INTO memo_relation VALUES(3,1,'REFERENCE');
INSERT INTO memo_relation VALUES(3,4,'REFERENCE'); -- AI Skills references the example issue definition doc
INSERT INTO memo_relation VALUES(7,1,'COMMENT'); -- Alice comments on Welcome
INSERT INTO memo_relation VALUES(8,3,'COMMENT'); -- Alice comments on AI Skills
INSERT INTO memo_relation VALUES(9,3,'COMMENT'); -- Demo replies on AI Skills
-- Reactions (using memo UIDs, not numeric IDs)
-- Reactions
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(1,1,'memos/welcome2memos001','🎉');
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(2,1,'memos/welcome2memos001','👍');
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(3,1,'memos/funfact000001','🦦');
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(4,1,'memos/sponsor0000001','🚀');
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(5,1,'memos/sponsor0000001','👍');
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(2,2,'memos/welcome2memos001','👍');
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(3,1,'memos/welcome2memos001','👏');
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(4,2,'memos/aiskillsrepo001','🔥');
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(5,1,'memos/aiskillsrepo001','💡');
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(6,2,'memos/aiskillsrepo001','👍');
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(7,1,'memos/sponsor0000001','🚀');
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(8,2,'memos/sponsor0000001','👍');
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(9,2,'memos/markdownshowcs1','💡');
INSERT INTO reaction (id,creator_id,content_id,reaction_type) VALUES(10,2,'memos/travelbucket01','👀');
-- System Settings
INSERT INTO system_setting VALUES ('MEMO_RELATED', '{"contentLengthLimit":8192,"enableAutoCompact":true,"enableComment":true,"enableLocation":true,"defaultVisibility":"PUBLIC","reactions":["👍","💛","🔥","👏","😂","👌","🚀","👀","🤔","🤡","❓","+1","🎉","💡","✅"]}', '');

View File

@ -25,7 +25,7 @@ const LocationDisplay = ({ location, className }: LocationDisplayProps) => {
<PopoverTrigger asChild>
<div
className={cn(
"w-auto max-w-full flex flex-row gap-2 cursor-pointer",
"w-full flex flex-row gap-2 cursor-pointer",
"relative inline-flex items-center gap-1.5 px-2 h-7 rounded-md border border-border bg-muted/20 hover:bg-accent/20 text-muted-foreground hover:text-foreground text-xs transition-colors",
className,
)}