From 5e99804bc2c3462f7da8d7ce85600ed05f2dd71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=A8=E9=B1=BC=E8=BE=A3=E6=A4=92?= Date: Mon, 12 Oct 2026 20:06:22 +0800 Subject: [PATCH] fix(agents): open cards from home and align sidebar navigation --- .../20261012-agent-entry-nav-a13e56c9.md | 86 ++++++++++++ README.md | 2 +- src/components/layout/MainLayout.tsx | 1 + src/components/layout/ModuleSwitcher.tsx | 4 +- src/components/layout/Sidebar.tsx | 4 +- src/components/layout/TitleBar.tsx | 45 ++++--- src/pages/CloudAgents/index.tsx | 1 + src/pages/ModuleSelection/index.tsx | 2 +- .../e2e/cloud-agent-navigation-layout.spec.ts | 123 +++++++++++++++++ tests/e2e/cloud-agents.spec.ts | 26 ++++ .../cloud-agent-entry-navigation.test.tsx | 125 ++++++++++++++++++ tests/unit/main-layout-module-gate.test.tsx | 8 +- tests/unit/title-bar.test.tsx | 60 ++++++++- 13 files changed, 460 insertions(+), 27 deletions(-) create mode 100644 .project-docs/30-worklog/tasks/20261012-agent-entry-nav-a13e56c9.md create mode 100644 tests/e2e/cloud-agent-navigation-layout.spec.ts create mode 100644 tests/unit/cloud-agent-entry-navigation.test.tsx diff --git a/.project-docs/30-worklog/tasks/20261012-agent-entry-nav-a13e56c9.md b/.project-docs/30-worklog/tasks/20261012-agent-entry-nav-a13e56c9.md new file mode 100644 index 00000000..bbc26585 --- /dev/null +++ b/.project-docs/30-worklog/tasks/20261012-agent-entry-nav-a13e56c9.md @@ -0,0 +1,86 @@ +# Task: Show Agent cards on entry and align sidebar navigation + +## Identity + +- Task ID: 20261012-agent-entry-nav-a13e56c9 +- Mode: Feature +- Branch: codex/20261012-agent-entry-nav-a13e56c9-agent-entry-nav +- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20261012-agent-entry-nav-a13e56c9 +- Base commit: e5d79bf37a35f84a2b08cab0ad4d712b75fca358 +- Owner: codex +- Status: Planning + +## Scope + +- Homepage Agents module entry opens My Agents cards before any individual Agent configuration/conversation. +- Align the Agents sidebar return-home arrow and collapse control in one top row, matching the user's reference. +- Update the latest local temporary application from this isolated source and preserve its existing profile. + +## Intent And Constraints + +- Keep Chinese product language. Current user instruction authorizes both implementation and continued trial update. +- Do not clear account-scoped recent/pending recovery data, saved drafts, conversation history, selected model/resources, or backend policies. The card-list intent belongs to explicit entry, not every navigation/mount. +- Preserve direct links, explicit card/config/chat actions, draft leave guards, authentication/module access and typed Host APIs. +- Scope sidebar presentation to Agents; Code/Canvas/Robot navigation, native titlebar and account interactions stay compatible. Installed application and cloud services are outside scope. + +## Project Context Loaded + +Task context: +- Task ID: 20261012-agent-entry-nav-a13e56c9 +- Mode: Feature +- Branch: codex/20261012-agent-entry-nav-a13e56c9-agent-entry-nav +- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20261012-agent-entry-nav-a13e56c9 +- Base commit: e5d79bf37a35f84a2b08cab0ad4d712b75fca358 (verified current temporary application source). +- Ownership: bundled start succeeded; status JSON matched task/mode/absolute worktree/branch/base and planning status. +- Other active local tasks: 35 peer owners; each task-record Scope / Intent And Constraints / Promotion Candidates read read-only. +- Overlap: completed Agent homepage/config/trial tasks overlap but support explicit card-list entry. One child-language task scope remains undefined with no concrete dependency. No blocking semantic conflict; unrelated primary/canonical integration work remains untouched. + +Read: +- AGENTS.md; 05-agent-entry/read-before-planning.md and memory-index.md; active task record; planning-gate requirements retained from prior task. +- 00-brief/project-positioning.md and success-criteria.md; 20-architecture/community-collaboration.md; 30-worklog/current-state.md integrated snapshot. +- 10-decisions/decision-index.md and task-relevant personal-cloud ADR recovery/navigation clauses; 20-architecture/system-overview.md; 40-domain/business-rules.md. +- 50-evidence/evidence-index.md; 60-reflection/reflection-index.md; 80-commitments/commitments.md. Canonical content is unchanged from the prior context-loaded task; latest user refinements are authoritative for UI. + +Relevant understanding: +- Project goal: approachable AI creation/use for students and creators; client does not introduce courses or own cloud authentication/billing authority. +- Current integrated focus: unified module permissions/cloud capabilities and traditional Works login; October personal-Agent UI refinements are newer than integrated guided UI descriptions. +- Active task: explicit module entry destination and Agents navigation-row layout, followed by a local trial update. +- Constraints/decisions: Main owns credentials/network/recovery, Renderer uses typed APIs; recent and pending records survive restart and account isolation. User explicitly chooses card destinations; opening modules does not call a model. +- Evidence/reflections/commitments: local fixture/navigation checks do not establish signed installed-client or paid-provider acceptance. Existing real-release commitments remain separate. +- Likely modules: ModuleSelection/CloudAgents routing recovery, Sidebar/TitleBar/MainLayout/ModuleSwitcher, focused unit/layout/Electron tests and README. +- Unknown/stale context: integrated old Agent trial/first-use layout is superseded by the current source and user. Native trial clicks have been intermittent; actual UI may need user navigation, and authentication must remain manual after restart. + +Gate result: +- Passed. + +## Plan + +1. Add explicit card-list entry intent without erasing recovery data or changing individual Agent links. +2. Put Agents return and collapse controls on the same row with accessible labels and keep other modules compatible. +3. Verify scoped behavior/layout and production build, then update the exact temporary runtime after checking unsaved input. +4. Record observed outcome, commit task result, normalize documentation-only runtime metadata and complete ownership. + +## Outcome + +- Homepage Agents and sidebar “我的智能体” now explicitly open the card list via `view=mine`; remembered conversations and pending operations are retained. Individual card actions, direct recovery and channel/shared links keep their existing behavior. +- Agents return-home arrow and sidebar toggle share the top navigation row. The return arrow uses the existing orange brand color with an icon-only circular surface; duplicate sidebar return row removed. Expanded, collapsed and preview states remain usable on macOS/Windows; Linux retains its native frame with an application navigation row. +- README synchronized. No cloud service, authentication, billing or real model submission changed. +- Temporary app replacement prepared under `.trial-runtime/agent-entry-nav-20261012-a13e56c9`; final runtime/UI observation pending. + +## Verification + +- Entry agent: 47 tests passed across new 7-entry checks and existing page/module checks; scoped lint passed. +- Root: 51 focused navigation/titlebar/peek/module checks pass after updating one stale “智能体工作区” title expectation to the previously accepted “我的智能体”; typecheck and scoped lint passed. +- Production build passed (existing bundle-size/import/Browserslist warnings). +- Electron fixture E2E passed: return and fold controls have equal y and separate x, one return button, collapse/expand, dirty-leave protection, homepage re-entry after recent chat lands on cards, and re-opening chat does not submit/publish again. +- Task-scoped project-docs drift check passed. Read-only review passed with no actionable findings; 6 Chrome browser layout fixtures passed (Darwin/Win32/Linux × 375/1024): same-row centers, separate 32px hitboxes, collapse/expand and collapsed return; scoped lint passed. Windows 375 is below native desktop minimum, so native chrome separation accepted only at 1024; navigation reachability checked at both widths. Electron card-list screenshot reviewed: return arrow and fold control occupy one horizontal row, with “我的智能体” in the titlebar. +- Real old trial observed immediately before replacement through full native AX: saved/applied configuration, conversation input empty, no active running action. No real cloud save/publish/chat action performed. + +## Follow-ups + +- Native trial replacement and manual login/page observation remain before final completion. + +## Promotion Candidates + +- Update current-state/Agents navigation documentation during integration: explicit module homepage entry always opens “我的智能体” cards while recent/pending recovery is retained; return/fold share the top row and remain available when collapsed. +- Linux Agents has an application navigation row beneath the native window frame; other Linux modules preserve their prior titlebar behavior. diff --git a/README.md b/README.md index 740ed14d..f10d7c98 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Makelore 是一个面向软件、视觉创作、智能机器人与个人云智 - `Makelore Code|AI 编程`:管理本地项目、项目智能体、对话、文件上下文、代码变更和运行时。 会话工作台采用浅蓝项目栏、彩色通用手柄图标与卡片选中态;中间对话/作品使用圆角标签,作品预览的后退、前进、刷新与网址输入统一放在标签右侧;只在作品页显示,窄窗口自动换行。右侧智能体咨询使用奶油色标题区。沿用真实项目和会话入口、侧栏伸缩与账户菜单,样式只作用于 Code 会话工作台。可编辑的空对话在输入区上方的可用区域中央显示童趣欢迎语;「去作品广场逛逛」入口紧贴输入框上方,两者一起位于底部。老师介绍以固定宽度浮在右上角,不占用中间布局;欢迎语和底部输入区始终相对项目栏右侧的整个内容区域居中;小窗口的欢迎内容独立滚动;发送首条消息后收起欢迎区。侧栏保留「作品广场」入口,只有点击后才在系统浏览器打开公共广场,不请求、摘取或内嵌展示广场作品。打开广场保留当前项目、对话、草稿和附件,不自动发送消息;老师求助按钮保留临时应用的最新文案「帮我整体看🧠」。 -- `Makelore Agents|AI 智能体`:首页围绕自己的智能体和创建入口,显示童趣问候“Hi,今天想创造还是想聊聊?”,不再显示更多、收到的分享、活动或归档筛选。卡片显示名称、可为空的一句话介绍及状态,支持聊天、调整、继续制作和确认删除;删除沿用云端归档机制,移出列表并停用新调用,历史和费用保留。创建先填写名称并选择平台像素头像或上传头像,下一步进入独立配置。顶部名称有编辑图标,头像可点击修改;未设置头像时使用同一张默认像素头像,从创建到配置、改名、保存和重新打开保持一致。基础页为“介绍与提示词”,一句话介绍可留空,完整提示词保留原始文本;模型作为高级设置第一项必选,未选择时不能开始使用,草稿可分步保存,不自动选模型。介绍与提示词采用浅蓝介绍卡和浅紫提示词卡;高级设置按模型、工具箱(Tool)、做事手册(Skill)、MCP 服务、子智能体和知识库纵向呈现,不再设内部分类切换;不展示 Tool/Skill 解释、云端能力管理、费用上限或运行限制卡片,保存其他配置时保留既有运行限制,费用规则不变。顶层页签切换保留搜索、资源选择、知识表单及未保存输入。配置页移除聊天、自动任务和使用与接入导航,独立聊天仍从卡片进入,微信账号仍在侧栏渠道管理。草稿明确保存(Ctrl/⌘+S);保存只更新草稿,“应用最新修改”使新配置生效,失败重试保持原操作身份;点击“开始使用”完成必要的私有启用后直接打开聊天,不再展示二次确认页;未保存修改、缺少模型、冲突或尚未确认的请求会留在配置页处理,打开聊天不自动发送消息。头像上传、Main-owned Host API、访问隔离、费用与不可变版本规则保持;介绍留空需要配套 Yuxi DraftCreate/DraftSave 的空字符串契约。 +- `Makelore Agents|AI 智能体`:从模块首页进入时先打开“我的智能体”卡片列表,保留此前对话与操作恢复记录;返回首页箭头与侧栏折叠按钮同排,折叠后仍可返回或展开,macOS 原生窗口按钮留出安全空间。首页围绕自己的智能体和创建入口,显示童趣问候“Hi,今天想创造还是想聊聊?”,不再显示更多、收到的分享、活动或归档筛选。卡片显示名称、可为空的一句话介绍及状态,支持聊天、调整、继续制作和确认删除;删除沿用云端归档机制,移出列表并停用新调用,历史和费用保留。创建先填写名称并选择平台像素头像或上传头像,下一步进入独立配置。顶部名称有编辑图标,头像可点击修改;未设置头像时使用同一张默认像素头像,从创建到配置、改名、保存和重新打开保持一致。基础页为“介绍与提示词”,一句话介绍可留空,完整提示词保留原始文本;模型作为高级设置第一项必选,未选择时不能开始使用,草稿可分步保存,不自动选模型。介绍与提示词采用浅蓝介绍卡和浅紫提示词卡;高级设置按模型、工具箱(Tool)、做事手册(Skill)、MCP 服务、子智能体和知识库纵向呈现,不再设内部分类切换;不展示 Tool/Skill 解释、云端能力管理、费用上限或运行限制卡片,保存其他配置时保留既有运行限制,费用规则不变。顶层页签切换保留搜索、资源选择、知识表单及未保存输入。配置页移除聊天、自动任务和使用与接入导航,独立聊天仍从卡片进入,微信账号仍在侧栏渠道管理。草稿明确保存(Ctrl/⌘+S);保存只更新草稿,“应用最新修改”使新配置生效,失败重试保持原操作身份;点击“开始使用”完成必要的私有启用后直接打开聊天,不再展示二次确认页;未保存修改、缺少模型、冲突或尚未确认的请求会留在配置页处理,打开聊天不自动发送消息。头像上传、Main-owned Host API、访问隔离、费用与不可变版本规则保持;介绍留空需要配套 Yuxi DraftCreate/DraftSave 的空字符串契约。 云知识库的 embedding 模型只由平台管理员在 Yuxi 后台维护:在「智能体管理 → 模型供应商」启用供应商,按供应商要求填写有效的服务地址和 API Key,添加并启用 embedding 模型并填写实际向量维度;embedding 向量化费用由平台承担,不计入用户用量、词元点数或智能体费用上限;one-api 不参与 embedding 配置,Works Square 只负责其他应计费模型调用的创建者词元点数账本。客户端区分目录加载中、加载失败与无可用模型,空状态提供管理员配置说明;「刷新知识库与模型」保留未提交名称,未确认的创建请求沿用原操作身份。 diff --git a/src/components/layout/MainLayout.tsx b/src/components/layout/MainLayout.tsx index b27e0b9f..c9631c1c 100644 --- a/src/components/layout/MainLayout.tsx +++ b/src/components/layout/MainLayout.tsx @@ -79,6 +79,7 @@ export function MainLayout() { @@ -30,12 +31,13 @@ export function ModuleSwitcher({ sidebarCollapsed, compact = false, toolbar = fa : 'flex min-h-11 w-full justify-between gap-2 rounded-2xl p-3 text-sm', sidebarCollapsed ? 'justify-center px-0' : '', toolbar && iconOnly && 'w-8 justify-center px-0', + agentReturn && 'rounded-full bg-background/70 text-brand', )} >