diff --git a/src/components/WhatsNewModal.tsx b/src/components/WhatsNewModal.tsx index abfe9c8..613b96c 100644 --- a/src/components/WhatsNewModal.tsx +++ b/src/components/WhatsNewModal.tsx @@ -1,93 +1,65 @@ import { ReactNode } from 'react' -import { Aperture, Package, Send, Sparkles, Wand2 } from 'lucide-react' +import { ArrowRight, Database, Heart, Quote, Scale, Send } from 'lucide-react' import './WhatsNewModal.scss' interface WhatsNewModalProps { onClose: () => void version: string - releaseBody?: string - releaseNotes?: string } -type UpdateItem = { +type VisionSection = { + key: 'memory' | 'evidence' | 'ownership' + index: string icon: ReactNode + kicker: string title: string - desc: string + paragraphs: string[] + quote?: string + quoteSource?: string + note?: string } -function inferTitle(text: string): string { - if (/[修复|稳定|兼容|解决]/.test(text)) return '修复' - if (/[优化|提升|改进|性能]/.test(text)) return '优化' - if (/[新增|支持|加入|开放]/.test(text)) return '新增' - return '更新' -} - -function inferIcon(text: string): ReactNode { - if (/[界面|动画|视觉|样式|体验]/.test(text)) return - if (/[新增|支持|加入|开放]/.test(text)) return - if (/[优化|提升|改进|性能]/.test(text)) return - return -} - -function parseAnnouncementText(content?: string): UpdateItem[] { - if (!content?.trim()) return [] - - const lines = content - .split(/\r?\n/) - .map(line => line.trim()) - .filter(line => line && !/^#+\s*/.test(line) && !/^\d+\.\s*$/.test(line)) - .map(line => line.replace(/^[-*•]\s*/, '')) - .filter(Boolean) - .slice(0, 5) - - return lines.map((line) => ({ - icon: inferIcon(line), - title: inferTitle(line), - desc: line - })) -} - -function buildFallbackUpdates(version: string): UpdateItem[] { - return [ - { - icon: , - title: '版本上线', - desc: `已切换到 ${version},界面与功能会自动按当前版本展示最新内容。` - }, - { - icon: , - title: '体验优化', - desc: '我们会持续打磨性能、细节和稳定性,无需再为这条欢迎信息手动改文案。' - }, - { - icon: , - title: '自动适配', - desc: '如果发布说明存在,这里会优先自动展示本次更新要点。' - } - ] -} - -function buildHeadline(version: string, updates: UpdateItem[]) { - if (updates.length > 0) { - return { - title: `密语 ${version} 已就绪`, - subtitle: '以下是这次版本自动整理出的更新重点' - } +const VISION_SECTIONS: VisionSection[] = [ + { + key: 'memory', + index: '01', + icon: , + kicker: '记忆与亲情', + title: '为思念留下可以触摸的温度', + paragraphs: [ + '当亲人离世后,曾经的点点滴滴往往都留在逝者的手机里,手机也成了继续思念的唯一入口。我希望这款软件能把这些记录整理为真正属于家人的数字资产。', + '一段反复叮嘱的文字,一条“儿子(闺女),爸(妈)想你了,啥时候回家呀,回来给你做你爱吃的!”的语音,一次平凡却再也无法重来的问候。' + ], + quote: '死亡不是生命的终点,遗忘才是。', + quoteSource: '《寻梦环游记》', + note: '愿技术能替你留住一点声音、一点温度,也留住一点未曾说完的爱。' + }, + { + key: 'evidence', + index: '02', + icon: , + kicker: '证据与事实', + title: '为不公保留足够有力的证据', + paragraphs: [ + '当您遭遇不公、不平、不正,甚至被聊天中的恶意、羞辱、威胁反复消耗时,您不该只能忍受。我希望这款软件能帮您从海量记录中快速找出关键证据。', + '把零散对话整理成清晰、完整、可追溯的事实链,让每一句伤害都有据可查,让每一次压迫都有证可举。' + ], + note: '人可以善良,但不该没有反击的凭据。' + }, + { + key: 'ownership', + index: '03', + icon: , + kicker: '归档与掌控', + title: '让聊天记录真正回到用户手中', + paragraphs: [ + '我也希望这款软件能帮助更多普通人重新掌握自己的数字人生。聊天记录不该只是被困在某台设备里的碎片,它也可以是记忆的档案、关系的注脚、成长的年轮。', + '无论是回望过去、整理生活、备份重要信息,还是在关键时刻还原事实、保护自己,这些数据都应该真正属于用户,而不是在设备更换、账号异常或时间流逝中悄然消失。' + ] } +] - return { - title: `欢迎使用密语 ${version}`, - subtitle: '当前版本已安装完成,以下内容会根据版本自动展示' - } -} - -function WhatsNewModal({ onClose, version, releaseBody, releaseNotes }: WhatsNewModalProps) { - const notesUpdates = parseAnnouncementText(releaseNotes) - const bodyUpdates = parseAnnouncementText(releaseBody) - const parsedUpdates = notesUpdates.length > 0 ? notesUpdates : bodyUpdates - const items = parsedUpdates.length > 0 ? parsedUpdates : buildFallbackUpdates(version) - const headline = buildHeadline(version, parsedUpdates) - +function WhatsNewModal({ onClose, version }: WhatsNewModalProps) { const handleTelegram = () => { window.electronAPI?.shell?.openExternal?.('https://t.me/+p7YzmRMBm-gzNzJl') } @@ -96,35 +68,75 @@ function WhatsNewModal({ onClose, version, releaseBody, releaseNotes }: WhatsNew
- 新版本 {version} -

{headline.title}

-

{headline.subtitle}

+ 开发者手记 · v{version} +

开发者愿景

+

这不是一个只会读取聊天记录的工具。

+

+ 我希望它能替人留住爱,提取证据,也守住每个人自己的数字人生。 +

-
- {items.map((item, index) => ( -
-
- {item.icon} +
+ + +
+ {VISION_SECTIONS.map((section) => ( +
+
+ {section.index} + +
+ {section.kicker} +

{section.title}

+
-
-

{item.title}

-

{item.desc}

+ +
+ {section.paragraphs.map((paragraph) => ( +

{paragraph}

+ ))} + + {section.quote && ( +
+ +

{section.quote}

+ {section.quoteSource && {section.quoteSource}} +
+ )} + + {section.note &&

{section.note}

}
-
+
))}
- - +
+ CipherTalk +

愿每一段被留住的记录,都能在需要的时候成为温度、力量与归属。

+
+ +
+ + +