From 54bc6180109ca0e38350a8aca7ab1f71d9e6cca5 Mon Sep 17 00:00:00 2001 From: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> Date: Thu, 7 May 2026 06:45:48 +0000 Subject: [PATCH] chore: more suggestions across the quick actions (#907) --- apps/web/components/dashboard-view.tsx | 66 ++++++- apps/web/hooks/use-personalization.ts | 247 +++++++++++++++++++++---- 2 files changed, 275 insertions(+), 38 deletions(-) diff --git a/apps/web/components/dashboard-view.tsx b/apps/web/components/dashboard-view.tsx index c24099eb..a29faf88 100644 --- a/apps/web/components/dashboard-view.tsx +++ b/apps/web/components/dashboard-view.tsx @@ -123,48 +123,104 @@ const TIPS: Record = { "Connect Claude MCP to query your saved knowledge from any IDE", "Save GitHub repos and READMEs — ask questions across all of them", "Use 'Related' on highlights to find connected technical concepts", + "Save a Stack Overflow answer once — find it again by what it does", + "Drop in your last 3 PRs and ask Supermemory for the review patterns", + "Save your team's RFCs and surface the ones touching your work", + "Save error messages with their fixes — search by symptom next time", + "Save framework docs once — semantic search beats Cmd+F across pages", + "Connect Notion to make your engineering specs instantly findable", + "Save the docs for libraries you keep forgetting and grep them by intent", + "Use Daily Brief to resurface the design doc you skimmed last week", + "Save changelogs as you skim — pull breaking changes back later", + "Save a debugging session as a note — find it again by the symptom", ], research: [ "Save papers and ask questions across your entire reading list", "Use 'Related' on highlights to surface connected research", "Connect Notion to index your notes alongside your papers", "Semantic search means you can ask questions, not just search titles", + "Save a paper once — Supermemory finds it later by what it argued", + "Drop in 5 papers on a topic and ask for the consensus and disagreements", + "Save citations as you read — pull them back out by claim", + "Connect Google Drive to make your dataset notes searchable", + "Use Daily Brief to resurface a finding you almost forgot", + "Save a methodology note once — find it next time you need that protocol", + "Save preprints alongside your reading list — ask what's new since last week", + "Save quotes with their source — find them later by the idea", ], finance: [ "Save articles and ask follow-up questions across your research", "Connect Notion to keep your investment thesis searchable", "Use ⌘K to find specific data points across all your saves", "Daily Brief surfaces connections you may have missed", + "Save earnings call transcripts once — pull guidance back by ticker or theme", + "Save a thesis once — find it months later by the conviction, not the filename", + "Drop in three sell-side reports and ask for the disagreements", + "Save market commentary daily — surface the calls that aged well", + "Connect Google Drive to query your models without opening them", + "Save a chart with a note — find it again by what it showed", + "Save analyst takes — pull them back when the thesis matters again", ], design: [ "Save inspiration and search by concept — 'minimalist UI' finds the right ones", "Use ⌘K to rediscover references by meaning, not filename", "Connect Notion to make your briefs and moodboards searchable", "Chrome extension saves any page in one click while you browse", + "Save a screenshot with a note — find it later by what it taught you", + "Drop in 10 onboarding flows and ask Supermemory for the common patterns", + "Save your design crits — find the feedback on a specific decision later", + "Save a brand guideline once — search it by intent, not page number", + "Connect Google Drive to index your Figma exports and briefs", + "Use Daily Brief to resurface a reference that fits today's work", + "Save references by mood — pull them back when the brief calls for it", ], legal: [ "Save documents and search across them semantically in seconds", "Connect Notion to index your memos and case notes together", "Use Daily Brief to resurface relevant precedents automatically", "Google Drive sync keeps your contracts indexed and queryable", + "Save a clause once — find it next time by what it does, not where it lives", + "Save case law as you read — pull precedents back by argument", + "Drop in three contracts and ask for the diffs in indemnity language", + "Save regulator updates — surface the ones touching your matter", + "Save a memo once — search by issue, not by file name", + "Save deposition notes — find specific testimony by claim later", ], marketing: [ "Save campaigns and resources — ask what worked across all of them", "Chrome extension captures competitor pages in one click", "Use 'Related' to find similar campaigns in your archive", "Connect Notion to make your campaign briefs instantly searchable", + "Save a competitor's landing page — surface their positioning later by claim", + "Drop in five launch retros and ask for the patterns that drove growth", + "Save ad references and find them by mood, not by URL", + "Save your weekly metrics notes — pull trends back by quarter", + "Use Daily Brief to resurface a positioning note from last campaign", + "Save creative briefs — find similar ones when starting a new one", ], medical: [ "Save studies and query across your entire reading list", "Connect Notion to keep clinical notes alongside research", "Use ⌘K to find specific findings across hundreds of papers", "Daily Brief surfaces relevant research from your saves automatically", + "Save a guideline once — pull it back by clinical scenario", + "Drop in three trials and ask Supermemory for the methodological diffs", + "Save case reports — surface them later by symptom or finding", + "Connect Google Drive to index protocols across your team", + "Save teaching points from rounds — find them by topic next month", + "Save differentials as notes — pull them back when the presentation repeats", ], default: [ "Use ⌘K to search by meaning — ask questions, not just keywords", "Daily Brief surfaces insights from your saves each morning", "Chrome extension saves any page in one click while you browse", "Connect integrations to make all your knowledge searchable here", + "Save a page once — find it later by what it said, not its title", + "Save the thing you'd normally bookmark — find it again by intent", + "Drop in 10 articles on a topic and ask for the through-line", + "Save an idea — Supermemory connects it to your earlier ones", + "Use Daily Brief to resurface something useful you forgot you saved", + "Save a thread you liked — pull it back later by what it was about", ], } @@ -633,12 +689,10 @@ export function DashboardView({ const hasMcp = mcpData?.previousLogin ?? false const connectedProviders = new Set(connections.map((c) => c.provider)) - const dayOfYear = Math.round( - (Date.now() - new Date(new Date().getFullYear(), 0, 1).getTime()) / - 86_400_000, - ) - const tips = TIPS[profession] - const tip = tips[dayOfYear % tips.length] + const tip = useMemo(() => { + const tips = TIPS[profession] + return tips[Math.floor(Math.random() * tips.length)] + }, [profession]) return (
= { +type CopyPool = Record + +const COPY_POOLS: Record = { developer: { - saveLink: "Save a repo", - writeNote: "Write dev notes", - chatPlaceholder: "Ask about your code, docs, or notes…", + saveLink: [ + "Save a repo", + "Clip a Stack Overflow answer", + "Save an issue thread", + "Save a docs page", + "Clip an RFC", + "Save a blog post", + "Save a gist", + "Save an API reference", + "Clip a changelog", + ], + writeNote: [ + "Write dev notes", + "Log a debug session", + "Draft an RFC", + "Write a postmortem", + "Note an architecture idea", + "Capture a code review thought", + "Log a learning", + "Write a TIL", + ], + chatPlaceholder: [ + "Ask about your code, docs, or notes…", + "What do you remember about that bug?", + "Search across your saved repos…", + "What did we ship last sprint?", + "Pull up that auth design we discussed…", + ], }, finance: { - saveLink: "Save an article", - writeNote: "Log a thesis", - chatPlaceholder: "Ask about your research or portfolio…", + saveLink: [ + "Save an article", + "Clip an earnings transcript", + "Save a research note", + "Save a market report", + "Clip an analyst piece", + "Save a chart", + "Save a thesis", + ], + writeNote: [ + "Log a thesis", + "Write trade notes", + "Draft an investment memo", + "Capture a market take", + "Log a position rationale", + "Note a portfolio change", + ], + chatPlaceholder: [ + "Ask about your research or portfolio…", + "What was my thesis on that name?", + "Pull up earnings notes for last quarter…", + "Search across your saved research…", + ], }, research: { - saveLink: "Save a paper", - writeNote: "Write notes", - chatPlaceholder: "Ask about your reading or research…", + saveLink: [ + "Save a paper", + "Clip a preprint", + "Save a citation", + "Save a dataset", + "Save a journal article", + "Clip a quote", + "Save a methodology", + ], + writeNote: [ + "Write notes", + "Log a literature note", + "Draft a hypothesis", + "Capture a finding", + "Write a methods note", + "Note a counterargument", + ], + chatPlaceholder: [ + "Ask about your reading or research…", + "What did that paper say about…", + "Pull up sources on this topic…", + "Search across your reading list…", + ], }, design: { - saveLink: "Save inspiration", - writeNote: "Write a brief", - chatPlaceholder: "What are you working on today?", + saveLink: [ + "Save inspiration", + "Clip a reference", + "Save a design system page", + "Save a moodboard", + "Save a portfolio piece", + "Clip a screenshot", + "Save a pattern", + ], + writeNote: [ + "Write a brief", + "Capture a design crit", + "Note a pattern idea", + "Draft critique notes", + "Log a feedback round", + "Write a spec", + ], + chatPlaceholder: [ + "What are you working on today?", + "Pull up references for…", + "Find me that pattern from…", + "Search across your inspiration…", + ], }, legal: { - saveLink: "Save a document", - writeNote: "Write a memo", - chatPlaceholder: "Ask about your cases or contracts…", + saveLink: [ + "Save a document", + "Clip a case", + "Save a statute", + "Save a contract clause", + "Save a memo", + "Clip a regulator update", + ], + writeNote: [ + "Write a memo", + "Log a case note", + "Draft a deposition note", + "Capture a precedent", + "Note a clause issue", + ], + chatPlaceholder: [ + "Ask about your cases or contracts…", + "Pull up that clause we drafted…", + "Find precedents on…", + "Search across your matter notes…", + ], }, marketing: { - saveLink: "Save a resource", - writeNote: "Write campaign notes", - chatPlaceholder: "Ask about your campaigns or research…", + saveLink: [ + "Save a resource", + "Clip a competitor page", + "Save a campaign", + "Save an ad reference", + "Save a content piece", + "Clip a landing page", + ], + writeNote: [ + "Write campaign notes", + "Log a launch retro", + "Draft a creative brief", + "Note a positioning idea", + "Capture a learning", + ], + chatPlaceholder: [ + "Ask about your campaigns or research…", + "What worked in last quarter's launch?", + "Pull up positioning notes…", + "Search across your campaigns…", + ], }, medical: { - saveLink: "Save a study", - writeNote: "Write clinical notes", - chatPlaceholder: "Ask about your research or cases…", + saveLink: [ + "Save a study", + "Clip a guideline", + "Save a journal article", + "Save a case report", + "Clip a treatment protocol", + ], + writeNote: [ + "Write clinical notes", + "Log a case discussion", + "Draft a treatment note", + "Capture a teaching point", + "Note a differential", + ], + chatPlaceholder: [ + "Ask about your research or cases…", + "Pull up the guideline on…", + "Find studies on…", + "Search across your literature…", + ], }, default: { - saveLink: "Save link", - writeNote: "Write note", - chatPlaceholder: "Ask your supermemory…", + saveLink: [ + "Save link", + "Clip a page", + "Save an article", + "Save a video", + "Save a thread", + ], + writeNote: [ + "Write note", + "Capture a thought", + "Log an idea", + "Draft a list", + ], + chatPlaceholder: [ + "Ask your supermemory…", + "What was that thing about…", + "Pull up notes on…", + "Search across your memory…", + ], }, } +function pickFrom(arr: readonly T[]): T { + return arr[Math.floor(Math.random() * arr.length)] as T +} + +function pickCopy(p: Profession): PersonalizedCopy { + const pool = COPY_POOLS[p] + return { + saveLink: pickFrom(pool.saveLink), + writeNote: pickFrom(pool.writeNote), + chatPlaceholder: pickFrom(pool.chatPlaceholder), + } +} + +const sessionCopyCache: Partial> = {} + +function getSessionCopy(p: Profession): PersonalizedCopy { + const cached = sessionCopyCache[p] + if (cached) return cached + const fresh = pickCopy(p) + sessionCopyCache[p] = fresh + return fresh +} + const KEYWORDS: Record, string[]> = { developer: [ "software", @@ -218,7 +397,9 @@ export function usePersonalization(): { profession: Profession setProfession: (p: Profession) => void } { - const [copy, setCopy] = useState(COPY.default) + const [copy, setCopy] = useState(() => + getSessionCopy("default"), + ) const [profession, setProfessionState] = useState("default") const setProfession = useCallback((p: Profession) => { @@ -228,7 +409,9 @@ export function usePersonalization(): { JSON.stringify({ profession: p, ts: Date.now() }), ) } catch {} - setCopy(COPY[p]) + // Re-pick on explicit change so the user sees fresh copy for the new identity + sessionCopyCache[p] = pickCopy(p) + setCopy(sessionCopyCache[p]!) setProfessionState(p) }, []) @@ -240,8 +423,8 @@ export function usePersonalization(): { profession: Profession ts: number } - if (Date.now() - ts < CACHE_TTL_MS && COPY[cached]) { - setCopy(COPY[cached]) + if (Date.now() - ts < CACHE_TTL_MS && COPY_POOLS[cached]) { + setCopy(getSessionCopy(cached)) setProfessionState(cached) return } @@ -256,8 +439,8 @@ export function usePersonalization(): { const { profession: cached } = JSON.parse(raw) as { profession: Profession } - if (COPY[cached]) { - setCopy(COPY[cached]) + if (COPY_POOLS[cached]) { + setCopy(getSessionCopy(cached)) setProfessionState(cached) } } @@ -282,7 +465,7 @@ export function usePersonalization(): { JSON.stringify({ profession: detected, ts: Date.now() }), ) } catch {} - setCopy(COPY[detected]) + setCopy(getSessionCopy(detected)) setProfessionState(detected) }) .catch(() => {})