Simplify Agent chat with inline attachments and separate thinking

This commit is contained in:
鲨鱼辣椒 committed 2026-10-12 21:57:09 +08:00
1 parent 7af43acebb
commit faebfe9e84
18 files changed
+1558 -195

No files matched your search

@@ -0,0 +1,76 @@
# Task: Simplify Agent chat and add attachment composer
## Identity
- Task ID: 20261012-agent-chat-composer-42b8f6d1
- Mode: Feature
- Branch: codex/20261012-agent-chat-composer-42b8f6d1-agent-chat-composer
- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20261012-agent-chat-composer-42b8f6d1
- Base commit: 7af43acebb5d8b118fa16c838dfba2f18e535bb1
- Owner: codex
- Status: Implementing
## Scope
- Simplify personal Agent chat into read-only Agent identity, transcript and attachment composer. Remove configuration/save/apply controls, source tabs, toolbar title/billing/version copy and history/new-chat icons from the published conversation. Add inline pending attachments and user bubbles using the existing Makelore visual system. Integrate committed thinking increment from ad1d2f2→4160119 without reverting the current chat/composer/layout. Shrink own Agent list cards to about two-thirds of their former desktop dimensions, retaining usable controls. Update the currently logged-in temporary application with this and inherited Agent/channel changes.
## Intent And Constraints
- User explicitly authorizes UI implementation and temporary-app refresh; product language throughout. Configuration remains editable from cards; chat identity is read-only because save/apply controls are removed there. Retain published/preview request identities, recovery, Run/approval/cancellation, existing history and creator billing semantics. Files use Main-owned upload/confirm operations, removal from the composer deselects rather than deleting cloud data. No live model calls, user-file uploads or WeChat operations for verification.
- Isolated feature writes only own source/tests/README/task record and new ignored runtime stage. Prior approved channel/sidebar/config/chat ancestry retained. Do not copy uncommitted peer source or change auth/profile/Main/runtime contract as incidental UI work.
## Project Context Loaded
Task context:
- Task: 20261012-agent-chat-composer-42b8f6d1, Feature, owner codex.
- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20261012-agent-chat-composer-42b8f6d1.
- Branch: codex/20261012-agent-chat-composer-42b8f6d1-agent-chat-composer.
- Base/HEAD at gate: 7af43acebb5d8b118fa16c838dfba2f18e535bb1. Bundled check/start/status passed and exact registry identity independently checked.
- 40 peer records read only: 39 specific, one old undefined child-language record. No blocked semantic dependency. At the original gate thinking task 20261012-cloud-agent-thinking-76a89e3d remained planning without a deliverable; a later explicit delegation now supplies committed 416011943ea306fa0336d044c8a328e500034c01 and requests its thinking-only increment from ad1d2f2. Commit and record read; semantic three-way integration preserves this task’s layout, attachments and generation guards. No uncommitted peer source read/copied.
Read:
- AGENTS, read-before-planning, memory index, own record, positioning/current integrated snapshot, decision index, system overview/community collaboration, domain/success criteria, personal-cloud-agent ADR, evidence/reflection/commitment indexes. Large integrated historical snapshots read with targeted current/relevant sections; historical UI descriptions defer to this explicit user direction.
- CloudChat, DraftEditor, CloudFiles, local chat CSS, typed attachment APIs and Main upload boundary; focused unit and Electron specs. Design skill search reviewed, adapting only accessible progressive disclosure to existing cream/pastel/orange palette, not its suggested new font/pink/motion scheme.
Relevant understanding:
- Client supports students/creators and personal Agents; no courses. Main owns network/auth/upload, Yuxi owns cloud requests/history and WS owns billing. Removing visible billing/version copy does not alter payment or execution.
- User wants a calm conversation page without configuration/management toolbars; the list card remains the configuration entry. Preserve loaded conversation and approvals while simplifying presentation. Image/file picking uses the existing native upload boundary; do not fake image URLs or bypass Host API.
- Current temporary Main PID63739/Host62867, bootstrap Entry Trial, renderer from verified WeChat task d823ddb. New stage must explicitly understand its live dist symlink and preserve the prior renderer for rollback. Final source clean commit/build/Main byte checks plus actual visible CUA verification required.
- Likely files: DraftEditor, CloudChat/local CSS, new attachment-composer component, focused checks/README/own record. Canonical docs read-only, feature promotion proposals only. No unresolved product conflict.
Gate result:
- Passed.
## Plan
1. Separate chat identity from configuration controls, remove source/management toolbar from published chat while retaining preview-only maintenance behavior used elsewhere.
2. Integrate file/image picking, pending file cards and safe per-message removal inside the composer; user messages use distinct rounded bubbles. Keep loading/errors/running/approval and safe send/retry behavior.
3. Run relevant unit, typecheck/scoped lint/build and production Electron checks at large/compact sizes. Commit the clean reviewed result, refresh the known trial renderer with rollback and verify the visible updated conversation; record actual evidence and limits.
## Outcome
- Published chat has read-only saved identity and return control. Configuration status/actions, source tabs, routine billing/version title and published history/new-chat controls are removed; card adjustment entry and explicit save/apply behavior remain.
- User messages use lilac bubbles. The composer directly adds native-picked files/images, shows pending cards and deselects without deleting. Remote confirmation failures preserve uploaded object/thread/method for explicit retry. Pending confirmation blocks sending; attachment-only input uses the explicit query “请看看这些附件。”. No fabricated image URL contract or new Main endpoint.
- Preview maintenance controls retain safe behavior; attachment createThread late responses cannot change a newer Agent/thread. Requests, version binding, history recovery, approval and stop boundaries remain.
- Home cards measured at 1440px from 386.7×323.5 to 256×221 (66.2% width, 68.3% height); 48px avatar and 44px operation targets, no transform scaling. Narrow windows adapt, longer descriptions clamp to two lines.
- Committed thinking-only increment from ad1d2f2→4160119 integrated without older layout changes. Separate reasoning block, exact Run/main-thread filtering, replay deduplication and bounded final-history hydration preserved. Added explicit execution epoch for same-Run approval continuation and guarded late approval callbacks; no cross-view overwrites. Durable history depends on the Yuxi API patch not yet deployed.
- Temporary application refresh pending clean source binding and background activation. Native activation/clicks stopped after latest no-focus direction; visible reload will be handed to the user.
## Verification
- Pinned pnpm typecheck passed; scoped source/test lint passed with two pre-existing CloudChat warnings (export/cleanup-ref), no errors. git diff --check passed.
- Delegated relevant page/start-use/workflow tests: 61 passed. Attachment component tests: 14 passed. Root ran entry-navigation/avatar/guidance/management: 28 passed.
- Browser layout fixtures: 10 passed at 375/768/1024/1440, long Markdown independently scrolls; inline image-type cards, deselection, approval and stop verified. Root viewed desktop inline attachment and compact bubble screenshots; adjusted compact send alignment to right.
- Card fixture measurements and screenshots inspected at 375/768/1024/1440, no overflow or operation wrapping, long/empty introduction handled.
- Final combined production Vite renderer/Main/preload/utility compile passed. Combined reasoning/stream tests: 14 passed including same-Run continuation and late approval replies; combined workflows 21 passed, headless layout 12 passed (includes two reasoning scenarios). Root viewed compact live reasoning screenshot and confirmed readable content/composer.
- Before the added no-focus constraint, the production Electron identity/configuration/chat spec passed; the old channel spec failed because it still required the intentionally removed WeChat conversation tab. That spec was adapted to current binding UI and linted, but the combined reasoning and adapted channel Electron specs were not rerun because the fixture launches a visible window. This limit is explicit; no production/backend/real-provider claims. No actual uploads, model calls or WeChat mutations performed.
- Read-only native observation after the no-focus direction showed the known logged-in trial on its Agent list with no pending editor/composer. No activation, desktop click or credential/profile read.
## Follow-ups
- None recorded.
## Promotion Candidates
- Update current personal Agent presentation documentation at integration: published conversation contains identity/transcript/composer only, pending attachments are per-message deselection, recent history continues automatically; home cards use compact 256px desktop width.
- Thinking-only increment of committed 4160119 is now integrated; history recovery depends on Yuxi committed 7b16aef deployment by its owner. No production deployment performed; current stage requires final combined verification. User requests no desktop focus capture during the remaining verification/update; native UI actions are paused and renderer update must stay background.