diff --git a/.agents/notes/implemented/bug-fix/2026-10-20-sidebar-connection-working-mark.md b/.agents/notes/implemented/bug-fix/2026-10-20-sidebar-connection-working-mark.md new file mode 100644 index 000000000..894c2f11c --- /dev/null +++ b/.agents/notes/implemented/bug-fix/2026-10-20-sidebar-connection-working-mark.md @@ -0,0 +1,36 @@ +# Use the sidebar working mark for connection loading + +Status: implemented +Translation: current + +[中文](2026-10-20-sidebar-connection-working-mark.zh.md) + +## Abstract + +The sidebar connection pill used a rotating ring while session rows used the +sidebar's shared 3×3 working mark, making two active states look unrelated. +`ConnectionPill` now uses the same `WorkingGrid` at its existing 12px size and +keeps the pill's running tone and accessible label. The grid already belongs to +the sidebar and preserves its compositor-friendly animation; this change does +not extend it to other surfaces. + +## Decision + +- Use `WorkingGrid` for loading, reconnecting and syncing states in the sidebar + connection pill, matching the mark used for active sidebar sessions. +- Keep the existing 12px footprint, badge tone, and `aria-label`; offline stays + a static danger state without an icon. + +## Verification + +- `pnpm format` passed. `pnpm run docs check` passed with repository-wide + warnings about older notes without translations and `AGENTS.md` size. +- `pnpm check` passed typecheck, lint and Effect lint. Its `test:ci` phase failed + on unrelated five-second UI test timeouts and CLI tests. The focused + `workspace-identity.test.tsx` suite passed all 9 tests, including assertions + for the shared mark in syncing state and its absence offline. +- `git diff --check` passed. + +## Pull request + +- [PR #1738](https://github.com/LodyAI/Lody/pull/1738) (draft). diff --git a/.agents/notes/implemented/bug-fix/2026-10-20-sidebar-connection-working-mark.zh.md b/.agents/notes/implemented/bug-fix/2026-10-20-sidebar-connection-working-mark.zh.md new file mode 100644 index 000000000..9f3bdc743 --- /dev/null +++ b/.agents/notes/implemented/bug-fix/2026-10-20-sidebar-connection-working-mark.zh.md @@ -0,0 +1,28 @@ +# 侧栏连接加载状态沿用工作标记 + +Status: implemented +Translation: current + +[English](2026-10-20-sidebar-connection-working-mark.md) + +## 摘要 + +侧栏连接状态胶囊使用旋转圆环,会话行却使用侧栏统一的 3×3 工作标记,导致两种进行中的状态看起来不一致。现在 `ConnectionPill` 改用相同的 `WorkingGrid`,尺寸仍为 12px,并保留原有运行色调和无障碍标签。该方格动画已用于侧栏且支持合成器播放;本次不把它扩展到其他界面。 + +## 决策 + +- 侧栏连接胶囊的加载、重连和同步状态使用 `WorkingGrid`,与正在工作的会话标记一致。 +- 保留现有 12px 尺寸、徽标色调和 `aria-label`;离线状态仍显示无图标的静态危险样式。 + +## 验证 + +- `pnpm format` 通过。`pnpm run docs check` 通过,但报告了仓库旧笔记缺少翻译和 + `AGENTS.md` 体积等全仓警告。 +- `pnpm check` 的类型检查、lint 和 Effect lint 均通过;`test:ci` 因无关的 UI + 测试五秒超时和 CLI 测试失败而未通过。针对性的 `workspace-identity.test.tsx` + 套件 9 项全通过,覆盖同步状态显示统一标记以及离线时不显示标记。 +- `git diff --check` 通过。 + +## Pull request + +- [PR #1738](https://github.com/LodyAI/Lody/pull/1738)(草稿)。 diff --git a/packages/components/src/components/loro-sidebar.tsx b/packages/components/src/components/loro-sidebar.tsx index 735b90788..ff8b26b37 100644 --- a/packages/components/src/components/loro-sidebar.tsx +++ b/packages/components/src/components/loro-sidebar.tsx @@ -34,6 +34,7 @@ import { colors } from '@lody/ui/tokens/colors.stylex'; import { radius, space } from '@lody/ui/tokens/scales.stylex'; import { Kbd } from '@lody/ui/kbd'; import { Tooltip } from '@lody/ui/tooltip'; +import { WorkingGrid } from '@/ui/working-grid'; import { commands, formatKeyBinding, type ShortcutCommandId } from '@/lib/commands'; import { setCommandPaletteOpen } from '@/lib/commands/palette-state'; import { Menu } from '@/ui/menu'; @@ -60,7 +61,6 @@ import { } from 'lucide-react'; import { MynauiEditOne } from '@lody/ui'; import { CuidaSidebarExpandOutline } from './icons/cuida-sidebar-expand-outline'; -import { Spinner } from '@lody/ui/spinner'; import { SessionList, type SessionListProps, @@ -494,7 +494,7 @@ function ConnectionPill({ return ( : undefined} + icon={isLoading ? : undefined} aria-label={label} data-workspace-status={state} > diff --git a/packages/components/tests/workspace-identity.test.tsx b/packages/components/tests/workspace-identity.test.tsx index 66dfa8aa4..8e7b8c68f 100644 --- a/packages/components/tests/workspace-identity.test.tsx +++ b/packages/components/tests/workspace-identity.test.tsx @@ -200,6 +200,7 @@ describe('workspace identity capability boundary', () => { const status = container?.querySelector('[data-workspace-status]'); expect(status?.getAttribute('data-workspace-status')).toBe('syncing'); expect(status?.textContent).toBe('Syncing target workspace…'); + expect(status?.querySelector('[data-working-grid]')).not.toBeNull(); }); it('keeps connection failures ahead of workspace synchronization', () => { @@ -215,6 +216,7 @@ describe('workspace identity capability boundary', () => { const status = container?.querySelector('[data-workspace-status]'); expect(status?.getAttribute('data-workspace-status')).toBe('offline'); expect(status?.textContent).toBe('No connection'); + expect(status?.querySelector('[data-working-grid]')).toBeNull(); }); it('supports a content-scoped loading placeholder without taking over the viewport', () => {