From 4776f00e519849b8b4b00b462637e090835c2af7 Mon Sep 17 00:00:00 2001 From: Hikari Date: Mon, 13 Apr 2026 20:45:15 -0700 Subject: [PATCH] feat: generate adjective-noun combo names for threads (#19) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the boring timestamp/prompt-truncation thread naming with randomly generated adjective-noun combos (e.g. *Crimson Reverie*, *Neon Phantom*, *Gilded Silence*). 50 adjectives × 50 nouns = 2,500 unique possible thread names, applied consistently across all three modes. ✨ This issue was created with help from Hikari~ 🌸 Reviewed-on: https://git.nhcarrigan.com/nhcarrigan/tatsumi/pulls/19 Co-authored-by: Hikari Co-committed-by: Hikari --- src/app.tsx | 129 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 113 insertions(+), 16 deletions(-) diff --git a/src/app.tsx b/src/app.tsx index d212f08..dacecef 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -25,15 +25,118 @@ import type { Thread, } from "./types/index.ts"; -const generateThreadName = (mode: Mode, text?: string): string => { - if ( - mode === "replace" - || text === undefined - || text.trim().length === 0 - ) { - return `Replace - ${new Date().toLocaleString()}`; - } - return text.trim().slice(0, 40); +const adjectives = [ + "Amber", + "Ancient", + "Arctic", + "Azure", + "Blazing", + "Celestial", + "Cobalt", + "Crimson", + "Crystal", + "Dark", + "Distant", + "Ember", + "Emerald", + "Eternal", + "Ethereal", + "Fleeting", + "Frosted", + "Gilded", + "Golden", + "Hidden", + "Hollow", + "Indigo", + "Ivory", + "Jade", + "Lunar", + "Midnight", + "Mystic", + "Neon", + "Obsidian", + "Onyx", + "Opal", + "Pale", + "Pearl", + "Radiant", + "Rusted", + "Sapphire", + "Scarlet", + "Shattered", + "Silent", + "Silver", + "Spectral", + "Twilight", + "Velvet", + "Verdant", + "Veiled", + "Violet", + "Wandering", + "Wild", + "Woven", + "Arcane", +]; + +const nouns = [ + "Abyss", + "Archive", + "Aria", + "Bloom", + "Cascade", + "Chronicle", + "Cipher", + "Compass", + "Crown", + "Dawn", + "Dream", + "Echo", + "Elegy", + "Ember", + "Equinox", + "Flame", + "Fragment", + "Garden", + "Horizon", + "Labyrinth", + "Lantern", + "Mirage", + "Mist", + "Murmur", + "Nexus", + "Nocturne", + "Oracle", + "Phantom", + "Prism", + "Requiem", + "Reverie", + "Ruin", + "Shadow", + "Shard", + "Silence", + "Solstice", + "Sonata", + "Specter", + "Storm", + "Tempest", + "Throne", + "Tide", + "Veil", + "Vortex", + "Whisper", + "Zenith", + "Sigil", + "Glyph", + "Dusk", + "Omen", +]; + +const generateThreadName = (): string => { + const adjectiveIndex = Math.floor(Math.random() * adjectives.length); + const nounIndex = Math.floor(Math.random() * nouns.length); + const adjective = adjectives[adjectiveIndex] ?? "Arcane"; + const noun = nouns[nounIndex] ?? "Reverie"; + return `${adjective} ${noun}`; }; const generateId = (): string => { @@ -74,13 +177,7 @@ const resolveUpdatedThread = (updatedThread: Thread): Thread => { return updatedThread; } - const firstTextPart = firstMessage.parts.find((part) => { - return part.type === "text"; - }); - const name = generateThreadName( - updatedThread.mode, - firstTextPart?.text, - ); + const name = generateThreadName(); return { ...updatedThread, name }; };