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。

feat(desktop): 注销状态横幅改浮层气泡(figma 678:1075)

PraiseZhu31e472ed9f1a
diff --git a/apps/desktop/src/renderer/components/login/LoginPage.tsx b/apps/desktop/src/renderer/components/login/LoginPage.tsx
index 2527f346c7..e724fd20c1 100644
--- a/apps/desktop/src/renderer/components/login/LoginPage.tsx
+++ b/apps/desktop/src/renderer/components/login/LoginPage.tsx
@@ -961,21 +961,32 @@ export function LoginPage() {
footer={localModeFooter}
bottomReserve={panelBottomReserve}
>
- {accountDeletionStatus && (
- <AccountDeletionStatusPanel
- status={accountDeletionStatus}
- onDismiss={
- accountDeletionStatus.status === 'completed'
- ? () => {
- void clearAccountDeletionReceipt?.().catch(() => undefined);
- setAccountDeletionStatus(null);
- }
- : undefined
- }
- />
- )}
{node}
</LoginStage>
+ {/* 注销状态提示气泡(figma 678:1075「注销状态」组件集):浮层——不占文档流、
+ 不推挤下方内容,z-30 盖过 stage 全部内容(低于拖拽条 z-40 与协议弹窗 z-50);
+ 窗口顶 72px 恒定、水平窗口居中、宽 670 恒定,均不随 loginScale 缩放。
+ 显隐与面板入场同节奏(只淡入,不参与位移)。 */}
+ {accountDeletionStatus && (
+ <AccountDeletionStatusPanel
+ status={accountDeletionStatus}
+ onDismiss={
+ accountDeletionStatus.status === 'completed'
+ ? () => {
+ void clearAccountDeletionReceipt?.().catch(() => undefined);
+ setAccountDeletionStatus(null);
+ }
+ : undefined
+ }
+ style={{
+ opacity: panelHidden ? 0 : 1,
+ pointerEvents: panelHidden ? 'none' : undefined,
+ transition: handoff.isPlaying
+ ? `opacity ${LOGIN_HANDOFF_TIMINGS.panelMs}ms ${LOGIN_HANDOFF_TIMINGS.panelEasing}`
+ : undefined,
+ }}
+ />
+ )}
{/* 顶部 46px 拖拽条 overlay(附录 C §1.4 条4:独立层不占文档流;返回钮在
面板区 y≫46px 不被遮挡;Win 控件 no-drag)。窗框双描边 chrome overlay 已于
2026-07-22 随 PR #104 对齐(纯平白底 + 无窗框描边)移除 */}
@@ -1035,12 +1046,28 @@ function SocialProviderIcon({ provider }: { provider: SocialProvider }) {
);
}
+/**
+ * 注销状态提示气泡(figma 678:1075「注销状态」组件集,2026-07-25 用户拍板规格):
+ * 浮层组件——absolute 定位、不占布局流、盖在登录页一切元素(立绘/字标/面板/社交行)之上。
+ * 宽 670 恒定(窗口过窄 clamp `min(670px, 100vw-48px)`)、顶 72 恒定、水平居中,
+ * 均不随 loginScale 缩放;圆角 22、四边 padding 20、1px 描边,无图标/阴影/动画。
+ * 排版全居中:标题=正文同 20px/23px/Regular 400,仅以颜色区分
+ * (标题 login-control-text / 正文 login-secondary-text);标题↔正文 5px、
+ * 正文↔「我知道了」22px、「我知道了」↔气泡底 20px(=下 padding,文案拉长不变)。
+ * 「我知道了」= 下划线文字链(login-link-text 既有形态),视觉不变但点击热区
+ * 经 ±11px padding/负 margin 扩到 ≥44×44。状态:pending/processing 无按钮、
+ * completed 带「我知道了」;颜色全走 token(气泡底 login-deletion-bubble-bg,
+ * 描边 chat-input-border)。
+ */
function AccountDeletionStatusPanel({
status,
onDismiss,
+ style,
}: {
status: AccountDeletionStatus;
onDismiss?: () => void;
+ /** 浮层显隐(handoff 合流:与面板入场同节奏,只淡入不透明、不参与位移)。 */
+ style?: CSSProperties;
}) {
const { t } = useTranslation();
const titleKey =
@@ -1059,10 +1086,11 @@ function AccountDeletionStatusPanel({
return (
<section
aria-label={t(titleKey)}
- className="mb-5 w-full rounded-xl border border-[var(--border-default)] bg-[var(--surface-chip)] px-4 py-3"
+ className="absolute left-1/2 top-[72px] z-30 w-[min(670px,calc(100vw-48px))] -translate-x-1/2 break-words rounded-[22px] border border-[var(--chat-input-border)] bg-[var(--login-deletion-bubble-bg)] p-5 text-center"
+ style={style}
>
- <h2 className="text-14 font-medium text-[var(--text-primary)]">{t(titleKey)}</h2>
- <p className="mt-1 text-12 leading-5 text-[var(--text-secondary)]">
+ <h2 className="text-[20px] font-normal leading-[23px] text-[var(--login-control-text)]">{t(titleKey)}</h2>
+ <p className="mt-[5px] text-[20px] font-normal leading-[23px] text-[var(--login-secondary-text)]">
{t(copyKey, {
date: formatAccountDeletionDate(status.deleteAfter),
})}
@@ -1072,8 +1100,10 @@ function AccountDeletionStatusPanel({
type="button"
onClick={onDismiss}
className={cn(
- 'mt-2 rounded-full px-2 py-1 text-12 text-[var(--text-secondary)]',
- 'transition-colors hover:bg-[var(--surface-hover)] hover:text-[var(--text-primary)]',
+ // 热区扩容:py 11px(11+23+11=45≥44)+ -mb 抵消,视觉间距保持 上22/下20 不变
+ 'mt-[11px] -mb-[11px] border-0 bg-transparent px-3 py-[11px]',
+ 'text-[20px] font-normal leading-[23px] text-[var(--login-control-text)] underline',
+ 'hover:enabled:[color:var(--login-link-hover)] active:enabled:[color:var(--login-link-pressed)]',
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-soft)]',
)}
>
diff --git a/apps/desktop/src/renderer/components/login/__tests__/LoginPage.accountDeletionStatus.test.tsx b/apps/desktop/src/renderer/components/login/__tests__/LoginPage.accountDeletionStatus.test.tsx
index ebfa3bc766..62c7ec74cb 100644
--- a/apps/desktop/src/renderer/components/login/__tests__/LoginPage.accountDeletionStatus.test.tsx
+++ b/apps/desktop/src/renderer/components/login/__tests__/LoginPage.accountDeletionStatus.test.tsx
@@ -73,6 +73,40 @@ describe('LoginPage account deletion status', () => {
expect(loginHook.value.getAccountDeletionStatus).toHaveBeenCalledOnce();
});
+ it('renders the status as an overlay bubble outside LoginStage (float, not in layout flow)', async () => {
+ render(<LoginPage />);
+
+ const bubble = await screen.findByRole('region', {
+ name: 'accountDeletion.status.pendingTitle',
+ });
+ // 浮层定位类(figma 678:1075:窗口顶 72、z-30 盖过 stage、水平居中、宽 670 clamp)
+ expect(bubble.className).toContain('absolute');
+ expect(bubble.className).toContain('top-[72px]');
+ expect(bubble.className).toContain('z-30');
+ expect(bubble.className).toContain('left-1/2');
+ expect(bubble.className).toContain('w-[min(670px,calc(100vw-48px))]');
+ // 不再渲染进 LoginStage 文档流(修复前被 absolute 面板 100% 覆盖的 bug 根因)
+ const stage = screen.getByTestId('login-stage');
+ expect(stage.contains(bubble)).toBe(false);
+ // pending 态无「我知道了」按钮
+ expect(screen.queryByRole('button', { name: 'accountDeletion.status.dismissButton' })).toBeNull();
+ });
+
+ it('shows the processing state without a dismiss button', async () => {
+ loginHook.value.getAccountDeletionStatus.mockResolvedValue({
+ success: true,
+ value: {
+ status: 'processing',
+ requestedAt: '2026-07-22T00:00:00.000Z',
+ deleteAfter: '2026-08-21T00:00:00.000Z',
+ },
+ });
+ render(<LoginPage />);
+
+ expect(await screen.findByText('accountDeletion.status.processingTitle')).toBeTruthy();
+ expect(screen.queryByRole('button', { name: 'accountDeletion.status.dismissButton' })).toBeNull();
+ });
+
it('lets the user dismiss a terminal completed receipt', async () => {
loginHook.value.getAccountDeletionStatus.mockResolvedValue({
success: true,
@@ -85,11 +119,17 @@ describe('LoginPage account deletion status', () => {
});
render(<LoginPage />);
- fireEvent.click(
- await screen.findByRole('button', {
- name: 'accountDeletion.status.dismissButton',
- }),
- );
+ const bubble = await screen.findByRole('region', {
+ name: 'accountDeletion.status.completedTitle',
+ });
+ // completed 态才有「我知道了」下划线文字链
+ const dismiss = screen.getByRole('button', {
+ name: 'accountDeletion.status.dismissButton',
+ });
+ expect(bubble.contains(dismiss)).toBe(true);
+ expect(dismiss.className).toContain('underline');
+
+ fireEvent.click(dismiss);
await waitFor(() => expect(loginHook.value.clearAccountDeletionReceipt).toHaveBeenCalledOnce());
expect(screen.queryByText('accountDeletion.status.completedTitle')).toBeNull();
});
diff --git a/apps/desktop/src/renderer/themes/colors.ts b/apps/desktop/src/renderer/themes/colors.ts
index 5a2583e35f..044736df79 100644
--- a/apps/desktop/src/renderer/themes/colors.ts
+++ b/apps/desktop/src/renderer/themes/colors.ts
@@ -615,6 +615,14 @@ registerColor('login-error-fg', {
light: '#D91F37',
dark: '#D91F37',
}, 'Login — 错误文本/error 描边(语义豁免,跨模式不变 #D91F37)');
+// 注销提示气泡底(figma 678:1075「注销状态」组件集;用户拍板 2026-07-25):值是 var 引用——
+// light 消费 --chat-input-bg(agent 输入框底,实值 #FFFFFF)、dark 消费 --surface(main 最深
+// 深色背景,实值 #1F1F1E,用户点名"找最深的");非默认扩展主题自动跟随这两个语义槽,
+// 无需逐主题 override(规则 16:alias 形态,同 panel-bg 先例)。
+registerColor('login-deletion-bubble-bg', {
+ light: 'var(--chat-input-bg)',
+ dark: 'var(--surface)',
+}, 'Login — 注销提示气泡底(figma 678:1075;light alias --chat-input-bg #FFFFFF / dark alias --surface #1F1F1E,var 引用随扩展主题自动跟随)');
// Splash 统一面板进度条(亮色 track #D9D9D9/fill #252222;暗色推导 track #434343/fill #D4D4D4,待 Figma 精确)。
registerColor('login-splash-progress-track', {
light: '#D9D9D9',