Commit 6d1b06bc authored by AI-甘富林's avatar AI-甘富林

docs: update frontend refactor progress and editing guardrails

parent 5dfc7760
...@@ -56,6 +56,18 @@ When editing `apps/ui/src/App.tsx` and `apps/ui/src/styles.css`, keep the render ...@@ -56,6 +56,18 @@ When editing `apps/ui/src/App.tsx` and `apps/ui/src/styles.css`, keep the render
- Be careful with Chinese text encoding in UI files. Avoid introducing BOM or accidental encoding changes when patching `App.tsx`, `styles.css`, or other renderer text files. - Be careful with Chinese text encoding in UI files. Avoid introducing BOM or accidental encoding changes when patching `App.tsx`, `styles.css`, or other renderer text files.
- For UI skeleton changes, validate with `corepack pnpm typecheck` and `corepack pnpm build`, and manually confirm chat, experts, plugins, and settings still render with correct height and scrolling behavior. - For UI skeleton changes, validate with `corepack pnpm typecheck` and `corepack pnpm build`, and manually confirm chat, experts, plugins, and settings still render with correct height and scrolling behavior.
## Chinese Encoding Safety
When editing `apps/ui/src/App.tsx`, avoid whole-file rewrites. This file contains Chinese UI copy and has previously been corrupted by PowerShell encoding conversion.
- Prefer `apply_patch` for small targeted edits.
- Do not use `Set-Content`, `Out-File`, or raw `WriteAllText` on `App.tsx` unless explicitly writing UTF-8 without BOM and after checking the diff.
- After edits, verify the file does not start with UTF-8 BOM bytes `239,187,191`.
- Inspect `git diff -- apps/ui/src/App.tsx` before validation; Chinese text must not become mojibake or `�`.
- If Chinese text is corrupted, compare against the already pushed version with `git show HEAD:apps/ui/src/App.tsx` or the target remote branch, and restore only the corrupted text/sections.
- If corruption is widespread, restore `App.tsx` from the pushed version first, then reapply intended logic changes as small patches.
- Always run `corepack pnpm --filter @qjclaw/ui typecheck` after touching `App.tsx`.
## Response Style (Strict Rules) ## Response Style (Strict Rules)
You MUST follow these rules: You MUST follow these rules:
......
...@@ -173,6 +173,26 @@ Verified in the latest local acceptance pass: ...@@ -173,6 +173,26 @@ Verified in the latest local acceptance pass:
- smoke confirms the packaged Python payload contains the 9 locked dependencies - smoke confirms the packaged Python payload contains the 9 locked dependencies
- smoke confirms runtime telemetry records heartbeat, config sync, and accepted runtime cloud events - smoke confirms runtime telemetry records heartbeat, config sync, and accepted runtime cloud events
### 3.9 Frontend refactor progress
Completed in the current frontend refactor pass:
- sidebar composition is extracted from `App.tsx` into `apps/ui/src/features/shell/AppSidebar.tsx`
- `AppSidebar` now composes `Sidebar`, `ExpertTree`, and `SessionList`
- expert category config and matching logic now live in `ExpertTree`
- `App.tsx` no longer inlines sidebar nav, expert tree, or session list JSX
- confirmed-unused legacy sidebar/expert CSS rules were removed
- current `App.tsx` size is about 4178 lines, so the sidebar split is complete but further reduction is still needed
Verified:
- `corepack pnpm --filter @qjclaw/ui typecheck`
- `corepack pnpm build`
- `corepack pnpm smoke:settings`
- `corepack pnpm smoke:default-chat`
- `corepack pnpm smoke:desktop-session-switch-stream`
- `corepack pnpm smoke:desktop-expert-bootstrap-ui`
## 4. Current Product Decision ## 4. Current Product Decision
The current Stage D product decision is: The current Stage D product decision is:
...@@ -281,3 +301,28 @@ When work resumes next time, start here: ...@@ -281,3 +301,28 @@ When work resumes next time, start here:
## 9. Current One-Line Status ## 9. Current One-Line Status
Current status: installer, bundled runtime, preinstalled Python payload, runtime cloud config, heartbeat, events, config sync, and runtime telemetry are all working; the app can now auto-fetch OpenClaw runtime config from user-bound employee `api_key`, start bundled runtime, report cloud heartbeat/events, and export diagnostics, but Stage D is still incomplete until broader runtime hardening, product-side cloud APIs, and wider real-world acceptance are finished. Current status: installer, bundled runtime, preinstalled Python payload, runtime cloud config, heartbeat, events, config sync, and runtime telemetry are all working; the app can now auto-fetch OpenClaw runtime config from user-bound employee `api_key`, start bundled runtime, report cloud heartbeat/events, and export diagnostics, but Stage D is still incomplete until broader runtime hardening, product-side cloud APIs, and wider real-world acceptance are finished.
## 10. 2026-05-07 Frontend Refactor Follow-Up
Completed:
- removed `resolveExpertVisualKey` and `buildShortcutPrompt` from `AppSidebar` / `ExpertTree` props; `ExpertTree` now imports the pure helpers directly
- added `ConversationWorkspaceView` to own the chat/expert workspace display composition while keeping stream, composer, session, and smoke logic in `App.tsx`
- moved workspace status chip derivation into `features/shell/startupStatus.ts`
- reduced `App.tsx` to 2672 lines without changing smoke action shapes
Skipped intentionally:
- did not wire `useChatSessionsController`; current local session flow has subtle active-session reset behavior that should be reconciled separately
- did not delete CSS; duplicate selector areas are in the frozen conversation/final theme layers and were not safe to trim in this pass
Verified:
- App encoding check: first bytes `105,109,112`, no UTF-8 BOM
- `rg -n "�" apps/ui/src/App.tsx apps/ui/src/features apps/ui/src/lib`
- `corepack pnpm --filter @qjclaw/ui typecheck`
- `corepack pnpm build`
- `corepack pnpm smoke:default-chat`
- `corepack pnpm smoke:settings`
- `corepack pnpm smoke:desktop-session-switch-stream`
- `corepack pnpm smoke:desktop-expert-bootstrap-ui`
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment