Skip to content

feat: move profile sync to Profiles page with selectable devices#161

Merged
Keith-CY merged 18 commits intodevelopfrom
feat/profile-device-sync-ui
Mar 31, 2026
Merged

feat: move profile sync to Profiles page with selectable devices#161
Keith-CY merged 18 commits intodevelopfrom
feat/profile-device-sync-ui

Conversation

@dev01lay2
Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 commented Mar 30, 2026

Summary

  • hide sidebar bottom-left model sync status block
  • add Profiles-page device sync dialog with checklist (default none selected)
  • add per-device sync status (idle/syncing/success/failed)
  • when no device selected but devices exist, button text becomes "从设备同步"
  • use device names (not ids) in sync operations and failures
  • show profile sync source device + sync time in profile list

Technical

  • extended model profile shape with optional sync metadata fields:
    • syncSourceDeviceName
    • syncSourceHostId
    • syncSyncedAt
  • remote_sync_profiles_to_local_auth now accepts optional sourceDeviceName and stamps sync metadata

Verification

  • npm run lint passes
  • pre-commit rust step skipped in this environment because cargo is unavailable

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

📦 PR Build Artifacts

Platform Download Size
Windows-x64 📥 clawpal-Windows-x64 27.5 MB
Linux-x64 📥 clawpal-Linux-x64 105.8 MB
macOS-x64 📥 clawpal-macOS-x64 14.0 MB
macOS-ARM64 📥 clawpal-macOS-ARM64 13.2 MB

🔨 Built from b97eb03 · View workflow run
⚠️ Unsigned development builds — for testing only

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

📏 Metrics Gate Report

Status: ✅ All gates passed

Commit Size ✅

Metric Value Limit Status
Commits checked 18
All within limit 18/18 ≤ 500 lines
Largest commit 215 lines ≤ 500

Bundle Size ✅

Metric Value Limit Status
JS bundle (raw) 1077 KB
JS bundle (gzip) 329 KB ≤ 350 KB
JS initial load (gzip) 173 KB ≤ 180 KB

Perf Metrics E2E ✅

Metric Value Limit Status
Tests 10 passed, 0 failed 0 failures
RSS (test process) 3.2 MB ≤ 20 MB
VMS (test process) 270.2 MB ℹ️
Command P50 latency 28 µs ≤ 1000 µs
Command P95 latency 34 µs ≤ 5000 µs
Command max latency 43 µs ≤ 50000 µs

Command Perf (local) ✅

Metric Value Status
Tests 4 passed, 0 failed
Commands measured 5 ℹ️
RSS (test process) 4.4 MB ℹ️
Local command timings
Command P50 (µs) P95 (µs) Max (µs)
local_openclaw_config_exists 1 9 9
list_ssh_hosts 2 10 10
get_app_preferences 16 38 38
read_app_log 63 95 95
read_error_log 5 10 10

Command Perf (remote SSH) ✅

Metric Value Status
SSH transport OK
Command failures 9/15 runs ℹ️ Docker (no gateway)
Remote command timings (via Docker SSH)
Command Median Max
openclaw_status 2721 ms 2827 ms
cat__root_.openclaw_openclaw.json 265 ms 265 ms
openclaw_gateway 2534 ms 2613 ms
openclaw_cron 2527 ms 2541 ms
openclaw_agent 2473 ms 2488 ms

Home Page Render Probes (real IPC) ✅

Probe Value Limit Status
status 60 ms ≤ 500 ms
version 152 ms ≤ 500 ms
agents 7 ms ≤ 500 ms
models 7 ms ≤ 500 ms
settled 156 ms ≤ 500 ms

Code Readability

File Lines Target Status
commands/mod.rs 11863 ≤ 300 ⚠️
commands/doctor_assistant.rs 5637 ≤ 3000 ⚠️
commands/rescue.rs 3402 ≤ 2000 ⚠️
cli_runner.rs 3295 ≤ 1200 ⚠️
commands/profiles.rs 1923 ≤ 1500 ⚠️
commands/sessions.rs 1828 ≤ 1100 ⚠️
commands/discovery.rs 1702 ≤ 1000 ⚠️
commands/credentials.rs 1629 ≤ 1000 ⚠️
openclaw_doc_resolver.rs 1362 ≤ 800 ⚠️
commands/ssh.rs 1216 ≤ 700 ⚠️
commands/doctor.rs 1193 ≤ 700 ⚠️
pages/Settings.tsx 1100 ≤ 700 ⚠️
recipe_adapter_tests.rs 1100 ≤ 700 ⚠️
ssh.rs 980 ≤ 600 ⚠️
agent_identity.rs 937 ≤ 600 ⚠️
pages/StartPage.tsx 898 ≤ 500 ⚠️
recipe_library.rs 884 ≤ 500 ⚠️
pages/Cook.tsx 881 ≤ 500 ⚠️
pages/Recipes.tsx 875 ≤ 500 ⚠️
pages/Home.tsx 867 ≤ 500 ⚠️
recipe_library_tests.rs 861 ≤ 500 ⚠️
lib/types.ts 856 ≤ 500 ⚠️
install/commands.rs 839 ≤ 500 ⚠️
commands/backup.rs 788 ≤ 500 ⚠️
lib/use-api.ts 774 ≤ 500 ⚠️
recipe_adapter.rs 757 ≤ 500 ⚠️
pages/RecipeStudio.tsx 680 ≤ 500 ⚠️
components/SessionAnalysisPanel.tsx 679 ≤ 500 ⚠️
commands/model.rs 645 ≤ 500 ⚠️
bridge_client.rs 645 ≤ 500 ⚠️
recipe_action_catalog.rs 631 ≤ 500 ⚠️
App.tsx 625 ≤ 500 ⚠️
lib/actions.ts 622 ≤ 500 ⚠️
components/InstallHub.tsx 619 ≤ 500 ⚠️
recipe_workspace.rs 613 ≤ 500 ⚠️
agent_fallback.rs 609 ≤ 500 ⚠️
recipe.rs 596 ≤ 500 ⚠️
commands/config.rs 549 ≤ 500 ⚠️
commands/discord.rs 545 ≤ 500 ⚠️
recipe_runtime/systemd.rs 537 ≤ 500 ⚠️
commands/overview.rs 533 ≤ 500 ⚠️
lib/api.ts 527 ≤ 500 ⚠️
install/runners/docker.rs 525 ≤ 500 ⚠️
commands/types.rs 524 ≤ 500 ⚠️
commands/instance.rs 501 ≤ 500 ⚠️
markdown_document.rs 497 ≤ 500
pages/Channels.tsx 480 ≤ 500
pages/Doctor.tsx 479 ≤ 500
node_client.rs 452 ≤ 500
commands/discover_local.rs 441 ≤ 500
lib/__tests__/guidance.test.ts 439 ≤ 500
recipe_executor.rs 437 ≤ 500
components/__tests__/DoctorRecoveryOverview.test.tsx 429 ≤ 500
pages/Cron.tsx 428 ≤ 500
recipe_executor_tests.rs 422 ≤ 500
hooks/useInstanceDataStore.ts 421 ≤ 500
bug_report/queue.rs 409 ≤ 500
lib.rs 408 ≤ 500
lib/api-read-cache.ts 405 ≤ 500
commands/channels.rs 405 ≤ 500
components/__tests__/InstanceCard.test.tsx 400 ≤ 500
components/DoctorRecoveryOverview.tsx 383 ≤ 500
pages/Orchestrator.tsx 372 ≤ 500
recipe_tests.rs 360 ≤ 500
lib/use-cached-query.ts 353 ≤ 500
hooks/useSshConnection.ts 353 ≤ 500
components/DoctorTempProviderDialog.tsx 349 ≤ 500
commands/precheck.rs 346 ≤ 500
bug_report/collector.rs 335 ≤ 500
components/InstanceCard.tsx 334 ≤ 500
hooks/useWorkspaceTabs.ts 331 ≤ 500
lib/doctor-report-i18n.ts 328 ≤ 500
components/ParamForm.tsx 324 ≤ 500
pages/__tests__/cook-plan-context.test.ts 319 ≤ 500
pages/__tests__/overview-loading.test.ts 318 ≤ 500
hooks/useChannelCache.ts 317 ≤ 500
components/__tests__/SshFormWidget.test.tsx 312 ≤ 500
components/PendingChangesBar.tsx 308 ≤ 500
hooks/useInstancePersistence.ts 303 ≤ 500
doctor.rs 303 ≤ 500
recipe_planner_tests.rs 302 ≤ 500
Files > 500 lines 45 trend ↓ ⚠️
Files over target 45 0 ⚠️

📊 Metrics defined in docs/architecture/metrics.md

@dev01lay2
Copy link
Copy Markdown
Collaborator Author

补上截图(先放本地 UI 区域截图,便于 review 对齐):

Profiles 页面入口位置(Settings 区域)

settings-main

Settings 下半区(Profile 列表区域)

settings-bottom

我后续会再补一版“设备同步 popup + 每设备状态 + profile 来源/同步时间”的专门截图(当前环境无桌面浏览器,先把可对齐区域贴上)。

@dev01lay2
Copy link
Copy Markdown
Collaborator Author

CI 失败已继续修复并 push:\n- fix(ci): update tauri profile initializers for sync metadata fields\n\n这次是 里还有几处 初始化没补新字段导致的编译错误。现在已补齐,正在等新一轮 CI。\n\nGIF 我还在补,等 CI 跑起来后我会在同一个 PR 评论里追加(popup checklist + 每设备状态 + 来源设备/同步时间)。

@dev01lay2
Copy link
Copy Markdown
Collaborator Author

CI 失败已继续修复并 push:

  • fix(ci): update tauri profile initializers for sync metadata fields

这次是 src-tauri/src/commands/profiles.rs 里还有几处 ModelProfile 初始化没补新字段导致的编译错误。现在已补齐,正在等新一轮 CI。

GIF 我还在补,等 CI 跑起来后我会在同一个 PR 评论里追加(popup checklist + 每设备状态 + 来源设备/同步时间)。

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

📸 UI Screenshots

Commit: 9969e230fa3dcb35ca0c067543ceb889a35e5a08 | Screenshots: Download artifact

Light Mode — Core Pages

Start Page Home Channels
start home channels
Recipes Cron Doctor
recipes cron doctor
Context History Chat Panel
context history chat
Settings (4 scroll positions)
Main Appearance Advanced Bottom
s1 s2 s3 s4
Start Page Sections
Overview Profiles Settings
sp1 sp2 sp3

Dark Mode

Start Home Channels Doctor
d1 d2 d3 d4
Dark mode — more pages
Recipes Cron Settings
d5 d6 d7

Responsive + Dialogs

Home 1024×680 Chat 1024×680 Create Agent
r1 r2 d1

🔧 Harness: Docker + Xvfb + tauri-driver + Selenium | 28 screenshots, 13 flows

@dev01lay2
Copy link
Copy Markdown
Collaborator Author

继续修复了 coverage 红灯(clawpal-cli 的 ModelProfile 初始化缺少新字段):

  • fix(coverage): update cli ModelProfile initializer for sync metadata

已 push,正在等待新一轮 CI。

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

📊 Test Coverage Report

Metric Base (develop) PR (feat/profile-device-sync-ui) Delta
Lines 73.94% (6303/8525) 74.09% (6341/8558) 🟢 +0.15%
Functions 68.89% (724/1051) 68.98% (725/1051) 🟢 +0.09%
Regions 75.34% (10363/13755) 75.49% (10408/13788) 🟢 +0.15%

Coverage measured by cargo llvm-cov (clawpal-core + clawpal-cli).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

Recipe GUI E2E Perf

Artifacts: perf report

Recipe Page Load (ms) Form Fill (ms) Execution (ms) Verification (ms) Total (ms)
dedicated-agent ⚠️ Skipped: Discord not configured in E2E environment
channel-persona-pack ⚠️ Skipped: Discord not configured in E2E environment
agent-persona-pack ⚠️ Skipped: Discord not configured in E2E environment

Harness: Docker + Xvfb + tauri-driver + Selenium

@dev01lay2
Copy link
Copy Markdown
Collaborator Author

按这次 UI 改进再补一版“聚焦截图”(便于 review 对照需求):

1) Sidebar 左下角同步展示已隐藏

  • 侧边栏底部当前无 model sync 状态块:
    home-sidebar

2) Profiles 页新增同步入口(已同步设备计数)

  • Profiles/Settings 区域入口位置:
    settings-main

3) Profile 列表区域展示来源设备 + 同步时间

  • 下半区列表展示位:
    settings-bottom

4) 兼容暗色主题显示

dark-settings


补充说明:本轮 CI 自动截图流尚未覆盖“点击后 popup 打开态(checklist + 每设备同步状态)”。我会继续补一组 popup 打开态截图/GIF 到本 PR。

@dev01lay2
Copy link
Copy Markdown
Collaborator Author

补一版 Profiles 页面 截图(不是 Settings):

Profiles page(主视图)

profiles-page

Profiles page(同页面,Dark mode)

profiles-page-dark

说明:这条只放 Profiles 视角,避免与 Settings 混淆。popup 打开态(checklist + 每设备状态)我会单独再补一条。

@dev01lay2
Copy link
Copy Markdown
Collaborator Author

已按反馈调整:

  • Synced x devicesAdd profile 改成 icon button(hover/title 显示文案),页面更简洁。
    • sync 按钮:Refresh 图标,hover 显示同步设备计数文案
    • add 按钮:Plus 图标,hover 显示 Add profile

另外我会继续补一条 popup 打开态截图(checklist + 每设备状态 + 来源设备/同步时间)。

@dev01lay2
Copy link
Copy Markdown
Collaborator Author

进度更新:

待补(我会继续跟进):

  • popup 打开态截图 / GIF(checklist + 每设备状态 + 来源设备/同步时间)

@dev01lay2
Copy link
Copy Markdown
Collaborator Author

已按最新反馈实现:

  1. 点击 popup 里的同步按钮后:
  • 立即弹 sonner toast(“已开始同步 N 个设备”)
  • 立即关闭 popup 对话框
  1. 同步进行中时:
  • Profiles 页面顶部同步 icon(Refresh)保持旋转,直到所有选中设备同步完成

提交:feat(sync-ui): close dialog with toast on sync start and spin sync icon

@dev01lay2 dev01lay2 deployed to development March 31, 2026 08:46 — with GitHub Actions Active
@Keith-CY Keith-CY merged commit 47acbe5 into develop Mar 31, 2026
15 checks passed
@Keith-CY Keith-CY deleted the feat/profile-device-sync-ui branch March 31, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants