fix: isolate settings and unify account controls with Code

This commit is contained in:
鲨鱼辣椒 committed 2026-10-13 15:15:27 +08:00
1 parent 430233f825
commit 2cc542f1f8
32 files changed
+759 -1091

No files matched your search

@@ -15,7 +15,22 @@
- Assemble and validate completed homepage and Agent changes, then update the existing local temporary application with both Main and Renderer while retaining its profile and login.
- Keep the current temporary application as the target; no production backend deployment, repository push, primary checkout change or worktree cleanup.
- Follow-up: restore access to the existing account controls on the standalone module homepage and update the current trial.
- Latest follow-up: restore the desktop title-left / three-card vertical layout with the Code card centered on the title; retain Robot hiding and account controls.
- Latest follow-up: independent Settings without Code workspace chrome, explicit return to the entry module, and shared Code account appearance/position across homepage and modules. Retain three vertical cards, title displacement, Robot hiding and latest deployed knowledge/recovery changes.
## Independent Settings / Shared Code Account Follow-up · 2026-10-13
- Concurrent / Planning Gates: Passed in the same active task. Exact feature/planning owner, branch, worktree and base verified after interruption; current task/source reread, unchanged startup/domain/accepted-decision context retained. Read-only peer review found no Settings/MainLayout/account ownership or semantic conflict; recovery/knowledge/Canvas contracts and source records remain untouched. An active knowledge task may update the Renderer later, so rebind actual current metadata before deployment.
- User reports /settings inherits Code sidebar/collapse and has no back action; source confirms ProtectedLayout always renders MainLayout, whose getAiModuleForPath fallback returns programming for settings. Keep the existing authentication/setup guard, render settings through an independent shell without workspace sidebar/project context/collapse, and add explicit back navigation to a validated originating local route with full query/hash; direct access falls back to module homepage.
- Latest account instruction supersedes the earlier half-width/full-scale interpretations: all existing account triggers should match the pictured Code design and screen corner placement. Reuse one pure display trigger (Code default 150x42, 28px avatar/12px text/14px right chevron, white card/11px radius/current border), derive expanded width from the Code sidebar preference, keep collapsed avatar access, preserve wallet/profile/logout/menu lifecycles and account isolation. Standalone home/settings docks use Code's 10px left / 12px bottom inset; keep prior title right shift, equal card layout and Robot hiding.
- Plan: root owns local settings-return helper, Settings shell/back/leave protection, MainLayout branch, TitleBar native inset, standalone account dock, module footer positioning and README/task record. Display subtask owns shared trigger and Home/Sidebar adoption with narrowly scoped Code CSS; test subtask owns focused display/interaction verification. No Main/backend/settings-write contract or production deployment change.
- Verify local origin sanitization/back routing, no settings sidebar/collapse/project chrome, saved/unsaved leave behavior, native traffic-light safety, shared trigger geometry across homepage/settings/Code/Agents/Canvas and compact/collapsed accessibility. Run relevant units/type/lint/build and isolated Electron scenarios/screenshots. Stage final Renderer against fresh current source with byte-identical Main/resources/package, preserve live route/login/profile/focus and no real setting/account/purchase/chat changes.
- Current application remains a9fa221 over unchanged Main7c/PID9968/58003. Width-only 430233f was committed/verified but intentionally not deployed after this steering; no home-width snapshot or runtime mutation occurred.
- Source implemented: independent Settings shell/back with validated local full-origin routing, proxy dirty/saving application-navigation and beforeunload protection, Mac traffic-light inset, one shared account display trigger and standalone dock. Canvas compact layout now has the same account access and reserves its bottom space; duplicate automatic profile completion is suppressed only in that compact dock. Update button moved above the account row so it cannot squeeze its width. Existing auth/setup/profile/wallet/logout and updater contracts retained.
- Independent final review passed: Settings early return follows all hooks; ProtectedLayout stays; local origin sanitization rejects settings/self/external/unknown paths; dirty navigation cannot discard drafts; profile sync is deduplicated per account and only Sidebar enforces Canvas completion. Native inset leaves overlay/fullscreen behavior unchanged.
- Fresh runtime binding advanced to committed knowledge layout 2d4e44f4a023fc649d9064d4413284fbeb962d59. Read its task Scope/Intent/Promotion and verified no semantic conflict. Preserved its exact a9-to-2d delta across 11 source/test paths (including removed picker/tests), combined only the knowledge README paragraph, imported no foreign/canonical documents. Product difference against latest runtime remains this Settings/account scope. Old one-run input-clearing authorization from that peer is not inherited.
- Verification so far: 15 focused unit files / 154 tests passed across Settings/account/module/profile/wallet and retained knowledge flows; final assembled typecheck, scoped ESLint and complete build passed. All 8 dist-electron files, 57 resources and package bytes exactly match original running Main. Homepage four-width geometry and Settings proxy/admin/back/dirty fixture passed; knowledge five scenarios passed at 375/768/1024/1440 and desktop/mobile screenshots visually checked. Account cross-module scenario is undergoing fixture stabilization; no runtime activation yet.
- Account fixture observations: first comparison sampled a sidebar node replaced during lazy workspace mounting; now polls the same full exact geometry assertion. Repeated missing fake-account mount was traced to real Main did-finish-load auth-session push racing the fixture's mocked IPC/session storage. Fix confined to the isolated fake-session event boundary and a single reload; product authentication remains unchanged. Final deterministic result recorded below when complete.
- Final account Electron scenario passed once with retries disabled (5.8s), including full wallet/profile/logout fixture behavior, exact shared dimensions/styles across Code/Agents/Canvas/Home/Settings, origin-query restoration and 375px Canvas/Home/Settings. Its Code bootstrap returns real empty-array/catalog schemas so no fixture-induced page crash is mistaken for geometry failure. Root visually inspected desktop home/Code plus 375px Settings/Canvas screenshots; return, account menu and viewport placement are correct. Final test lint/typecheck pass; no further product rebuild required for fixture-only edits. All eight relevant UI scenarios passed across assembled product; historical unrelated Code inner-tab assertion remains outside this change.
## Homepage Position / Compact Account Follow-up · 2026-10-13
@@ -127,3 +142,5 @@
- Current-state / success criteria: the module homepage now exposes the same existing balance/recharge/profile/settings/logout functions as the module sidebars, with keyboard/close behavior, account isolation and persistent wallet lifecycle. Evidence: source 5f7c851, focused tests/fixture screenshots and verified live renderer overlay; no new billing/auth contract or contradictory decision.
- Current-state / homepage layout: user explicitly replaces the desktop side-by-side cards with left title and right vertical image-left card stack. Code center aligns with h1 center; smaller windows place title above the stack. Evidence: source 383ce71, four-width geometry/screenshots and actual 1470px live proof. Account controls, Robot hiding and module permissions retained; no unresolved semantic conflict or further confirmation required. Promote only in a separate integration gate.
- Current-state / global account and Settings: Settings has its own authenticated shell without module workspace/collapse/project chrome and explicit full-origin return; all existing account triggers share Code appearance and 10px-left/12px-bottom placement, with compact Canvas access. Evidence: latest user screenshots/instructions, isolated return/dirty/profile/wallet and geometry verification; no auth/billing/Main contract change. This supersedes only the intermediate half-width/half-scale account interpretation. No contradictory accepted direction or additional human confirmation required; promote only in Integration Gate.