From f575fb30c0234ca53e5c714bda9fbc01ae16372e Mon Sep 17 00:00:00 2001 From: EricMoin Date: Tue, 17 Nov 2026 15:47:23 +0800 Subject: [PATCH] fix(web): reorder remote connection panel Help users identify the destination before choosing a sign-in method. --- .../remote-connection/both-active.expected.md | 14 ++++---- .../remote-connection/cancelled.expected.md | 10 +++--- .../expired-mobile-dark.expected.md | 10 +++--- .../remote-connection/expired.expected.md | 10 +++--- .../remote-connection/extensions.expected.md | 10 +++--- .../remote-connection/http-active.expected.md | 10 +++--- .../http-link-copied.expected.md | 16 +++++----- .../remote-connection/http-ready.expected.md | 10 +++--- .../remote-connection/link-copied.expected.md | 12 +++---- .../remote-connection/link-failed.expected.md | 12 +++---- .../link-mobile-dark.expected.md | 12 +++---- .../link-mobile-light.expected.md | 12 +++---- .../remote-connection/link-ready.expected.md | 10 +++--- .../remote-connection/mobile-dark.expected.md | 10 +++--- .../mobile-light.expected.md | 10 +++--- .../regenerating.expected.md | 10 +++--- .../remote-connection/used.expected.md | 10 +++--- apps/web/tests/remote-connection.e2e.ts | 23 +++++++++---- .../client/remote-connection/README.i18n.yaml | 4 +-- packages/client/remote-connection/README.md | 2 +- .../client/remote-connection/README.zh.md | 2 +- .../src/client/RemoteConnectionSection.tsx | 14 ++++---- .../remote-connection/src/client/locales.ts | 32 +++++++++---------- .../tests/apply.client.spec.ts | 2 +- .../tests/section.client.spec.tsx | 22 ++++++++++--- 25 files changed, 156 insertions(+), 133 deletions(-) diff --git a/apps/web/tests/expected/remote-connection/both-active.expected.md b/apps/web/tests/expected/remote-connection/both-active.expected.md index cc5e59c033..1b0e28b92e 100644 --- a/apps/web/tests/expected/remote-connection/both-active.expected.md +++ b/apps/web/tests/expected/remote-connection/both-active.expected.md @@ -1,5 +1,12 @@ - region "远程连接": - heading "远程连接" [level=2] + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] + - code: {{access-address}}?token={{login-token}} + - button "已复制" + - paragraph: 请勿公开分享登录链接 + - paragraph: 持有此链接的人都可以直接登录,请仅发送给自己的设备,勿公开分享;重启服务后链接失效 - region "二维码登录": - heading "二维码登录" [level=3] - button "重新生成" @@ -10,10 +17,3 @@ - timer: {{seconds}} 秒后过期 - paragraph: 请勿分享登录二维码 - paragraph: 二维码使用或过期前,持有它的人都可以登录,请勿传播 - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 - - code: {{access-address}}?token={{login-token}} - - button "已复制" - - paragraph: 请勿公开分享登录链接 - - paragraph: 持有此链接的人都可以直接登录,请仅发送给自己的设备,勿公开分享;重启服务后链接失效 diff --git a/apps/web/tests/expected/remote-connection/cancelled.expected.md b/apps/web/tests/expected/remote-connection/cancelled.expected.md index e1156b74fb..8dba150d87 100644 --- a/apps/web/tests/expected/remote-connection/cancelled.expected.md +++ b/apps/web/tests/expected/remote-connection/cancelled.expected.md @@ -1,10 +1,10 @@ - region "远程连接": - heading "远程连接" [level=2] + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] + - code: {{access-address}}?token={{login-token}} + - button "复制链接" - region "二维码登录": - heading "二维码登录" [level=3] - button "重新生成" - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 - - code: {{access-address}}?token={{login-token}} - - button "复制链接" diff --git a/apps/web/tests/expected/remote-connection/expired-mobile-dark.expected.md b/apps/web/tests/expected/remote-connection/expired-mobile-dark.expected.md index 7e17b078e2..657d085e60 100644 --- a/apps/web/tests/expected/remote-connection/expired-mobile-dark.expected.md +++ b/apps/web/tests/expected/remote-connection/expired-mobile-dark.expected.md @@ -1,12 +1,12 @@ - region "远程连接": - heading "远程连接" [level=2] + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] + - code: {{access-address}}?token={{login-token}} + - button "复制链接" - region "二维码登录": - heading "二维码登录" [level=3] - button "重新生成" - status: - paragraph: 二维码已过期,请生成新二维码登录 - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 - - code: {{access-address}}?token={{login-token}} - - button "复制链接" diff --git a/apps/web/tests/expected/remote-connection/expired.expected.md b/apps/web/tests/expected/remote-connection/expired.expected.md index 7e17b078e2..657d085e60 100644 --- a/apps/web/tests/expected/remote-connection/expired.expected.md +++ b/apps/web/tests/expected/remote-connection/expired.expected.md @@ -1,12 +1,12 @@ - region "远程连接": - heading "远程连接" [level=2] + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] + - code: {{access-address}}?token={{login-token}} + - button "复制链接" - region "二维码登录": - heading "二维码登录" [level=3] - button "重新生成" - status: - paragraph: 二维码已过期,请生成新二维码登录 - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 - - code: {{access-address}}?token={{login-token}} - - button "复制链接" diff --git a/apps/web/tests/expected/remote-connection/extensions.expected.md b/apps/web/tests/expected/remote-connection/extensions.expected.md index d54d0d40ef..d11b997af1 100644 --- a/apps/web/tests/expected/remote-connection/extensions.expected.md +++ b/apps/web/tests/expected/remote-connection/extensions.expected.md @@ -1,5 +1,10 @@ - region "远程连接": - heading "远程连接" [level=2] + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] + - code: {{access-address}}?token={{login-token}} + - button "复制链接" - region "二维码登录": - heading "二维码登录" [level=3] - button "重新生成" @@ -11,11 +16,6 @@ - paragraph: 请勿分享登录二维码 - paragraph: 二维码使用或过期前,持有它的人都可以登录,请勿传播 - paragraph: HTTP 会明文传输登录凭据,请仅在可信网络中使用 - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 - - code: {{access-address}}?token={{login-token}} - - button "复制链接" - region "连接选项": - heading "连接选项" [level=3] - button "刷新连接状态" diff --git a/apps/web/tests/expected/remote-connection/http-active.expected.md b/apps/web/tests/expected/remote-connection/http-active.expected.md index 81b1f66c8d..0aae18a004 100644 --- a/apps/web/tests/expected/remote-connection/http-active.expected.md +++ b/apps/web/tests/expected/remote-connection/http-active.expected.md @@ -1,5 +1,10 @@ - region "远程连接": - heading "远程连接" [level=2] + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] + - code: {{access-address}}?token={{login-token}} + - button "复制链接" - region "二维码登录": - heading "二维码登录" [level=3] - button "重新生成" @@ -11,8 +16,3 @@ - paragraph: 请勿分享登录二维码 - paragraph: 二维码使用或过期前,持有它的人都可以登录,请勿传播 - paragraph: HTTP 会明文传输登录凭据,请仅在可信网络中使用 - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 - - code: {{access-address}}?token={{login-token}} - - button "复制链接" diff --git a/apps/web/tests/expected/remote-connection/http-link-copied.expected.md b/apps/web/tests/expected/remote-connection/http-link-copied.expected.md index ec668d8c01..1116f1108c 100644 --- a/apps/web/tests/expected/remote-connection/http-link-copied.expected.md +++ b/apps/web/tests/expected/remote-connection/http-link-copied.expected.md @@ -1,5 +1,13 @@ - region "远程连接": - heading "远程连接" [level=2] + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] + - code: {{access-address}}?token={{login-token}} + - button "已复制" + - paragraph: 请勿公开分享登录链接 + - paragraph: 持有此链接的人都可以直接登录,请仅发送给自己的设备,勿公开分享;重启服务后链接失效 + - paragraph: HTTP 会明文传输登录凭据,请仅在可信网络中使用 - region "二维码登录": - heading "二维码登录" [level=3] - button "重新生成" @@ -11,11 +19,3 @@ - paragraph: 请勿分享登录二维码 - paragraph: 二维码使用或过期前,持有它的人都可以登录,请勿传播 - paragraph: HTTP 会明文传输登录凭据,请仅在可信网络中使用 - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 - - code: {{access-address}}?token={{login-token}} - - button "已复制" - - paragraph: 请勿公开分享登录链接 - - paragraph: 持有此链接的人都可以直接登录,请仅发送给自己的设备,勿公开分享;重启服务后链接失效 - - paragraph: HTTP 会明文传输登录凭据,请仅在可信网络中使用 diff --git a/apps/web/tests/expected/remote-connection/http-ready.expected.md b/apps/web/tests/expected/remote-connection/http-ready.expected.md index d0f8bc6d78..dc6c8203b7 100644 --- a/apps/web/tests/expected/remote-connection/http-ready.expected.md +++ b/apps/web/tests/expected/remote-connection/http-ready.expected.md @@ -1,10 +1,10 @@ - region "远程连接": - heading "远程连接" [level=2] + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] + - code: {{access-address}}?token={{login-token}} + - button "复制链接" - region "二维码登录": - heading "二维码登录" [level=3] - button "生成二维码" - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 - - code: {{access-address}}?token={{login-token}} - - button "复制链接" diff --git a/apps/web/tests/expected/remote-connection/link-copied.expected.md b/apps/web/tests/expected/remote-connection/link-copied.expected.md index bb1eeef619..f088e5dd13 100644 --- a/apps/web/tests/expected/remote-connection/link-copied.expected.md +++ b/apps/web/tests/expected/remote-connection/link-copied.expected.md @@ -1,12 +1,12 @@ - region "远程连接": - heading "远程连接" [level=2] - - region "二维码登录": - - heading "二维码登录" [level=3] - - button "生成二维码" - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] - code: {{access-address}}?token={{login-token}} - button "已复制" - paragraph: 请勿公开分享登录链接 - paragraph: 持有此链接的人都可以直接登录,请仅发送给自己的设备,勿公开分享;重启服务后链接失效 + - region "二维码登录": + - heading "二维码登录" [level=3] + - button "生成二维码" diff --git a/apps/web/tests/expected/remote-connection/link-failed.expected.md b/apps/web/tests/expected/remote-connection/link-failed.expected.md index fd50ce5cf1..c42996b410 100644 --- a/apps/web/tests/expected/remote-connection/link-failed.expected.md +++ b/apps/web/tests/expected/remote-connection/link-failed.expected.md @@ -1,11 +1,11 @@ - region "远程连接": - heading "远程连接" [level=2] - - region "二维码登录": - - heading "二维码登录" [level=3] - - button "生成二维码" - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] - code: {{access-address}} - button "重试" - alert: 无法获取登录链接,请重试 + - region "二维码登录": + - heading "二维码登录" [level=3] + - button "生成二维码" diff --git a/apps/web/tests/expected/remote-connection/link-mobile-dark.expected.md b/apps/web/tests/expected/remote-connection/link-mobile-dark.expected.md index bb1eeef619..f088e5dd13 100644 --- a/apps/web/tests/expected/remote-connection/link-mobile-dark.expected.md +++ b/apps/web/tests/expected/remote-connection/link-mobile-dark.expected.md @@ -1,12 +1,12 @@ - region "远程连接": - heading "远程连接" [level=2] - - region "二维码登录": - - heading "二维码登录" [level=3] - - button "生成二维码" - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] - code: {{access-address}}?token={{login-token}} - button "已复制" - paragraph: 请勿公开分享登录链接 - paragraph: 持有此链接的人都可以直接登录,请仅发送给自己的设备,勿公开分享;重启服务后链接失效 + - region "二维码登录": + - heading "二维码登录" [level=3] + - button "生成二维码" diff --git a/apps/web/tests/expected/remote-connection/link-mobile-light.expected.md b/apps/web/tests/expected/remote-connection/link-mobile-light.expected.md index bb1eeef619..f088e5dd13 100644 --- a/apps/web/tests/expected/remote-connection/link-mobile-light.expected.md +++ b/apps/web/tests/expected/remote-connection/link-mobile-light.expected.md @@ -1,12 +1,12 @@ - region "远程连接": - heading "远程连接" [level=2] - - region "二维码登录": - - heading "二维码登录" [level=3] - - button "生成二维码" - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] - code: {{access-address}}?token={{login-token}} - button "已复制" - paragraph: 请勿公开分享登录链接 - paragraph: 持有此链接的人都可以直接登录,请仅发送给自己的设备,勿公开分享;重启服务后链接失效 + - region "二维码登录": + - heading "二维码登录" [level=3] + - button "生成二维码" diff --git a/apps/web/tests/expected/remote-connection/link-ready.expected.md b/apps/web/tests/expected/remote-connection/link-ready.expected.md index d0f8bc6d78..dc6c8203b7 100644 --- a/apps/web/tests/expected/remote-connection/link-ready.expected.md +++ b/apps/web/tests/expected/remote-connection/link-ready.expected.md @@ -1,10 +1,10 @@ - region "远程连接": - heading "远程连接" [level=2] + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] + - code: {{access-address}}?token={{login-token}} + - button "复制链接" - region "二维码登录": - heading "二维码登录" [level=3] - button "生成二维码" - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 - - code: {{access-address}}?token={{login-token}} - - button "复制链接" diff --git a/apps/web/tests/expected/remote-connection/mobile-dark.expected.md b/apps/web/tests/expected/remote-connection/mobile-dark.expected.md index 3439cb06d0..2cb67b17ae 100644 --- a/apps/web/tests/expected/remote-connection/mobile-dark.expected.md +++ b/apps/web/tests/expected/remote-connection/mobile-dark.expected.md @@ -1,5 +1,10 @@ - region "远程连接": - heading "远程连接" [level=2] + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] + - code: {{access-address}}?token={{login-token}} + - button "复制链接" - region "二维码登录": - heading "二维码登录" [level=3] - button "重新生成" @@ -10,8 +15,3 @@ - timer: {{seconds}} 秒后过期 - paragraph: 请勿分享登录二维码 - paragraph: 二维码使用或过期前,持有它的人都可以登录,请勿传播 - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 - - code: {{access-address}}?token={{login-token}} - - button "复制链接" diff --git a/apps/web/tests/expected/remote-connection/mobile-light.expected.md b/apps/web/tests/expected/remote-connection/mobile-light.expected.md index 3439cb06d0..2cb67b17ae 100644 --- a/apps/web/tests/expected/remote-connection/mobile-light.expected.md +++ b/apps/web/tests/expected/remote-connection/mobile-light.expected.md @@ -1,5 +1,10 @@ - region "远程连接": - heading "远程连接" [level=2] + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] + - code: {{access-address}}?token={{login-token}} + - button "复制链接" - region "二维码登录": - heading "二维码登录" [level=3] - button "重新生成" @@ -10,8 +15,3 @@ - timer: {{seconds}} 秒后过期 - paragraph: 请勿分享登录二维码 - paragraph: 二维码使用或过期前,持有它的人都可以登录,请勿传播 - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 - - code: {{access-address}}?token={{login-token}} - - button "复制链接" diff --git a/apps/web/tests/expected/remote-connection/regenerating.expected.md b/apps/web/tests/expected/remote-connection/regenerating.expected.md index 4674714ac6..5bc80b939c 100644 --- a/apps/web/tests/expected/remote-connection/regenerating.expected.md +++ b/apps/web/tests/expected/remote-connection/regenerating.expected.md @@ -1,5 +1,10 @@ - region "远程连接": - heading "远程连接" [level=2] + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] + - code: {{access-address}}?token={{login-token}} + - button "复制链接" - region "二维码登录": - heading "二维码登录" [level=3] - button "重新生成" [disabled] @@ -10,8 +15,3 @@ - timer: {{seconds}} 秒后过期 - paragraph: 请勿分享登录二维码 - paragraph: 二维码使用或过期前,持有它的人都可以登录,请勿传播 - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 - - code: {{access-address}}?token={{login-token}} - - button "复制链接" diff --git a/apps/web/tests/expected/remote-connection/used.expected.md b/apps/web/tests/expected/remote-connection/used.expected.md index 4884884a4d..d9479ef80c 100644 --- a/apps/web/tests/expected/remote-connection/used.expected.md +++ b/apps/web/tests/expected/remote-connection/used.expected.md @@ -1,11 +1,11 @@ - region "远程连接": - heading "远程连接" [level=2] + - paragraph: 通过以下方式,在其他设备上登录并使用 DeepSeek Harness。 + - region "访问地址": + - heading "访问地址" [level=3] + - code: {{access-address}}?token={{login-token}} + - button "复制链接" - region "二维码登录": - heading "二维码登录" [level=3] - button "重新生成" - status: 二维码已使用,请在手机上确认是否已登录 - - region "链接登录": - - heading "链接登录" [level=3] - - paragraph: 复制登录链接,在另一台设备的浏览器中打开 - - code: {{access-address}}?token={{login-token}} - - button "复制链接" diff --git a/apps/web/tests/remote-connection.e2e.ts b/apps/web/tests/remote-connection.e2e.ts index 6c355ecbd5..4df1675da5 100644 --- a/apps/web/tests/remote-connection.e2e.ts +++ b/apps/web/tests/remote-connection.e2e.ts @@ -21,7 +21,7 @@ async function remoteSettings(page: Page): Promise { .getByRole('button', { name: '远程连接', exact: true }).click() const section = page.getByRole('region', { name: '远程连接', exact: true }) await section.waitFor() - const link = section.getByRole('region', { name: '链接登录', exact: true }) + const link = section.getByRole('region', { name: '访问地址', exact: true }) await expect.poll(() => link.getByRole('button', { name: /^(复制链接|重试)$/ }).isEnabled()).toBe(true) return section } @@ -166,7 +166,7 @@ describe('web e2e: one-use QR browser login', () => { await page.goto(secure.authenticatedUrl) const section = await remoteSettings(page) const qrSection = section.getByRole('region', { name: '二维码登录', exact: true }) - const linkSection = section.getByRole('region', { name: '链接登录', exact: true }) + const linkSection = section.getByRole('region', { name: '访问地址', exact: true }) expect(await qrSection.count()).toBe(1) expect(await linkSection.count()).toBe(1) for (const card of [qrSection, linkSection]) { @@ -270,13 +270,14 @@ describe('web e2e: one-use QR browser login', () => { const section = await remoteSettings(page) await createCode(page, section) const qr = section.getByRole('region', { name: '二维码登录', exact: true }) - const link = section.getByRole('region', { name: '链接登录', exact: true }) + const link = section.getByRole('region', { name: '访问地址', exact: true }) const copy = link.getByRole('button', { name: '复制链接', exact: true }) const beforeSection = await section.boundingBox() const beforeQr = await qr.boundingBox() const beforeField = await link.locator('code').locator('..').boundingBox() const beforeCopy = await copy.boundingBox() const scrollport = page.getByRole('dialog', { name: '设置', exact: true }).locator('[data-slot="settings.section"]').locator('..') + const beforeLink = await link.boundingBox() const beforeGutter = await scrollport.evaluate(element => element.getBoundingClientRect().width - element.clientWidth) const screenshots = process.env['DSH_REMOTE_CONNECTION_SCREENSHOTS'] if (screenshots !== undefined) { @@ -292,8 +293,16 @@ describe('web e2e: one-use QR browser login', () => { expect(beforeField).not.toBeNull() expect(beforeCopy).not.toBeNull() const gutterChange = await scrollport.evaluate(element => element.getBoundingClientRect().width - element.clientWidth) - beforeGutter + expect(beforeLink).not.toBeNull() expect((await section.boundingBox())!.width).toBe(beforeSection!.width - gutterChange) - expect(await qr.boundingBox()).toEqual({ ...beforeQr!, width: beforeQr!.width - gutterChange }) + const afterQr = await qr.boundingBox() + const afterLink = await link.boundingBox() + expect(afterQr).not.toBeNull() + expect(afterLink).not.toBeNull() + expect(afterLink!.height).toBeGreaterThan(beforeLink!.height) + expect(afterQr).toEqual({ + ...beforeQr!, y: beforeQr!.y + afterLink!.height - beforeLink!.height, width: beforeQr!.width - gutterChange, + }) expect(await link.locator('code').locator('..').boundingBox()).toEqual({ ...beforeField!, width: beforeField!.width - gutterChange }) expect(await link.getByRole('button', { name: '已复制', exact: true }).boundingBox()).toEqual({ ...beforeCopy!, x: beforeCopy!.x - gutterChange }) expect(await qr.getByRole('img').count()).toBe(1) @@ -547,7 +556,7 @@ describe('web e2e: one-use QR browser login', () => { const section = await remoteSettings(page) await createCode(page, section) const qr = section.getByRole('region', { name: '二维码登录', exact: true }) - const link = section.getByRole('region', { name: '链接登录', exact: true }) + const link = section.getByRole('region', { name: '访问地址', exact: true }) const qrBox = await qr.boundingBox() const linkBox = await link.boundingBox() const symbol = await qr.getByRole('img').boundingBox() @@ -706,7 +715,7 @@ describe('web e2e: one-use QR browser login', () => { const nav = page.getByRole('dialog', { name: '设置', exact: true }) .getByRole('button', { name: '远程连接', exact: true }) const custom = page.getByRole('region', { name: '自定义远程连接', exact: true }) - const linkCard = section.getByRole('region', { name: '链接登录', exact: true }) + const linkCard = section.getByRole('region', { name: '访问地址', exact: true }) expect(await nav.count()).toBe(1) expect(await svg.innerHTML()).toBe(initialSvg) expect(await section.getByRole('button', { name: '复制链接', exact: true }).isEnabled()).toBe(true) @@ -723,7 +732,7 @@ describe('web e2e: one-use QR browser login', () => { expect((await refreshed).status()).toBe(200) await extension.getByRole('status').filter({ hasText: '等待扫码' }).waitFor() expect(await svg.innerHTML()).toBe(initialSvg) - const loginUrl = await section.getByRole('region', { name: '链接登录', exact: true }).locator('code').textContent() + const loginUrl = await section.getByRole('region', { name: '访问地址', exact: true }).locator('code').textContent() expect(loginUrl).not.toBeNull() const extendedAria = await captureStableAria(page, '[data-slot="settings.section"]', scaffold.workspaceCwd, { replacements: [[loginUrl!, '{{access-address}}?token={{login-token}}'], [invitationId, '{{invitation-id}}']], diff --git a/packages/client/remote-connection/README.i18n.yaml b/packages/client/remote-connection/README.i18n.yaml index 47e647c916..1ef170b60e 100644 --- a/packages/client/remote-connection/README.i18n.yaml +++ b/packages/client/remote-connection/README.i18n.yaml @@ -9,8 +9,8 @@ en: 9bbd5b81d7f513ef zh: ba7d27a7b0f22dc9 /deepseek-ai-dsh-client-remote-connection/summary: - en: 639f29d44170cd2e - zh: 91cb391d44fe3bf5 + en: a6d289a2f6e19673 + zh: d2d0edc1ebf4dd7b /deepseek-ai-dsh-client-remote-connection/table-of-contents: en: ee070d32177b96d9 zh: f946b0eba6746ffd diff --git a/packages/client/remote-connection/README.md b/packages/client/remote-connection/README.md index 41c0466a7a..4afad49b1d 100644 --- a/packages/client/remote-connection/README.md +++ b/packages/client/remote-connection/README.md @@ -9,7 +9,7 @@ English | [中文](README.zh.md) ## Summary -The settings panel separates QR code login and link login. A signed-in owner can generate a one-use QR code or copy a tokenized URL to sign another browser into the same Host. QR redemption issues a Remote browser cookie; copied links continue to use the independent Token login. The QR code, countdown, and credential warning stack vertically; expiry appears as a warning banner. Credential warnings appear only after generation or successful copying. The login link displays its token and fades at the right edge. Clipboard outcomes use a shell toast that survives closing settings. +Settings shows shared sign-in guidance, then access-address and QR login cards. A signed-in owner can generate a one-use QR code or copy a tokenized URL to sign another browser into the same Host. QR redemption issues a Remote browser cookie; copied links continue to use the independent Token login. The QR code, countdown, and credential warning stack vertically; expiry appears as a warning banner. Credential warnings appear only after generation or successful copying. The login link displays its token and fades at the right edge. Clipboard outcomes use a shell toast that survives closing settings. ## Table of Contents diff --git a/packages/client/remote-connection/README.zh.md b/packages/client/remote-connection/README.zh.md index 1f81175c28..0eaf65cade 100644 --- a/packages/client/remote-connection/README.zh.md +++ b/packages/client/remote-connection/README.zh.md @@ -9,7 +9,7 @@ kind: "package-reference" ## 概述 -设置面板将二维码登录与链接登录分为两个区块。已登录的 owner 可以生成一次性二维码,或复制带 token 的 URL,让另一个浏览器登录同一 Host。二维码兑换签发 Remote 浏览器 cookie;复制链接继续使用独立的 Token 登录。二维码、倒计时和凭据告警纵向排列;二维码过期时显示告警 banner。凭据告警仅在生成二维码或成功复制链接后出现。登录链接直接显示 token,并在右侧渐隐。复制结果通过关闭设置后仍可见的外壳 toast 提示成功或失败。 +设置面板在共用登录说明下依次显示访问地址和二维码登录卡片。已登录的 owner 可以生成一次性二维码,或复制带 token 的 URL,让另一个浏览器登录同一 Host。二维码兑换签发 Remote 浏览器 cookie;复制链接继续使用独立的 Token 登录。二维码、倒计时和凭据告警纵向排列;二维码过期时显示告警 banner。凭据告警仅在生成二维码或成功复制链接后出现。登录链接直接显示 token,并在右侧渐隐。复制结果通过关闭设置后仍可见的外壳 toast 提示成功或失败。 ## 目录 diff --git a/packages/client/remote-connection/src/client/RemoteConnectionSection.tsx b/packages/client/remote-connection/src/client/RemoteConnectionSection.tsx index 2e16d791a4..3699df8205 100644 --- a/packages/client/remote-connection/src/client/RemoteConnectionSection.tsx +++ b/packages/client/remote-connection/src/client/RemoteConnectionSection.tsx @@ -1,4 +1,4 @@ -/** Separate QR and tokenized-link controls for signing another browser in. */ +/** Access address and QR login controls for browser sign-in. */ import { QRCodeSVG } from 'qrcode.react' import { Button, IconWarningOutlineMedium, StateDot } from '@deepseek-ai/dsh-client-ui-primitives' import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots' @@ -9,7 +9,7 @@ import css from './RemoteConnectionSection.module.css' export type RemoteConnectionSectionProps = RemoteConnectionContentProps & PropsLocale<'remoteConnection'> /** - * Present independent QR and tokenized-link cards with loading confined to the QR preview. + * Present shared sign-in guidance followed by access address and QR login cards. * @param props - Section injection and standard slot props. * @returns Remote connection settings content. */ @@ -20,9 +20,10 @@ export function RemoteConnectionSection(props: RemoteConnectionSectionProps) { return

{t('title')}

+

{t('addressDescription')}

+ -
} @@ -75,17 +76,16 @@ function QrLoginCard({ t, useRemoteConnection, create, cancel, reload }: Pick } -function LinkLoginCard({ t, useRemoteConnection, useLoginLink, copyLink, reloadLink }: Pick) { const deployment = useRemoteConnection(state => state.deployment) const link = useLoginLink(state => state) const available = deployment?.availability === 'available' const http = deployment?.url.startsWith('http:') === true const retryLink = link.phase === 'error' - return
+ return
-

{t('linkTitle')}

-

{t('linkDescription')}

+

{t('addressTitle')}

{deployment !== null &&
diff --git a/packages/client/remote-connection/src/client/locales.ts b/packages/client/remote-connection/src/client/locales.ts index a83db9951c..2a21f9d2ca 100644 --- a/packages/client/remote-connection/src/client/locales.ts +++ b/packages/client/remote-connection/src/client/locales.ts @@ -4,8 +4,8 @@ export const en = { title: 'Remote connection', qrTitle: 'QR code login', - linkTitle: 'Link login', - linkDescription: 'Copy the login link and open it in the browser on your other device.', + addressTitle: 'Access address', + addressDescription: 'Use the methods below to sign in to DeepSeek Harness on another device.', copyLink: 'Copy link', copied: 'Copied', copying: 'Copying login link', @@ -45,8 +45,8 @@ export type RemoteConnectionLocaleKey = keyof typeof en export const zh: Record = { title: '远程连接', qrTitle: '二维码登录', - linkTitle: '链接登录', - linkDescription: '复制登录链接,在另一台设备的浏览器中打开', + addressTitle: '访问地址', + addressDescription: '通过以下方式,在其他设备上登录并使用 DeepSeek Harness。', copyLink: '复制链接', copied: '已复制', copying: '正在复制登录链接', @@ -83,8 +83,8 @@ export const zh: Record = { export const ja: Record = { title: 'リモート接続', qrTitle: 'QRコードでログイン', - linkTitle: 'リンクでログイン', - linkDescription: 'ログインリンクをコピーし、別の端末のブラウザーで開いてください。', + addressTitle: 'アクセスアドレス', + addressDescription: '以下の方法で別の端末から DeepSeek Harness にログインしてください。', copyLink: 'リンクをコピー', copied: 'コピー済み', copying: 'ログインリンクをコピー中', @@ -121,8 +121,8 @@ export const ja: Record = { export const es: Record = { title: 'Conexión remota', qrTitle: 'Inicio de sesión con QR', - linkTitle: 'Inicio de sesión con enlace', - linkDescription: 'Copia el enlace y ábrelo en el navegador de tu otro dispositivo.', + addressTitle: 'Dirección de acceso', + addressDescription: 'Usa los métodos siguientes para iniciar sesión en DeepSeek Harness desde otro dispositivo.', copyLink: 'Copiar enlace', copied: 'Copiado', copying: 'Copiando enlace', @@ -159,8 +159,8 @@ export const es: Record = { export const fr: Record = { title: 'Connexion à distance', qrTitle: 'Connexion par code QR', - linkTitle: 'Connexion par lien', - linkDescription: 'Copiez le lien et ouvrez-le dans le navigateur de votre autre appareil.', + addressTitle: 'Adresse d’accès', + addressDescription: 'Utilisez les méthodes ci-dessous pour vous connecter à DeepSeek Harness depuis un autre appareil.', copyLink: 'Copier le lien', copied: 'Copié', copying: 'Copie du lien', @@ -197,8 +197,8 @@ export const fr: Record = { export const de: Record = { title: 'Fernverbindung', qrTitle: 'Anmeldung per QR-Code', - linkTitle: 'Anmeldung per Link', - linkDescription: 'Kopieren Sie den Link und öffnen Sie ihn im Browser Ihres anderen Geräts.', + addressTitle: 'Zugriffsadresse', + addressDescription: 'Verwenden Sie die folgenden Methoden, um sich auf einem anderen Gerät bei DeepSeek Harness anzumelden.', copyLink: 'Link kopieren', copied: 'Kopiert', copying: 'Anmeldelink wird kopiert', @@ -235,8 +235,8 @@ export const de: Record = { export const ru: Record = { title: 'Удалённое подключение', qrTitle: 'Вход по QR-коду', - linkTitle: 'Вход по ссылке', - linkDescription: 'Скопируйте ссылку и откройте её в браузере другого устройства.', + addressTitle: 'Адрес доступа', + addressDescription: 'Используйте указанные ниже способы для входа в DeepSeek Harness с другого устройства.', copyLink: 'Копировать ссылку', copied: 'Скопировано', copying: 'Копирование ссылки', @@ -273,8 +273,8 @@ export const ru: Record = { export const pt: Record = { title: 'Conexão remota', qrTitle: 'Login por código QR', - linkTitle: 'Login por link', - linkDescription: 'Copie o link e abra-o no navegador do seu outro dispositivo.', + addressTitle: 'Endereço de acesso', + addressDescription: 'Use os métodos abaixo para entrar no DeepSeek Harness em outro dispositivo.', copyLink: 'Copiar link', copied: 'Copiado', copying: 'Copiando link', diff --git a/packages/client/remote-connection/tests/apply.client.spec.ts b/packages/client/remote-connection/tests/apply.client.spec.ts index 574af28bfa..df483ac41e 100644 --- a/packages/client/remote-connection/tests/apply.client.spec.ts +++ b/packages/client/remote-connection/tests/apply.client.spec.ts @@ -186,7 +186,7 @@ describe('remote connection settings registration', () => { await act(async () => { await earlier.await() }) const earlierRegion = screen.getByRole('region', { name: 'Earlier options' }) expect(screen.getAllByRole('region').map(region => region.getAttribute('aria-label'))) - .toEqual([zh.title, zh.qrTitle, zh.linkTitle, 'Earlier options', 'Later options']) + .toEqual([zh.title, zh.addressTitle, zh.qrTitle, 'Earlier options', 'Later options']) expect(screen.getByRole('img', { name: zh.qr })).toBe(qr) expect(earlierRegion.dataset).toMatchObject({ phase: 'pending', ticket: 'extension-invitation', link: 'ready' }) expect(laterRegion.dataset).toMatchObject({ phase: 'pending', ticket: 'extension-invitation', link: 'ready' }) diff --git a/packages/client/remote-connection/tests/section.client.spec.tsx b/packages/client/remote-connection/tests/section.client.spec.tsx index b8fa98dea7..9697f430e3 100644 --- a/packages/client/remote-connection/tests/section.client.spec.tsx +++ b/packages/client/remote-connection/tests/section.client.spec.tsx @@ -39,6 +39,20 @@ function panel(overrides: Partial = {}, language: 'en' | } describe('Remote connection section', () => { + it.each(['en', 'zh'] as const)('introduces the access address before QR login in %s', (language) => { + const copy = language === 'en' ? en : zh + panel({}, language) + const section = screen.getByRole('region', { name: copy.title }) + expect(within(section).getAllByRole('heading', { level: 3 }).map(heading => heading.textContent)) + .toEqual([copy.addressTitle, copy.qrTitle]) + expect(within(section).getAllByRole('region')).toHaveLength(2) + const description = within(section).getByText(copy.addressDescription) + for (const card of within(section).getAllByRole('region')) { + expect(within(card).queryByText(copy.addressDescription)).toBeNull() + expect(description.compareDocumentPosition(card) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + } + }) + it('separates QR and link login and shows no credential warnings before either action', () => { const { create, copyLink } = panel() expect(screen.getByRole('region', { name: en.title })).toBeTruthy() @@ -47,7 +61,7 @@ describe('Remote connection section', () => { expect(screen.queryByText(en.httpWarning)).toBeNull() expect(screen.queryByRole('img')).toBeNull() const qr = screen.getByRole('region', { name: en.qrTitle }) - const link = screen.getByRole('region', { name: en.linkTitle }) + const link = screen.getByRole('region', { name: en.addressTitle }) expect(within(qr).queryByRole('button', { name: en.copyLink })).toBeNull() expect(within(link).queryByRole('button', { name: en.generate })).toBeNull() expect(within(qr).queryByText('https://host.example/app/')).toBeNull() @@ -110,7 +124,7 @@ describe('Remote connection section', () => { it('keeps the link card and its focus while the QR is generated or refreshed', () => { const { state, copyLink } = panel({ phase: 'pending', ticket }, 'en', { copied: true }) const qr = screen.getByRole('region', { name: en.qrTitle }) - const link = screen.getByRole('region', { name: en.linkTitle }) + const link = screen.getByRole('region', { name: en.addressTitle }) const copy = within(link).getByRole('button', { name: en.copied }) copy.focus() for (const phase of ['creating', 'loading'] as const) { @@ -119,7 +133,7 @@ describe('Remote connection section', () => { expect(within(qr).getByRole('status', { name: en[phase] })).toBeTruthy() expect(within(qr).queryByRole('img')).toBeNull() expect(within(qr).queryByRole('timer')).toBeNull() - expect(screen.getByRole('region', { name: en.linkTitle })).toBe(link) + expect(screen.getByRole('region', { name: en.addressTitle })).toBe(link) expect(within(link).getByRole('button', { name: en.copied })).toBe(copy) expect(copy).toHaveProperty('disabled', false) expect(document.activeElement).toBe(copy) @@ -215,7 +229,7 @@ describe('Remote connection section', () => { it('reuses the copy button to retry a failed link read while QR creation remains available', () => { const { reloadLink, copyLink, linkState } = panel({}, 'en', { phase: 'error', url: null }) - const link = screen.getByRole('region', { name: en.linkTitle }) + const link = screen.getByRole('region', { name: en.addressTitle }) expect(within(link).getByRole('alert').textContent).toBe(en.linkFailed) expect(within(link).getAllByRole('button')).toHaveLength(1) const action = within(link).getByRole('button', { name: en.retry })