8.2 KiB
8.2 KiB
Task: Show a local empty state without invoking the Agent when no work exists
Identity
- Task ID: 20260929-empty-work-preview-9c3f72a1
- Mode: Feature
- Branch: codex/20260929-empty-work-preview-9c3f72a1-empty-work-preview
- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20260929-empty-work-preview-9c3f72a1
- Base commit:
077184aaba - Owner: codex
- Status: Ready for Integration
Scope
- Show a deterministic local empty state when the project has no work to preview, before creating an operation conversation or sending OPEN_WORK_PROMPT. Preserve preview restoration, existing-work startup, busy waiting and failure recovery.
Intent And Constraints
- User approved implementation after read-only evaluation. Empty copy: “还没有作品,快和老师聊聊吧”. No Yuxi quick-prompt implementation, cloud publication, model calls, app replacement or main-branch merge is included in this change.
- Concurrent and Planning Gates passed. App worktree tool reported the parent workspace is not a Git repository; used the skill isolation fallback at main
077184a. Matching task reservation/worktree owner verified. - Read AGENTS, entry/memory/planning gate, active task, positioning, integrated state, decisions, architecture, domain, success criteria, evidence and relevant scaffold/teacher decisions. Peer scopes reviewed; teacher-help-label/release and child-language-skill are active (the latter scope undefined), with no concrete dependency. Completed teacher presence owns historical preview behavior; this user's explicit request authorizes the no-work exception. Canonical memory partly predates current README/code and remains read-only.
- Plan: add a bounded conservative Main-owned work-presence check; return an empty result before conversation creation/submission; render exact local copy; verify real filesystem absence/asset-only and existing-work paths, UI and existing preview lifecycle; update README and this record.
Outcome
- Implemented a Main-owned bounded names/types scan before any conversation creation or internal prompt submission. New/metadata/knowledge/material-only projects return
empty; unknown formats, unreadable directories, links and scan bounds retain the existing startup path. Known reachable pages still bypass the scan. Presence is rechecked after reopening and is not cached as a terminal attempt. - Added the
emptypreview result and exact local copy “还没有作品,快和老师聊聊吧”. No model call, added chat message, recovery button, technical error or background polling for the empty state; retained return-to-operation-chat action. A later host show event rechecks the same request so newly opened work appears without tab/focus changes. - Existing work startup, busy-project waiting, known-page restoration, failure recovery and uncertain-request deduplication are preserved. README synchronized. No cloud configuration, installed app, live project data or main branch changed.
Verification
corepack pnpmverified at the repository-pinned 10.33.4; reused local dependency tree through an ignored node_modules symlink.- 125 related unit tests passed across work presence/preview, browser routes/panel, hook, coding chat and conversation timeline. Independent review found the empty-to-host-show edge case; added a failing regression, fixed it, and reran all 26 panel/hook tests successfully (one additional unique regression).
- 10 isolated headless Chrome layout/E2E cases passed, including exact empty copy, no failure/retry UI, no teacher auto-open, and no checks over 60 seconds. Inspected the generated empty-state screenshot. No real Electron focus change or paid model requests.
- Final standard
pnpm run typecheck, scoped ESLint,pnpm run build:viteandgit diff --checkpassed. Extended Maintsc --project tsconfig.node.json --composite false --incremental false --noEmitreports the same 66 error signatures as clean main at 077184a; no added diagnostics. - Independent review of scanner boundaries and complete change passed after fixing and verifying the host-show regression. Task documentation drift check passed.
Follow-ups
- Source is ready for integration. The existing temporary app was updated under the later explicit request below; main-branch integration and formal installed-app replacement remain outside scope.
Promotion Candidates
- Target: canonical Code preview behavior/architecture during later serialized integration. Record that confirmed empty/material-only projects render a local empty state before creating a conversation or dispatching OPEN_WORK_PROMPT, while existing/uncertain work retains startup and healthy-address recovery. Evidence: user approval, Main side-effect assertions and UI regressions. Future impact: prevents browsing empty projects from adding operation-chat context or consuming model calls. This narrows the older always-start-on-missing-URL behavior; user approval is already supplied. No canonical documents changed in this feature task.
Follow-up: Update The Existing Temporary App
- User explicitly requests updating the temporary application. Same-task ownership resumed and verified; current context remains applicable. Read the current live trial publisher's task record and launch metadata; that chat is idle. No cross-chat messages sent.
- Current trial is PID 19053, Main/Renderer
ead3407890with index-BiMeMtQo.js, same trial bundle/profile/Host API 54599. It includes newer welcome UI, teacher dock toggle, help label and timestamps that must be preserved. Formal /Applications/Makelore.app is separate and untouched. - Planning Gate passed. Prepare a generated source export of the exact current live commit, apply only this feature's product/tests patch, verify and build. The foreign source checkout remains read-only. Recheck manifest and actual active work before mutation; capture state, gracefully stop only the verified trial PID, back up its profile, relaunch the same bundle/profile/port in the background, then verify preservation and live empty behavior without model calls.
- Updated the live trial using a generated full source export of
ead3407890plus product/test changes from0167d36. The E2E addition was adapted to the newer fixture while retaining its existing cases. Candidate build, typecheck, scoped lint, 140 unit tests across eight files and all 14 isolated headless layout cases passed. No foreign checkout was edited. - Live source/build:
/var/folders/mx/ltbgwsks5_n8zllj69p_wbcw0000gn/T/makelore-trial-tdq_nuah/empty-work-preview-9c3f72a1/source. Verified trial PID 19053 was idle, then gracefully quit; copied its full user-data profile before starting PID 23355 with the same bundle/profile and Host API port 54599. New Main module and Renderer assetindex-OKXW93my.jsare loaded. Launch metadata records the base plus feature overlay explicitly, rather than claiming a combined Git commit. - Account restored through the normal auth store
init()and Main-owned session. Same active project, selected teacher and open teacher dock retained; all 14 existing drafts and all 34 previously recorded conversation/runtime files are byte-identical. One new idle-worker extension metadata file is expected after startup. Help-label UI and 15 rendered timestamps verified. No prompts/model requests were dispatched by the update; no existing project was switched for testing. - Window remains hidden and unfocused as before. After restart the client stays on its default operation-chat tab: the current project has possible work, so reopening preview solely for verification would invoke the existing startup path. Empty-state behavior is verified by isolated Main/unit and headless UI tests, not by prompting or switching a live project. Temporary inspector closed; formal
/Applications/Makelore.appPID 16701 untouched. - Verification and rollback evidence:
/var/folders/mx/ltbgwsks5_n8zllj69p_wbcw0000gn/T/makelore-trial-tdq_nuah/empty-work-preview-9c3f72a1/verification.json; profile backup, prior launch manifest, source patch and build/test logs are alongside it. Keep this generated source while the trial uses it. No main merge, push, Yuxi shortcut implementation or formal-app publication was performed.