Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(mobile): 分享选择模式补标题行并对齐桌面文案 (#3755)
Michaelb97f4513fc6a
diff --git a/apps/mobile/src/i18n/locales/en/session.json b/apps/mobile/src/i18n/locales/en/session.jsonindex 6cc5c97aba..10fbd243c2 100644--- a/apps/mobile/src/i18n/locales/en/session.json+++ b/apps/mobile/src/i18n/locales/en/session.json@@ -249,8 +249,9 @@"forkCancel": "Cancel"},"shareImage": {- "title": "Share conversation",- "selectedCount": "{{count}} selected",+ "title": "Share Conversation",+ "subtitle_one": "{{count}} message selected",+ "subtitle_other": "{{count}} messages selected","selectAll": "Select All","clearAll": "Deselect All","cancel": "Cancel sharing",diff --git a/apps/mobile/src/i18n/locales/ja/session.json b/apps/mobile/src/i18n/locales/ja/session.jsonindex 850a3e6c43..257883d6ef 100644--- a/apps/mobile/src/i18n/locales/ja/session.json+++ b/apps/mobile/src/i18n/locales/ja/session.json@@ -250,7 +250,8 @@},"shareImage": {"title": "会話を共有",- "selectedCount": "{{count}} 件を選択中",+ "subtitle_one": "{{count}} 件のメッセージを選択中",+ "subtitle_other": "{{count}} 件のメッセージを選択中","selectAll": "すべて選択","clearAll": "選択を解除","cancel": "共有をキャンセル",diff --git a/apps/mobile/src/i18n/locales/ko/session.json b/apps/mobile/src/i18n/locales/ko/session.jsonindex d50aa2cfd1..a60aa422d8 100644--- a/apps/mobile/src/i18n/locales/ko/session.json+++ b/apps/mobile/src/i18n/locales/ko/session.json@@ -250,7 +250,8 @@},"shareImage": {"title": "대화 공유",- "selectedCount": "{{count}}개 선택됨",+ "subtitle_one": "메시지 {{count}}개 선택",+ "subtitle_other": "메시지 {{count}}개 선택","selectAll": "전체 선택","clearAll": "선택 해제","cancel": "공유 취소",diff --git a/apps/mobile/src/i18n/locales/zh-CN/session.json b/apps/mobile/src/i18n/locales/zh-CN/session.jsonindex 436cf9b751..f53a82d78e 100644--- a/apps/mobile/src/i18n/locales/zh-CN/session.json+++ b/apps/mobile/src/i18n/locales/zh-CN/session.json@@ -250,7 +250,8 @@},"shareImage": {"title": "分享对话",- "selectedCount": "已选择 {{count}} 条消息",+ "subtitle_one": "已选 {{count}} 条消息",+ "subtitle_other": "已选 {{count}} 条消息","selectAll": "全选","clearAll": "取消全选","cancel": "取消分享",diff --git a/apps/mobile/src/i18n/locales/zh-TW/session.json b/apps/mobile/src/i18n/locales/zh-TW/session.jsonindex a4dbca8b35..2f24ab2e7f 100644--- a/apps/mobile/src/i18n/locales/zh-TW/session.json+++ b/apps/mobile/src/i18n/locales/zh-TW/session.json@@ -250,7 +250,8 @@},"shareImage": {"title": "分享對話",- "selectedCount": "已選擇 {{count}} 條訊息",+ "subtitle_one": "已選 {{count}} 條訊息",+ "subtitle_other": "已選 {{count}} 條訊息","selectAll": "全選","clearAll": "取消全選","cancel": "取消分享",diff --git a/apps/mobile/src/session/ShareSelectionBar.tsx b/apps/mobile/src/session/ShareSelectionBar.tsxindex 6231c6751e..dc0d3a441e 100644--- a/apps/mobile/src/session/ShareSelectionBar.tsx+++ b/apps/mobile/src/session/ShareSelectionBar.tsx@@ -13,7 +13,7 @@ import {typeScale,} from "@/theme/tokens";-/** 分享选择模式底部只保留关闭、已选数量和分享主按钮。 */+/** 分享选择模式底部:关闭、标题 + 已选数量(对齐桌面 title/subtitle)、分享主按钮。 */export function ShareSelectionBar({busy,count,@@ -51,8 +51,11 @@ export function ShareSelectionBar({<Viewstyle={[styles.count, screenshotTriggered && styles.screenshotSafeCount]}>+ <Text ellipsizeMode="tail" numberOfLines={1} style={styles.titleText}>+ {t("session.shareImage.title")}+ </Text><Text ellipsizeMode="tail" numberOfLines={1} style={styles.countText}>- {t("session.shareImage.selectedCount", { count })}+ {t("session.shareImage.subtitle", { count })}</Text></View>);@@ -112,12 +115,18 @@ const makeStyles = (colors: ThemeColors) =>width: 44,},count: { flex: 1, minWidth: 0 },- countText: {+ titleText: {color: colors.textPrimary,fontSize: typeScale.body,fontWeight: fontWeight.medium,lineHeight: lineHeight.body,},+ countText: {+ color: colors.textSecondary,+ fontSize: typeScale.caption,+ lineHeight: lineHeight.caption,+ marginTop: spacing.xs,+ },screenshotSafeCount: {paddingLeft: spacing.xl,},diff --git a/docs/design-previews/share-selection-bar-title/evidence/dark.png b/docs/design-previews/share-selection-bar-title/evidence/dark.pngnew file mode 100644index 0000000000..f0f92c3860Binary files /dev/null and b/docs/design-previews/share-selection-bar-title/evidence/dark.png differdiff --git a/docs/design-previews/share-selection-bar-title/evidence/en-dark.png b/docs/design-previews/share-selection-bar-title/evidence/en-dark.pngnew file mode 100644index 0000000000..e90bd783a4Binary files /dev/null and b/docs/design-previews/share-selection-bar-title/evidence/en-dark.png differdiff --git a/docs/design-previews/share-selection-bar-title/evidence/en-light.png b/docs/design-previews/share-selection-bar-title/evidence/en-light.pngnew file mode 100644index 0000000000..ed3592d3daBinary files /dev/null and b/docs/design-previews/share-selection-bar-title/evidence/en-light.png differdiff --git a/docs/design-previews/share-selection-bar-title/evidence/light.png b/docs/design-previews/share-selection-bar-title/evidence/light.pngnew file mode 100644index 0000000000..e04418a634Binary files /dev/null and b/docs/design-previews/share-selection-bar-title/evidence/light.png differdiff --git a/docs/design-previews/share-selection-bar-title/index.html b/docs/design-previews/share-selection-bar-title/index.htmlnew file mode 100644index 0000000000..b26a6ed5e3--- /dev/null+++ b/docs/design-previews/share-selection-bar-title/index.html@@ -0,0 +1,182 @@+<!doctype html>+<html lang="zh-CN">+<head>+<meta charset="utf-8" />+<meta name="viewport" content="width=device-width, initial-scale=1" />+<title>Cindy Mobile · ShareSelectionBar 复刻预览</title>+<style>+ :root {+ --surface: #EDEDED;+ --surface-elevated: #F8F8F8;+ --surface-translucent: rgba(237, 237, 237, 0.78);+ --border-translucent: rgba(198, 201, 206, 0.62);+ --text-primary: #3C3F43;+ --text-secondary: #8C8E94;+ --cta: #3C3F43;+ --cta-text: #FCFCFC;+ --border: #C6C9CE;+ }+ html[data-mode="dark"] {+ --surface: #2A2828;+ --surface-elevated: #312F2F;+ --surface-translucent: rgba(42, 40, 40, 0.78);+ --border-translucent: rgba(67, 67, 67, 0.62);+ --text-primary: #D4D4D4;+ --text-secondary: #6F6F6F;+ --cta: #EEEEEE;+ --cta-text: #252222;+ --border: #434343;+ }+ * { box-sizing: border-box; }+ html, body { margin: 0; padding: 0; }+ body {+ display: flex;+ align-items: center;+ justify-content: center;+ min-height: 100vh;+ background: var(--surface);+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,+ "Helvetica Neue", Arial, sans-serif;+ -webkit-font-smoothing: antialiased;+ }+ .phone {+ width: 390px;+ height: 320px;+ border-radius: 40px;+ background: var(--surface);+ border: 1px solid var(--border);+ overflow: hidden;+ display: flex;+ flex-direction: column;+ box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);+ }+ .chat {+ flex: 1;+ padding: 18px 14px 8px;+ display: flex;+ flex-direction: column;+ gap: 10px;+ overflow: hidden;+ }+ .bubble {+ max-width: 78%;+ padding: 9px 12px;+ border-radius: 16px;+ font-size: 15px;+ line-height: 21px;+ color: var(--text-primary);+ }+ .bubble.assistant {+ align-self: flex-start;+ background: var(--surface-elevated);+ border: 1px solid var(--border);+ }+ .bubble.user {+ align-self: flex-end;+ background: var(--surface-translucent);+ border: 1px solid var(--border);+ }+ .bar {+ display: flex;+ align-items: center;+ gap: 8px;+ min-height: 64px;+ padding: 8px 12px;+ background: var(--surface-translucent);+ border-top: 1px solid var(--border-translucent);+ }+ .bar .icon-btn {+ display: flex;+ align-items: center;+ justify-content: center;+ height: 44px;+ width: 44px;+ color: var(--text-secondary);+ }+ .bar .info { flex: 1; min-width: 0; }+ .bar .title {+ color: var(--text-primary);+ font-size: 16px;+ font-weight: 500;+ line-height: 22px;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ }+ .bar .subtitle {+ margin-top: 4px;+ color: var(--text-secondary);+ font-size: 12px;+ line-height: 18px;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ }+ .bar .share {+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 8px;+ min-height: 44px;+ min-width: 112px;+ padding: 0 16px;+ border-radius: 9999px;+ background: var(--cta);+ color: var(--cta-text);+ font-size: 16px;+ font-weight: 500;+ }+ svg { display: block; }+</style>+</head>+<body>+ <div class="phone">+ <div class="chat">+ <div class="bubble assistant" data-i18n="b1">可以,我把这段改好了。</div>+ <div class="bubble user" data-i18n="b2">收到,另外麻烦看一下分享图片的标题。</div>+ <div class="bubble assistant" data-i18n="b3">已经加上了标题行,选中的消息会显示数量。</div>+ </div>+ <div class="bar">+ <div class="icon-btn" role="img" aria-label="取消分享">+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>+ </div>+ <div class="info">+ <div class="title" data-i18n="title"></div>+ <div class="subtitle" data-i18n="subtitle"></div>+ </div>+ <div class="share">+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/><polyline points="16 6 12 2 8 6"/><line x1="12" x2="12" y1="2" y2="15"/></svg>+ <span data-i18n="share"></span>+ </div>+ </div>+ </div>+ <script>+ const params = new URLSearchParams(location.search);+ const mode = params.get('mode') === 'dark' ? 'dark' : 'light';+ const locale = params.get('locale') === 'en' ? 'en' : 'zh-CN';+ document.documentElement.dataset.mode = mode;+ document.documentElement.lang = locale;+ const copy = {+ 'zh-CN': {+ title: '分享对话',+ subtitle: '已选 2 条消息',+ share: '分享图片',+ b1: '可以,我把这段改好了。',+ b2: '收到,另外麻烦看一下分享图片的标题。',+ b3: '已经加上了标题行,选中的消息会显示数量。',+ },+ en: {+ title: 'Share Conversation',+ subtitle: '2 messages selected',+ share: 'Share image',+ b1: 'Done, I fixed that part.',+ b2: 'Got it — also, please check the share-image title.',+ b3: 'Added the title row; the count shows how many messages are selected.',+ },+ };+ for (const [key, value] of Object.entries(copy[locale])) {+ document.querySelector('[data-i18n="' + key + '"]').textContent = value;+ }+ </script>+</body>+</html>