Name the version in the copied toast
This commit is contained in:
1 parent
fe93616859
commit
915792545f
6 files changed
+9
-7
No files matched your search
@@ -18,8 +18,8 @@
|
||||
en: a970f0547496634f
|
||||
zh: 36ef9a85b26e19f1
|
||||
/deepseek-ai-dsh-client-ui-sidebar/use-this-package/brand-and-new-session:
|
||||
en: a280c6a06b1a2089
|
||||
zh: 9358bbc4181856ed
|
||||
en: e68a91220fd47f98
|
||||
zh: 531277d0fc42767f
|
||||
/deepseek-ai-dsh-client-ui-sidebar/use-this-package/global-panel-entries:
|
||||
en: 5d3300d3506254c5
|
||||
zh: 541ae1ee1e10b921
|
||||
|
||||
@@ -31,7 +31,7 @@ The sidebar is the navigation shell: users see the brand, start new sessions, co
|
||||
|
||||
### Brand and New Session
|
||||
|
||||
The expanded brand row renders `sidebar.brand.mark` and `sidebar.brand.name` as independent single slots; the collapsed rail renders the same mark slot. On Web and Windows desktop, clicking the expanded brand starts a new session; hovering or focusing it shows no tooltip. Without occupants, the shell uses the fish mark and a localized local-build label. A complete build stacks a code badge below the label as `version[-commit][-dirty]`, using `DSH_CLIENT_VERSION`, the optional 7-character `DSH_CLIENT_COMMIT_HASH`, and `DSH_CLIENT_GIT_DIRTY=true`; missing version metadata omits the badge. Clicking the fallback mark or label of such a build copies that badge text instead of starting a session, also on macOS desktop, and a successful write shows a Copied toast. New Session targets the explicit Workspace used by a scoped action, otherwise the current Session's Workspace, otherwise the most recently active Workspace; when none exists it clears into the blank New Session page. The expanded New Session button displays the effective binding as trailing grey text on hover or keyboard focus. While the shortcut is visible, the centered icon and label fade before it when space is narrow; CSS reserves the shortcut’s width without measuring the button. Icon-only controls retain tooltips with platform-formatted keycaps, including the resident macOS header control when the sidebar is hidden. All controls expose `aria-keyshortcuts`.
|
||||
The expanded brand row renders `sidebar.brand.mark` and `sidebar.brand.name` as independent single slots; the collapsed rail renders the same mark slot. On Web and Windows desktop, clicking the expanded brand starts a new session; hovering or focusing it shows no tooltip. Without occupants, the shell uses the fish mark and a localized local-build label. A complete build stacks a code badge below the label as `version[-commit][-dirty]`, using `DSH_CLIENT_VERSION`, the optional 7-character `DSH_CLIENT_COMMIT_HASH`, and `DSH_CLIENT_GIT_DIRTY=true`; missing version metadata omits the badge. Clicking the fallback mark or label of such a build copies that badge text instead of starting a session, also on macOS desktop, and a successful write shows a Version copied toast. New Session targets the explicit Workspace used by a scoped action, otherwise the current Session's Workspace, otherwise the most recently active Workspace; when none exists it clears into the blank New Session page. The expanded New Session button displays the effective binding as trailing grey text on hover or keyboard focus. While the shortcut is visible, the centered icon and label fade before it when space is narrow; CSS reserves the shortcut’s width without measuring the button. Icon-only controls retain tooltips with platform-formatted keycaps, including the resident macOS header control when the sidebar is hidden. All controls expose `aria-keyshortcuts`.
|
||||
|
||||
### Global panel entries
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ dsh Web 客户端的侧边栏让用户识别当前构建、启动新会话、将
|
||||
|
||||
### 品牌与 New Session
|
||||
|
||||
展开的品牌行把 `sidebar.brand.mark` 与 `sidebar.brand.name` 渲染为两个独立的 single slot;收起轨道则渲染同一个 mark slot。在 Web 和 Windows 桌面端,点击展开态的品牌会新建会话,悬停或聚焦时不显示 tooltip。没有占位者时,外壳使用鱼形标记和本地化的本地构建标签。完整构建会在标签下方显示代码徽标;该徽标使用 `DSH_CLIENT_VERSION`、可选的 7 位 `DSH_CLIENT_COMMIT_HASH` 与 `DSH_CLIENT_GIT_DIRTY=true` 组装成 `version[-commit][-dirty]`;缺少版本元数据时不显示徽标。此类构建中点击回退的标记或标签会复制该徽标文本而非新建会话,macOS 桌面端同样适用;写入成功后弹出“复制成功”toast。New Session 优先使用作用域操作明确指定的 Workspace,否则使用当前 Session 所属 Workspace,再否则使用最近活跃 Workspace;一个 Workspace 都没有时则清空选择,进入空白 New Session 页面。 展开态的新建会话按钮在悬停或键盘聚焦时于右侧以灰色文字显示当前有效绑定。快捷键可见且空间较窄时,居中的图标与文字在快捷键之前渐隐;CSS 为快捷键保留宽度,无需测量按钮。纯图标控件保留使用平台键位样式的 tooltip,侧栏隐藏时常驻的 macOS 头部控件也保持一致。所有控件均提供 `aria-keyshortcuts`。
|
||||
展开的品牌行把 `sidebar.brand.mark` 与 `sidebar.brand.name` 渲染为两个独立的 single slot;收起轨道则渲染同一个 mark slot。在 Web 和 Windows 桌面端,点击展开态的品牌会新建会话,悬停或聚焦时不显示 tooltip。没有占位者时,外壳使用鱼形标记和本地化的本地构建标签。完整构建会在标签下方显示代码徽标;该徽标使用 `DSH_CLIENT_VERSION`、可选的 7 位 `DSH_CLIENT_COMMIT_HASH` 与 `DSH_CLIENT_GIT_DIRTY=true` 组装成 `version[-commit][-dirty]`;缺少版本元数据时不显示徽标。此类构建中点击回退的标记或标签会复制该徽标文本而非新建会话,macOS 桌面端同样适用;写入成功后弹出“版本号复制成功”toast。New Session 优先使用作用域操作明确指定的 Workspace,否则使用当前 Session 所属 Workspace,再否则使用最近活跃 Workspace;一个 Workspace 都没有时则清空选择,进入空白 New Session 页面。 展开态的新建会话按钮在悬停或键盘聚焦时于右侧以灰色文字显示当前有效绑定。快捷键可见且空间较窄时,居中的图标与文字在快捷键之前渐隐;CSS 为快捷键保留宽度,无需测量按钮。纯图标控件保留使用平台键位样式的 tooltip,侧栏隐藏时常驻的 macOS 头部控件也保持一致。所有控件均提供 `aria-keyshortcuts`。
|
||||
|
||||
### 全局面板入口
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ export function SidebarRoot({
|
||||
</div>
|
||||
|
||||
{copiedToast !== null && (
|
||||
<Toast key={copiedToast} tone="success" text={t('copied')} onDone={() => { setCopiedToast(null) }} />
|
||||
<Toast key={copiedToast} tone="success" text={t('version.copied')} onDone={() => { setCopiedToast(null) }} />
|
||||
)}
|
||||
|
||||
{/* Footer actions stack above Settings in both sidebar widths. */}
|
||||
|
||||
@@ -7,6 +7,7 @@ export const zh = {
|
||||
'toggle.open': '打开侧边栏',
|
||||
'toggle.collapse': '收起侧边栏',
|
||||
'panels.label': '全局面板',
|
||||
'version.copied': '版本号复制成功',
|
||||
} satisfies Record<string, string>
|
||||
|
||||
/** The sidebar namespace key union. */
|
||||
@@ -19,4 +20,5 @@ export const en = {
|
||||
'toggle.open': 'Open sidebar',
|
||||
'toggle.collapse': 'Collapse sidebar',
|
||||
'panels.label': 'Global panels',
|
||||
'version.copied': 'Version copied',
|
||||
} satisfies Record<SidebarKey, string>
|
||||
@@ -204,7 +204,7 @@ describe('SidebarRoot shell', () => {
|
||||
const copiedToasts = () => screen.queryAllByRole('alert').map(toast => toast.textContent)
|
||||
await act(async () => { fireEvent.click(screen.getByText('DSH Local Build')) })
|
||||
expect(writeText).toHaveBeenLastCalledWith('1.2.3-abcdef0')
|
||||
expect(copiedToasts()).toEqual(['Copied'])
|
||||
expect(copiedToasts()).toEqual(['Version copied'])
|
||||
// The brand itself keeps its title and version.
|
||||
expect(screen.getByText('DSH Local Build')).toBeTruthy()
|
||||
expect(screen.getByText('1.2.3-abcdef0')).toBeTruthy()
|
||||
@@ -223,7 +223,7 @@ describe('SidebarRoot shell', () => {
|
||||
document.removeEventListener('click', documentClick)
|
||||
expect(documentClick).toHaveBeenCalledOnce()
|
||||
expect(writeText).toHaveBeenCalledTimes(3)
|
||||
expect(copiedToasts()).toEqual(['Copied'])
|
||||
expect(copiedToasts()).toEqual(['Version copied'])
|
||||
expect(startSession).not.toHaveBeenCalled()
|
||||
|
||||
// The rest of the brand button still starts a session.
|
||||
|
||||
Reference in new issue
Block a user