Commit Graph

26 Commits

Author SHA1 Message Date
OG T
a0f3a7d532 feat(web): S6 OpenClaw AI Terminal + 狀態數據 — Sprint 5R
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 13m15s
- 分隔線下方新增:模型名稱 + 運行狀態
- 即時統計:今日分析數 / 成功率 / MTTR
- AI 推理終端:#141413 背景 + #a0e8a0 螢光綠 + JetBrains Mono
- 最後一行黃色閃爍游標 ▎
- 資料來源:/api/v1/alert-operation-logs + /api/v1/stats/disposition

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 15:56:03 +08:00
OG T
246587a401 fix(web): Sprint F 前端打假行動 — 29處假數據全面清除 (首席架構師 98/100)
P0: Neural Command 三個子組件移除所有 MOCK 常數,接上真實 API props
- NeuralLiveCenter: 假歷史/假KPI/假雷達 → 從 stats/history/incidents 即時計算
- NeuralStats: MOCK_HISTORY/SCHEME_STATS/PLAYBOOK_RANKINGS → useMemo 聚合
- NeuralApprovalPanel: MOCK_PENDING → 真實 /api/v1/approvals 簽核操作

P1: 10+處假用戶身份 (demo-user/user-001/War Room User) → CURRENT_USER 常數統一
P2: 刪除 6 個 Demo 匯出 (GlobalPulseChartDemo/MOCK_APPROVAL/DEMO_DECISION_CHAIN)
P3: /demo 頁面加 NEXT_PUBLIC_ENABLE_DEMO 環境變數保護
i18n: 新增 22 個翻譯鍵 (zh-TW + en)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:53:52 +08:00
OG T
cbe528b5c6 feat(ui): header/sidebar/openclaw 完整對齊 figma-v2
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 6m57s
- 移除 OpenClaw "AWOOOI v1.0.0 | 正式環境" header
- 語言按鈕標籤改為 繁/EN (pill 樣式)
- header/sidebar 視覺對齊 figma-v2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 11:36:38 +08:00
OG T
e9a1ac6276 fix(ui): 對齊 figma-v2 設計稿 — IncidentCard + OpenClawPanel 視覺修正
Some checks failed
CD Pipeline / build-and-deploy (push) Failing after 35s
IncidentCard:
- 背景 #fff、圓角 12px、頂邊條 4px(對齊設計稿)
- P1 嚴重度色修正為 #F59E0B(amber,非 orange)
- Severity badge 改為 4px 圓角 uppercase 樣式
- Impact 指標列移除灰底方塊,改為細邊框分隔線
- AI 提案按鈕改為全寬居中橙色風格

OpenClawPanel:
- 移除多餘 rounded-xl/backdrop/border(由父層卡片容器提供)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 23:36:59 +08:00
OG T
93e3aa6811 feat(ui): 四種嚴重度管線動畫 + WoooClaw 命名更新
Some checks failed
E2E Health Check / e2e-health (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
- flow-pipeline.tsx: 新增 severity prop,四種管線樣式
  - P0 → Style A: 脈衝光波 + 流動光效 (#cc2200)
  - P1 → Style B: 進度條,龍蝦站在進度端點 (#F59E0B)
  - P2 → Style C: 卡片步驟,龍蝦浮在 active 卡片上方 (#4A90D9)
  - P3 → Style D: 時間軸,虛線流動動畫 (#22C55E)
- incident-card.tsx: FlowPipeline 傳入 severity={sev}
- openclaw-panel.tsx: NemoClaw→WoooClaw, OpenClaw Pipeline→WoooClaw Pipeline

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 21:18:22 +08:00
OG T
4d46e6b9a7 style(web): 全站 font-mono → font-body (DM Mono 設計系統套用)
Some checks failed
E2E Health Check / e2e-health (push) Successful in 17s
CD Pipeline / build-and-deploy (push) Has been cancelled
45 個 component + 6 個 page 統一從舊 font-mono 遷移到
font-body (DM Mono),確保設計系統一致性。

font-body = DM Mono (等寬),視覺效果相同但走新設計 token。
保留: font-heading (Syne)、font-dot-matrix (VT323/DSEG7)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 09:37:03 +08:00
OG T
3ecfe7b3f5 chore: 清理 NemoNodeAnimation 殘留 + 修復 Migration YAML
Some checks failed
E2E Health Check / e2e-health (push) Successful in 19s
CD Pipeline / build-and-deploy (push) Has been cancelled
- 移除 nemo-node-animation.tsx (無人引用,已被 NemoClaw 取代)
- Migration YAML: 修復 $$ 在 YAML heredoc 被 shell 解析問題
  改用單引號字串 DO '' 語法

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 09:09:25 +08:00
OG T
e17248fd10 fix: 首席架構師審查修復 — i18n/CD/時區/死碼清理
Some checks failed
E2E Health Check / e2e-health (push) Successful in 16s
CD Pipeline / build-and-deploy (push) Has been cancelled
P0 前端 i18n 合規 (6 檔案):
- settings/page.tsx: 全面改用 useTranslations('settings')
- auto-repair/page.tsx: 30+ 處硬編碼改用 t('autoRepair.*')
- sidebar.tsx: sectionLabel 改用 tSection(),aria-label 國際化
- openclaw-panel.tsx: STATUS_MESSAGES 改用 tPanel(),Production 改用 tBrand
- alerts/page.tsx: StatPill label 改用 t('incident.severity.*')

P1 CD Pipeline:
- cd.yaml: runs-on 改 self-hosted (ADR-039)
- Telegram Secret 注入失敗改為 exit 1 (ADR-035)
- kubectl patch op:replace → op:add (首次部署相容)

P2 後端:
- langfuse_client.py: 移除 v4.x 死碼分支 (SDK 鎖定 <3.0.0)
- ai.py: 標記 TODO(R4) Router 瘦身

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 09:02:41 +08:00
OG T
5959855a71 feat(web): 字體系統升級 + NemoClaw SVG 還原 + Knowledge Base 設計文件
Some checks failed
E2E Health Check / e2e-health (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
- 字體:Syne (標題) + DM Mono (內文) + VT323 (品牌點陣),替換 Inter
- Tailwind: fontFamily 更新 + 5 層文字色彩 token (primary→disabled)
- Sidebar: NemoClaw 白瓷龍蝦爪 SVG + AWOOOI 用 VT323 放大
- OpenClaw Panel: 還原 NemoClaw 3D 白瓷龍蝦爪 (替換 NemoNodeAnimation)
- Knowledge Base 設計文件 (B分離/A K8s Job/Phase1跳過向量搜尋)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 00:48:42 +08:00
OG T
48d89a1a91 style(font): 系統性字體升級 — 對齊業界標準 Linear/Vercel/Anthropic
Some checks failed
E2E Health Check / e2e-health (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
- openclaw-panel: 11/9/8px → 13/12/11px
- sidebar: nav 13→14px, badges 11→12px, bottom 12→13px, icons 14→15px
- page.tsx: metric labels 11→12px, section headers 12→13px
- incident-card: 11px 全面升 12px, meta 12→13px

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 22:15:35 +08:00
OG T
0ae210a433 fix(ui): sidebar font sizes to standard + remove dead NemoClaw SVG from openclaw-panel
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 6m47s
E2E Health Check / e2e-health (push) Successful in 17s
2026-04-01 21:24:52 +08:00
OG T
beb6a227db feat(ai): replace dragon arm SVG with NemoNodeAnimation in OpenClawPanel
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 20:05:18 +08:00
OG T
354bf7a6f2 feat(ai): add NemoNodeAnimation 72x72 SVG with orb-pulse and ring-spin 2026-04-01 19:50:05 +08:00
OG T
589f2fc4c7 fix(web): openclaw-state-machine 補上 CSRF Token (P0 根本原因)
All checks were successful
E2E Health Check / e2e-health (push) Successful in 15s
根本原因: 首頁用的是 openclaw-state-machine.tsx 而非 LiveApprovalPanel
該元件的 handleApprove 完全沒有 CSRF token 和 credentials: include
導致後端回傳 "CSRF token cookie missing" → 按鈕沒有任何反應

修復:
- import useCSRF hook
- handleApprove 加上 X-CSRF-Token header
- fetch 加上 credentials: 'include'
- useCallback deps 加上 csrfToken

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 21:50:34 +08:00
OG T
eaca7199c2 fix(web): Phase 22.4 移除 ClawBot 舊檔案與命名殘留
- 刪除 clawbot-panel.tsx (已被 openclaw-panel.tsx 取代)
- 刪除 clawbot-state-machine.tsx (已被 openclaw-state-machine.tsx 取代)
- 修正 hitl-section.tsx: setClawbotStatus → setOpenClawStatus
- 符合 feedback_openclaw_naming.md 命名鐵律

Phase 22.4: 命名清理 

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-31 12:12:30 +08:00
OG T
2e9ccf4a26 fix(lint): 清理所有 ESLint 警告 (61→0)
- 修復未使用變數 (prefix with _)
- 修復 type-only imports
- 修復 react-hooks/exhaustive-deps (useMemo + 依賴補齊)
- 修復 no-explicit-any (eslint-disable 標記)
- 移除未使用的 imports

涉及組件:
- demo/page, layout, page (主頁面)
- ai/* (OpenClaw, HITL, ThinkingStream)
- approval/* (ApprovalCard, LiveApprovalPanel)
- dashboard/* (HostCard, LiveDashboard, ConnectionStatus)
- incident/* (DualStateIncidentCard, ThinkingTerminal)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-29 17:06:58 +08:00
OG T
c5db6520c8 perf(web): P1 前端優化 - 移除 Polling + CSS Cursor Blink
Phase 8.0 #15-17 前端效能優化:

#15 Sidebar Polling → SSE:
- 移除 30s setInterval polling
- 改用 useApprovalStore SSE 驅動的 pendingApprovals
- 新增 mounted check 防止 hydration mismatch

#16 Cursor Blink DOM Bypass:
- thinking-stream.tsx: setInterval → animate-pulse
- ai-thinking-panel.tsx: 移除 cursorVisible state
- clawbot-panel.tsx: 移除 cursorVisible state
- openclaw-panel.tsx: 移除 cursorVisible state

#17 Hydration Fix:
- sidebar.tsx badge 加入 mounted check

結果: -46 行代碼 (移除不必要的 setState/setInterval)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-29 15:09:44 +08:00
OG T
7b9b0c490b feat(phase19): Omni-Terminal 100% 完成 + 首席架構師審查 47/50
## Phase 19 Omni-Terminal (Wave 0-6 全部完成)

### 核心功能
- SSE 狀態機 (7-State 設計,10/10 分)
- GenUI 動態渲染 (6 張卡片 + Zod Schema 驗證)
- 核鑰 UX (長按授權 + 風險分級)
- Terminal Telemetry (Sentry 整合)

### P0-P2 修復
- P0: Singleton → FastAPI Depends 依賴注入
- P1: Zod Schema 升級 (7 個驗證 Schema)
- P1: 錯誤分類碼聚合 (Sentry fingerprint)
- P2: Slow Query 監控 (5s 警告 / 10s 嚴重)

### 測試
- test_terminal_service.py: 54 項測試全通過
- 意圖分類: 42 個測試案例 (9 種 IntentType)

### 文檔
- ADR-031: SSE 架構實作紀錄
- ADR-032: GenUI 渲染實作紀錄
- Skills: v1.9 (後端 Terminal 章節)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-28 18:04:12 +08:00
OG T
b79e5f1a1a fix: Telegram HTML 解析錯誤 + 簽核後內容保留
修復:
1. telegram_gateway.py - HTML 轉義 (html.escape) 防止 "Can't parse entities"
2. openclaw-state-machine.tsx - 簽核後顯示結果 2 秒再導航

問題根因:
- URL 和用戶輸入內容可能包含 <, >, & 破壞 HTML
- 簽核後立即刷新列表,已簽核項目消失

Memory: feedback_approval_preserve_content.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 15:32:23 +08:00
OG T
505ceab895 fix(web): 審核完成後正確導航到下一張卡片
問題: handleApprove 是異步的,但 setSelectedIndex 不等它完成就執行

修復:
1. fetchPendingApprovals 返回新的審核數量
2. handleApprove 返回 newCount
3. onApprove 使用 await 等待完成後,根據 newCount 決定導航
4. newCount > 0 且 index 有效: 保持 Modal 開啟顯示下一筆
5. newCount = 0: 關閉 Modal

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 14:02:41 +08:00
OG T
875238321e fix(web): 審核 Modal 真正全屏 - Portal 渲染到 body
修復:
1. 使用 createPortal 渲染到 document.body
2. z-index 提升到 9999 確保最上層
3. ApprovalCard 新增 fullHeight prop 移除高度限制
4. 移除巢狀 div 避免滾動衝突

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 13:43:11 +08:00
OG T
540602fd63 fix(web): Phase 17 審核卡片 UI/UX 修復 - SlidePanel → ApprovalModal
問題:
- SlidePanel 側邊滑入與右側 OpenClaw 固定面板衝突
- 480px 寬度不足,內容被擠壓截斷
- 標題「審核詳情」只顯示「情」

解決方案:
- 新建 ApprovalModal 全屏 Modal 組件
- 居中對話框 (max-width: 672px)
- 深色遮罩 (60%) 強制用戶聚焦
- 符合 Nothing.tech「一次專注一件事」設計哲學

設計參考: GitHub PR Review, AWS IAM Console

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 13:26:05 +08:00
OG T
170102a4ee feat(#15): Approval Polling → SSE 即時更新
Phase 15: 將 Approval 輪詢機制改為 Server-Sent Events

後端變更:
- 新增 /api/v1/approvals/stream SSE 端點
- 建立/簽核/拒絕時發布 SSE 事件
- 使用現有 EventPublisher 基礎設施

前端變更:
- 新增 useApprovalSSE hook (自動連線/斷線管理)
- approval.store 新增 connectSSE/disconnectSSE actions
- 更新三個組件使用 SSE 取代 setInterval polling:
  - LiveApprovalPanel
  - AICommandPanel
  - HITLSection

效益:
- 即時推送 (延遲 ~0ms vs polling 5s)
- 減少 API 請求 (僅變更時推送)
- 自動重連 + Fallback to polling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 09:54:02 +08:00
OG T
8b7a1186ab feat(web): Professional UX for approval workflow
Industry-standard AIOps UX patterns:
- Compact approval list in right panel
- SlidePanel for details (PagerDuty/ServiceNow style)
- Keyboard navigation (←/→ for prev/next, ESC to close)
- Quick access to approve/reject
- Maintains context while reviewing details

Fixes large empty space issue and endless scrolling.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 00:22:35 +08:00
OG T
9bff46a1b0 feat: integrate Sentry + fix CI/CD issues
Sentry Integration (補強 SignOz):
- Add @sentry/nextjs for frontend error tracking + session replay
- Add sentry-sdk[fastapi] for backend error tracking
- Create sentry.client/server/edge.config.ts
- Integrate with next.config.js + instrumentation.ts
- Add Sentry exception capture in FastAPI error handler
- Create deployment scripts for Self-Hosted @ 192.168.0.110

CI/CD Fixes:
- Fix F821 Undefined name 'Field' in incidents.py
- Add NEXT_PUBLIC_API_URL env var to CI build step
- Add build-arg to Docker build verification

E2E Test Improvements:
- Fix strict mode violations in dashboard-acceptance tests
- Add timeout increase for Phase 4 demo tests
- Make tests more resilient to UI variations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 15:19:52 +08:00
OG T
196d269b92 feat: add all application source code
- apps/api: FastAPI backend with Dockerfile
- apps/web: Next.js frontend with Dockerfile
- apps/sensor: Signal collection agent
- packages: shared packages

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 18:57:44 +08:00