feat: 在顶栏并排展示下发智能体并直接切换
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
# Task: Show distributed consultation agents in title bar
|
||||
|
||||
## Identity
|
||||
|
||||
- Task ID: 20260924-consultation-topbar-22717e99
|
||||
- Mode: Feature
|
||||
- Branch: codex/20260924-consultation-topbar-22717e99-consultation-topbar
|
||||
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260924-consultation-topbar-22717e99
|
||||
- Base commit: 39b03a1628bcdbc9c6bcf82b874e2814bf1780d0
|
||||
- Owner: codex
|
||||
- Status: Ready for Integration
|
||||
|
||||
## Scope
|
||||
|
||||
- Show every server-distributed consultation agent in the Code title bar with avatar/name and direct selection; remove the panel's new-topic agent dropdown. Preserve pinned topic versions, isolate drafts/history by agent and fit narrow windows.
|
||||
|
||||
## Intent And Constraints
|
||||
|
||||
- Concurrent/Planning Gates Passed: official check/start/status match isolated feature Identity. Required memory and unchanged peer context reused from the preceding integration; new packaging, reviewer and integrator records read. No semantic conflict. Primary checkout and foreign work remain read-only.
|
||||
- User explicitly requests distributed agents side by side, not fixed teacher/friend roles or a dropdown. Main owns topic history; Renderer uses existing APIs. Selection must not send paid questions, cancel accepted requests, rebind old versions or copy another agent's draft. Retain unassigned historical drafts visibly without guessing their owner.
|
||||
- Plan: expose agent identity in topic list; connect catalog, topbar and per-agent panel; add focused switch/history/draft tests and existing Electron/layout regressions; run typecheck, scoped lint and build; record evidence and complete. No new subagents, push, merge, install or deployment in this task.
|
||||
|
||||
## Outcome
|
||||
|
||||
- Topbar renders all distributed agents with server avatars/names and a selected state; tabs scroll horizontally without overlapping window controls. The panel no longer contains an agent dropdown. Clicking an agent restores matching history or opens its empty composer; it does not create a topic or send a model request.
|
||||
- Topic list projects the persisted definition's config_id as optional teacherId. Current-agent history restoration uses this identity, while the existing history menu still permits viewing older/other-agent topics and keeps their pinned version. Selecting a historical topic updates the topbar identity. No storage migration, Yuxi/WS change or billing change.
|
||||
- Drafts are scoped by account/project/server agent ID. Switching or reopening preserves each agent's text/references; the former unassigned project draft remains readable in a collapsed section and is not guessed into another agent's input. Legacy friend drafts/history remain readable.
|
||||
- Late initial history and stream/check-in callbacks cannot replace a later explicit agent selection. New empty agent selections wait for student input before participating in existing automatic check-ins; accepted runs are not cancelled. Unavailable historical agents remain viewable without silently choosing another model.
|
||||
- README updated; visually inspected the real Electron fixture screenshot: both server-named entries appear side by side in the title bar and the panel selector is absent.
|
||||
|
||||
## Verification
|
||||
|
||||
- pnpm exec vitest run teacher-companion teacher-discussion teacher-cloud-activity coding-teacher --maxWorkers=1: 9 files / 305 passed. After simplifying retained selected-agent state, reran teacher-companion and coding-teacher-ui: 53 passed. Added one focused unassigned-draft regression afterward: 1 passed; remaining 35 cases intentionally filtered, not failures.
|
||||
- Regression coverage includes per-agent drafts and explicit new-topic version, matching historical topic restoration without rebinding its version, late initial read after switching, no paid calls from switching, persisted Main topic identity and old draft retention.
|
||||
- MAKELORE_LAYOUT_BROWSER_CHANNEL=msedge pnpm exec playwright test tests/e2e/teacher-preview-layout.spec.ts tests/e2e/teacher-discussion-layout.spec.ts: 17 passed. Includes eight-agent horizontal overflow at 520/1000px, keyboard access to the last agent, window-control clearance, bubble/preview placement and 319/508px discussion rendering.
|
||||
- pnpm exec playwright test tests/e2e/pi-coding-first-chat.spec.ts --grep 'project consultations preserve': 1 real Electron fixture interaction passed. Exercises titlebar selection, no agent dropdown, independent drafts, correct version 9 creation, close/reopen, work/chat switching and no Pi prompt submission. Actual providers/online data are mocked.
|
||||
- Renderer typecheck, scoped ESLint, build:vite (Renderer/Main/Preload/utility) and git diff --check passed. Installed pinned dependencies from the offline store and restored Electron through its normal installer; no dependency metadata, package version, existing user profile or installer was changed.
|
||||
- Scope/diff self-review completed: only client UI, existing history DTO projection, README, focused tests and this record changed. No new subagent; existing approval was limited to the preceding rendering review. Main's previously recorded full-typecheck baseline issues were not claimed resolved by the standard Renderer check.
|
||||
|
||||
## Follow-ups
|
||||
|
||||
- Commit is ready for main integration. Not merged, pushed, packaged, installed or deployed in this task; the existing installed client does not yet include this change. Previously pending cleanup of the prior rendering worktrees is still unapproved and no worktree was removed.
|
||||
|
||||
## Promotion Candidates
|
||||
|
||||
- Target: teacher ADR, system overview/current-state. Proposal: backend-distributed agents appear as direct titlebar entries; selection restores the agent's history and scopes its drafts, while old topics keep their published version. Agent dropdown is removed; overflow scrolls within the titlebar. Evidence: explicit user screenshot/request, focused unit cases and real Electron/layout checks above. Future impact: no fixed role names or per-agent duplicated runtime; new agents follow the same catalog contract. Semantic conflict: replaces the former new-topic dropdown UX, expressly requested by user; billing, version and read-tool boundaries remain. Human confirmation: already supplied for implementation; canonical promotion awaits integration mode.
|
||||
Reference in New Issue
Block a user