Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(login): 登录 SSO 入口副标题/帮助行折行修复,placeholder 文案缩短(双端) (#341)

zhanghengxde576b5860f8f
diff --git a/apps/desktop/src/renderer/components/login/LoginControls.tsx b/apps/desktop/src/renderer/components/login/LoginControls.tsx
index 2526fb38e8..d7a2dfc8fb 100644
--- a/apps/desktop/src/renderer/components/login/LoginControls.tsx
+++ b/apps/desktop/src/renderer/components/login/LoginControls.tsx
@@ -61,17 +61,21 @@ export function LoginPanel({ children, testId }: { children: ReactNode; testId?:
}
/**
- * 标题块(figma §5.1:标题 y=31 h=38 32 Bold;副标题 x=41 y=75 w=599 20 Regular)。
+ * 标题块(figma §5.1:标题 y=31 h=38 32 Bold;副标题 @(70,75) 540 宽 ≤2 行顶对齐
+ * 20 Regular——2026-07-24 拍板,原 figma 单行 599@41 作废,见 DESIGN.md §16.2)。
* global 变体:标题文字 span @(185,w236) + Global pill @(425,4)(§4.10,demo titleBlock)。
*/
export function LoginTitleBlock({
title,
subtitle,
globalPill,
+ subtitleMaxLines = SUBTITLE.maxLines,
}: {
title: string;
subtitle?: ReactNode;
globalPill?: string;
+ /** 副标题行数上限(登录屏默认 2;Splash 故障指引等长文案宿主可放宽)。 */
+ subtitleMaxLines?: number;
}) {
return (
<>
@@ -123,18 +127,19 @@ export function LoginTitleBlock({
</div>
{subtitle != null && (
<div
- className="absolute overflow-hidden whitespace-nowrap text-center"
+ // break-words:codeSentTo 邮箱、org slug 等无空格长 token 需要词内断行
+ // 才能用上第二行,否则单行横向溢出被裁。
+ className="absolute overflow-hidden break-words text-center [display:-webkit-box] [-webkit-box-orient:vertical]"
style={{
left: SUBTITLE.x,
top: SUBTITLE.y,
width: SUBTITLE.width,
- height: 23,
- // 同标题:显式行高 = 容器高,避免继承行高溢出后被 overflow-hidden 裁字形
- // (与回调页 .body line-height:23px 同款)。
- lineHeight: '23px',
+ height: SUBTITLE.lineHeight * subtitleMaxLines,
+ // 显式行高:继承行高(body 1.5)大于槽高会被 clamp 裁字形(MT-7)。
+ lineHeight: `${SUBTITLE.lineHeight}px`,
fontSize: SUBTITLE.fontSize,
color: LOGIN_COLORS.secondaryText,
- textOverflow: 'ellipsis',
+ WebkitLineClamp: subtitleMaxLines,
}}
>
{subtitle}
diff --git a/apps/desktop/src/renderer/components/login/LoginPage.tsx b/apps/desktop/src/renderer/components/login/LoginPage.tsx
index a3d909dc24..1011b95e2b 100644
--- a/apps/desktop/src/renderer/components/login/LoginPage.tsx
+++ b/apps/desktop/src/renderer/components/login/LoginPage.tsx
@@ -54,7 +54,7 @@ import {
LOADING_RING,
LOGIN_COLORS,
LOGIN_LOCAL_MODE,
- TEXT_LINK,
+ SSO_ORG_HINT,
} from './loginDesignTokens';
import { canResumePendingConsent, makeConsentStamp, type ConsentStamp } from './consentGate';
@@ -494,15 +494,16 @@ export function LoginPage() {
error={!!errorCode}
testId="login-sso-org-input"
/>
- {/* 帮助行(demo ssoOrgPanel:text-link 位、无下划线、次级色) */}
+ {/* 帮助行(无下划线、次级色;顶对齐 ≤2 行,DESIGN.md §16.2 折行分级 2) */}
<span
- className="absolute flex items-center justify-center"
+ className="absolute line-clamp-2 text-center"
style={{
- left: TEXT_LINK.x,
- top: TEXT_LINK.y,
- width: TEXT_LINK.width,
- height: 36,
- fontSize: TEXT_LINK.fontSize,
+ left: SSO_ORG_HINT.x,
+ top: SSO_ORG_HINT.y,
+ width: SSO_ORG_HINT.width,
+ height: SSO_ORG_HINT.lineHeight * SSO_ORG_HINT.maxLines,
+ lineHeight: `${SSO_ORG_HINT.lineHeight}px`,
+ fontSize: SSO_ORG_HINT.fontSize,
color: LOGIN_COLORS.secondaryText,
}}
>
diff --git a/apps/desktop/src/renderer/components/login/loginDesignTokens.ts b/apps/desktop/src/renderer/components/login/loginDesignTokens.ts
index 86fc68fae2..bffc1afc85 100644
--- a/apps/desktop/src/renderer/components/login/loginDesignTokens.ts
+++ b/apps/desktop/src/renderer/components/login/loginDesignTokens.ts
@@ -53,7 +53,8 @@ export const LOGIN_LOCAL_MODE = {
/** 面板与面板内组件几何(figma §5.1/§4;wave4 面板描边 1px inside 368:1383)。 */
export const PANEL = { width: 680, height: 440, radius: 36 } as const;
export const TITLE = { y: 31, height: 38, fontSize: 32 } as const;
-export const SUBTITLE = { x: 41, y: 75, width: 599, fontSize: 20 } as const;
+/** 副标题:540@70 ≤2 行顶对齐,槽高 = 行高 × 最大行数(DESIGN.md §16.2,2026-07-24 拍板)。 */
+export const SUBTITLE = { x: 70, y: 75, width: 540, fontSize: 20, lineHeight: 23, maxLines: 2 } as const;
export const GLOBAL_PILL = { left: 425, top: 4, width: 70, height: 30, radius: 40 } as const; // §4.10
export const GLOBAL_TITLE_SPAN = { left: 185, width: 236 } as const; // demo titleBlock global 变体
export const CONTROL = {
@@ -84,6 +85,8 @@ export const METHOD_ROW = {
} as const; // §4.9 + demo method-row
export const LOADING_RING = { x: 308, yBrowser: 158, yPreparing: 193, size: 64 } as const; // §5.2
export const TEXT_LINK = { x: 70, y: 238, width: 540, height: 50, fontSize: 20 } as const; // §4.7
+/** sso-org 帮助行:顶对齐 ≤2 行,y=输入框底 238+6,两行至 290 < 主按钮 300(DESIGN.md §16.2 折行分级 2)。 */
+export const SSO_ORG_HINT = { x: 70, y: 244, width: 540, fontSize: 20, lineHeight: 23, maxLines: 2 } as const;
/**
* 协议同意行(figma 600:660「服务条款」行:680×40,radio 24 @x156 + 文字 20 @x186.5)。
diff --git a/apps/desktop/src/renderer/components/splash/SplashScreen.tsx b/apps/desktop/src/renderer/components/splash/SplashScreen.tsx
index d22b603357..f0945b89ec 100644
--- a/apps/desktop/src/renderer/components/splash/SplashScreen.tsx
+++ b/apps/desktop/src/renderer/components/splash/SplashScreen.tsx
@@ -243,6 +243,9 @@ export function SplashScreen() {
{title !== null && (
<LoginTitleBlock
title={title}
+ // 故障说明(spawnFailed 等)比登录副标题长,3 行下界 y=144,
+ // 距 spinner(y=188)/主按钮(y=300)均有余量。
+ subtitleMaxLines={3}
subtitle={
dialogKind === 'manifest'
? t('splash.manifestFailed.description')
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index 478aa226cd..f7193b5604 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -2820,7 +2820,7 @@
},
"ssoOrgTitle": "Enterprise SSO",
"ssoOrgSubtitle": "Enter a company ID, organization slug, or verified domain to continue with single sign-on",
- "ssoOrgPlaceholder": "Company ID, organization slug, or verified domain",
+ "ssoOrgPlaceholder": "Company ID, slug, or domain",
"ssoOrgHint": "Don't know your enterprise sign-in identifier? Ask your admin",
"ssoOrgDetected": "Choose a single sign-on connection for \"{{org}}\"",
"ssoVerificationTitle": "Verify Your Work Identity",
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index 486a55a107..270142fecc 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -2819,7 +2819,7 @@
},
"ssoOrgTitle": "企業 SSO サインイン",
"ssoOrgSubtitle": "企業 ID、組織 slug、または確認済みドメインを入力してシングルサインオンに進みます",
- "ssoOrgPlaceholder": "企業 ID、組織 slug、または確認済みドメイン",
+ "ssoOrgPlaceholder": "企業 ID、slug、またはドメイン",
"ssoOrgHint": "企業のログイン識別子が不明な場合は、管理者にお問い合わせください",
"ssoOrgDetected": "「{{org}}」のシングルサインオン方法を選択してください",
"ssoVerificationTitle": "企業 ID を確認",
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index f390e8bff3..bf3403a067 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -2819,7 +2819,7 @@
},
"ssoOrgTitle": "기업 SSO 로그인",
"ssoOrgSubtitle": "회사 ID, 조직 slug 또는 인증된 도메인을 입력해 통합 로그인(SSO)으로 이동합니다",
- "ssoOrgPlaceholder": "회사 ID, 조직 slug 또는 인증된 도메인",
+ "ssoOrgPlaceholder": "회사 ID, slug 또는 도메인",
"ssoOrgHint": "기업 로그인 식별자를 모르시나요? 관리자에게 문의하세요",
"ssoOrgDetected": "\"{{org}}\"의 통합 로그인 방식을 선택하세요",
"ssoVerificationTitle": "기업 신원 확인",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
index 2f94da556f..da2096d656 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -2819,7 +2819,7 @@
},
"ssoOrgTitle": "企业 SSO 登录",
"ssoOrgSubtitle": "输入企业 ID、组织 slug 或已验证域名,跳转到企业单点登录",
- "ssoOrgPlaceholder": "请输入企业 ID、组织 slug 或已验证域名",
+ "ssoOrgPlaceholder": "请输入企业 ID、slug 或域名",
"ssoOrgHint": "不知道企业登录标识?请联系企业管理员",
"ssoOrgDetected": "选择企业「{{org}}」的单点登录方式",
"ssoVerificationTitle": "验证企业联系方式",
diff --git a/apps/mobile/app/(auth)/login.tsx b/apps/mobile/app/(auth)/login.tsx
index 42913dfafd..9415fe2fd5 100644
--- a/apps/mobile/app/(auth)/login.tsx
+++ b/apps/mobile/app/(auth)/login.tsx
@@ -35,6 +35,7 @@ import {
LOGIN_GROUP,
LOGIN_LOADING_RING,
LOGIN_METHOD_ROW,
+ LOGIN_SSO_ORG_HINT_TOP,
LOGIN_SUBTITLE,
LOGIN_TITLE,
type LoginSurfaceMode,
@@ -364,7 +365,11 @@ export default function LoginScreen() {
testID="login.ssoOrgInput"
value={ssoOrg}
/>
- <LoginTextLinkSlot tone="secondary">
+ <LoginTextLinkSlot
+ align="top"
+ tone="secondary"
+ top={LOGIN_SSO_ORG_HINT_TOP}
+ >
{loginText('ssoOrgHint')}
</LoginTextLinkSlot>
<LoginPrimaryButton
diff --git a/apps/mobile/src/auth/loginMessages.ts b/apps/mobile/src/auth/loginMessages.ts
index c47e7a909c..aa9779f0c0 100644
--- a/apps/mobile/src/auth/loginMessages.ts
+++ b/apps/mobile/src/auth/loginMessages.ts
@@ -38,7 +38,7 @@ const messages = {
consentDisagree: '暂不同意',
ssoOrgTitle: '企业 SSO 登录',
ssoOrgSubtitle: '输入企业 ID、组织 slug 或已验证域名,跳转到企业单点登录。',
- ssoOrgPlaceholder: '企业 ID、组织 slug 或已验证域名',
+ ssoOrgPlaceholder: '企业 ID、slug 或域名',
ssoOrgHint: '不知道企业登录标识?请联系企业管理员。',
ssoOrgDetected: '选择企业「{org}」的单点登录方式',
ssoVerificationTitle: '验证企业联系方式',
@@ -142,7 +142,7 @@ const messages = {
ssoOrgTitle: 'Enterprise SSO',
ssoOrgSubtitle:
'Enter a company ID, organization slug, or verified domain to continue with single sign-on.',
- ssoOrgPlaceholder: 'Company ID, organization slug, or verified domain',
+ ssoOrgPlaceholder: 'Company ID, slug, or domain',
ssoOrgHint:
"Don't know your enterprise sign-in identifier? Ask your admin.",
ssoOrgDetected: 'Choose a single sign-on connection for "{org}"',
@@ -258,9 +258,9 @@ const messages = {
consentDisagree: '同意しない',
ssoOrgTitle: 'エンタープライズ SSO',
ssoOrgSubtitle:
- '会社 ID を入力すると、所属組織のシングルサインオンに進みます。',
- ssoOrgPlaceholder: '会社 ID を入力',
- ssoOrgHint: '会社 ID が不明な場合は管理者にお問い合わせください。',
+ '会社 ID、組織 slug、または確認済みドメインを入力すると、所属組織のシングルサインオンに進みます。',
+ ssoOrgPlaceholder: '会社 ID、slug、またはドメイン',
+ ssoOrgHint: '企業のログイン識別子が不明な場合は、管理者にお問い合わせください。',
ssoOrgDetected: '組織「{org}」のシングルサインオン方法を選択',
ssoVerificationTitle: '企業の連絡先を確認',
ssoVerificationSubtitle: '初回ログイン時、IdP が返した連絡先 {target} の確認が必要です。',
@@ -367,9 +367,9 @@ const messages = {
consentAgree: '동의',
consentDisagree: '동의 안 함',
ssoOrgTitle: '기업 SSO 로그인',
- ssoOrgSubtitle: '회사 ID를 입력하면 소속 조직의 SSO 로그인으로 이동합니다.',
- ssoOrgPlaceholder: '회사 ID 입력',
- ssoOrgHint: '회사 ID를 모르시면 관리자에게 문의하세요.',
+ ssoOrgSubtitle: '회사 ID, 조직 slug 또는 인증된 도메인을 입력하면 소속 조직의 SSO 로그인으로 이동합니다.',
+ ssoOrgPlaceholder: '회사 ID, slug 또는 도메인',
+ ssoOrgHint: '기업 로그인 식별자를 모르시나요? 관리자에게 문의하세요.',
ssoOrgDetected: '"{org}" 조직의 SSO 연결을 선택하세요',
ssoVerificationTitle: '기업 신원 확인',
ssoVerificationSubtitle: '최초 로그인 시 ID 공급자가 반환한 연락처 {target} 확인이 필요합니다.',
diff --git a/apps/mobile/src/auth/loginSkinLayout.ts b/apps/mobile/src/auth/loginSkinLayout.ts
index 448648824d..de9afadb40 100644
--- a/apps/mobile/src/auth/loginSkinLayout.ts
+++ b/apps/mobile/src/auth/loginSkinLayout.ts
@@ -347,8 +347,10 @@ export function resolveLoginSurface(
export const LOGIN_GROUP = { x: 35, width: 680, height: 560 } as const;
/** 标题(figma §5.1:y=31 h=38 32 Bold 居中)。 */
export const LOGIN_TITLE = { y: 31, height: 38, font: 32 } as const;
-/** 副标题(figma §5.1:x=41 y=75 w=599 20 Regular 居中)。 */
-export const LOGIN_SUBTITLE = { x: 41, y: 75, width: 599, height: 23, font: 20 } as const;
+/** 说明/提示类行高(DESIGN.md §16.2:20px 字号 → 23px;副标题与 Text_link 槽共用,与桌面 SUBTITLE / SSO_ORG_HINT.lineHeight 同值)。 */
+export const LOGIN_COPY_LINE_HEIGHT = 23;
+/** 副标题:540@70 ≤2 行顶对齐,height=行高(DESIGN.md §16.2,2026-07-24 拍板;原单行 599@41 作废)。 */
+export const LOGIN_SUBTITLE = { x: 70, y: 75, width: 540, height: LOGIN_COPY_LINE_HEIGHT, font: 20, maxLines: 2 } as const;
/** 输入/主按钮(figma §4.1/§4.3:540×80 r40;文本 x=31 §4.1)。 */
export const LOGIN_CONTROL = {
x: 70,
@@ -391,8 +393,10 @@ export const LOGIN_METHOD_ROW = {
} as const;
/** 大 loading 环(figma §5.2:64×64 @(308,158 browser / 193 preparing))。 */
export const LOGIN_LOADING_RING = { x: 308, yBrowser: 158, yPreparing: 193, size: 64 } as const;
-/** Text_link / 倒计时(figma §4.7:@(70,238) 540×50 20)。 */
-export const LOGIN_TEXT_LINK = { x: 70, y: 238, width: 540, height: 50, font: 20 } as const;
+/** Text_link / 倒计时(figma §4.7:@(70,238) 540×50 20;行高走 LOGIN_COPY_LINE_HEIGHT)。 */
+export const LOGIN_TEXT_LINK = { x: 70, y: 238, width: 540, height: 50, font: 20, lineHeight: LOGIN_COPY_LINE_HEIGHT } as const;
+/** sso-org 帮助行槽顶:输入框底 238+6 呼吸间距,两行至 290 < 主按钮 300(DESIGN.md §16.2 折行分级 2,与桌面 SSO_ORG_HINT 同值)。 */
+export const LOGIN_SSO_ORG_HINT_TOP = 244;
/**
* 协议同意行(consent PR;figma 600:660「服务条款」行,与桌面 CONSENT_ROW 同参数源):
diff --git a/apps/mobile/src/components/LoginSkinControls.tsx b/apps/mobile/src/components/LoginSkinControls.tsx
index 480779be2e..7df6876407 100644
--- a/apps/mobile/src/components/LoginSkinControls.tsx
+++ b/apps/mobile/src/components/LoginSkinControls.tsx
@@ -461,7 +461,8 @@ export function LoginPanel({
);
}
-/** 标题块(figma §5.1:标题 y=31 h=38 32 Bold 居中;副标题 x=41 y=75 w=599 20 Regular 居中)。 */
+/** 标题块(figma §5.1:标题 y=31 h=38 32 Bold 居中;副标题 @(70,75) 540 宽 ≤2 行
+ * 顶对齐 20 Regular——2026-07-24 拍板,原单行 599@41 作废,见 DESIGN.md §16.2)。 */
export function LoginTitleBlock({
title,
subtitle,
@@ -478,7 +479,7 @@ export function LoginTitleBlock({
{title}
</Text>
{subtitle != null ? (
- <Text numberOfLines={1} style={styles.subtitle}>
+ <Text numberOfLines={LOGIN_SUBTITLE.maxLines} style={styles.subtitle}>
{subtitle}
</Text>
) : null}
@@ -1110,14 +1111,24 @@ export function LoginTextLinkSlot({
children,
top,
tone = 'placeholder',
+ align = 'center',
}: {
children: ReactNode;
top?: number;
tone?: 'placeholder' | 'secondary';
+ /** align="top":说明/提示类顶对齐 ≤2 行槽,槽高=行高×2(DESIGN.md §16.2,与桌面 SSO_ORG_HINT 同构);"center":与倒计时/重发同位垂直居中。 */
+ align?: 'center' | 'top';
}) {
const styles = useThemedStyles(makeStyles);
return (
- <View pointerEvents="none" style={[styles.textLinkSlotBox, top != null && { top }]}>
+ <View
+ pointerEvents="none"
+ style={[
+ styles.textLinkSlotBox,
+ top != null && { top },
+ align === 'top' && styles.textLinkSlotBoxTop,
+ ]}
+ >
<Text
numberOfLines={2}
style={[
@@ -1330,6 +1341,8 @@ const makeStyles = (colors: ThemeColors) =>
fontSize: LOGIN_SUBTITLE.font,
fontWeight: fontWeight.regular,
left: LOGIN_SUBTITLE.x,
+ // 显式行高:两行槽高 = 行高 × maxLines,折行只向下伸展(§16.2 折行分级 2)
+ lineHeight: LOGIN_SUBTITLE.height,
// 同查:不设固定 height(设计 h=23 仅几何参考),盒随字形,descender 不受裁切
position: 'absolute',
textAlign: 'center',
@@ -1535,6 +1548,11 @@ const makeStyles = (colors: ThemeColors) =>
top: LOGIN_TEXT_LINK.y,
width: LOGIN_TEXT_LINK.width,
},
+ // 顶对齐变体:说明/提示类 ≤2 行,槽高=行高×2,折行只向下伸展(DESIGN.md §16.2)
+ textLinkSlotBoxTop: {
+ height: LOGIN_TEXT_LINK.lineHeight * 2,
+ justifyContent: 'flex-start',
+ },
resendLinkText: {
color: colors.login.linkText,
fontSize: LOGIN_TEXT_LINK.font,
@@ -1544,6 +1562,8 @@ const makeStyles = (colors: ThemeColors) =>
textLinkSlotText: {
fontSize: LOGIN_TEXT_LINK.font,
fontWeight: fontWeight.regular,
+ // 显式行高:两行(numberOfLines=2)共 46 ≤ 槽高 50,不再依赖平台默认行高
+ lineHeight: LOGIN_TEXT_LINK.lineHeight,
textAlign: 'center',
width: LOGIN_TEXT_LINK.width,
},