feat(settings): replicate the WorkBuddy personalization panel and wire identity, tone and prompts (TODO 13)

Recover the WorkBuddy 5.8.3 个性化 page from REA evidence (PersonalizationPanel-D16rRGjy.css + tokens): 45 module rules plus scoped light/dark tokens, the five-card 1160px layout (identity card 638x100 with inline editors, reply preference card 638x204, three 638x264 long-text cards with 598x160 previews) and the 640x520 editor modal.

Persist identity, tone, welcome tips, custom instructions, persona and long-term memory in config.json, expose personalization:get/update over IPC, and append the resulting personalization context to each turn's prompt for both the OMP and built-in kernels. Wire 欢迎语 to the streaming loading tips and keep 显示文件修改过程 visibly disabled because YCode has no incremental file-change renderer yet.

Verify with scripts/verify-personalization-settings.cjs: 29 assertions covering geometry, tone options, switches, inline identity editing with blur-discard, editor modal save/cancel, config persistence, reopen, dark surfaces and no renderer errors. Add a pure prompt-builder regression and keep every existing settings regression green.
This commit is contained in:
xiaohan.yuan committed 2026-10-17 10:46:40 +08:00
1 parent 19460f0b13
commit 0dc088f1f7
54 files changed
+2038 -248

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
".appearance-card--light",
".appearance-card--dark"
],
"actions": [
{ "kind": "wait", "step_id": "dark-theme-stable-after-target-rediscovery", "duration_ms": 800, "frames": 4 }
]
}
@@ -0,0 +1,12 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
".appearance-card--light",
".appearance-card--dark"
],
"actions": [
{ "kind": "wait", "step_id": "light-theme-stable-after-target-rediscovery", "duration_ms": 800, "frames": 4 }
]
}
@@ -0,0 +1,16 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".local-memory-edit-modal",
"#settings-local-memory-body .general-settings-panel__section-title",
"#settings-local-memory-body .general-settings-panel__section-action button",
"#settings-local-memory-body .local-memory-long__preview"
],
"actions": [
{ "kind": "click", "step_id": "cancel-persona-editor-before-memory-test", "selector": ".local-memory-edit-modal .wb-modal__footer button", "index": 0, "frames": 0 },
{ "kind": "wait", "step_id": "persona-editor-closed-for-memory-test", "duration_ms": 350, "frames": 0 },
{ "kind": "click", "step_id": "open-long-memory-editor", "selector": "#settings-local-memory-body .general-settings-panel__section-action button", "index": 0, "frames": 1 },
{ "kind": "wait", "step_id": "long-memory-editor-settled", "duration_ms": 350, "frames": 1 }
]
}
@@ -0,0 +1,15 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".local-memory-edit-modal",
".local-memory-edit-modal .wb-modal__footer button",
"#settings-local-memory-body .general-settings-panel__section-title"
],
"actions": [
{ "kind": "click", "step_id": "cancel-empty-long-memory-editor", "selector": ".local-memory-edit-modal .wb-modal__footer button", "index": 0, "frames": 1 },
{ "kind": "wait", "step_id": "long-memory-editor-cancel-settled", "duration_ms": 350, "frames": 1 },
{ "kind": "scroll", "step_id": "return-panel-top-from-long-memory", "selector": "#settings-local-memory-body .general-settings-panel__section-title", "delta_y": -1200, "frames": 1 },
{ "kind": "wait", "step_id": "personalization-top-confirmed-after-memory", "duration_ms": 200, "frames": 1 }
]
}
@@ -0,0 +1,14 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
".settings-navigation__item",
".appearance-card--light",
".appearance-card--dark"
],
"actions": [
{ "kind": "click", "step_id": "open-appearance-to-restore-light-by-index-3", "selector": ".settings-navigation__item", "index": 3, "frames": 0 },
{ "kind": "wait", "step_id": "appearance-dark-before-restore-confirmed", "duration_ms": 450, "frames": 1 }
]
}
@@ -0,0 +1,14 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
".settings-navigation__item",
".appearance-card--light",
".appearance-card--dark"
],
"actions": [
{ "kind": "click", "step_id": "open-appearance-by-observed-nav-index-3", "selector": ".settings-navigation__item", "index": 3, "frames": 0 },
{ "kind": "wait", "step_id": "appearance-page-confirmed-before-dark-theme", "duration_ms": 450, "frames": 1 }
]
}
@@ -0,0 +1,14 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
".settings-navigation__item",
".general-settings-panel.personalization-panel",
".local-memory-identity-card"
],
"actions": [
{ "kind": "click", "step_id": "open-personalization-in-dark-theme-by-observed-nav-index-5", "selector": ".settings-navigation__item", "index": 5, "frames": 0 },
{ "kind": "wait", "step_id": "personalization-dark-navigation-confirmed", "duration_ms": 500, "frames": 1 }
]
}
@@ -0,0 +1,14 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
".settings-navigation__item",
".general-settings-panel.personalization-panel",
".local-memory-identity-card"
],
"actions": [
{ "kind": "click", "step_id": "return-to-personalization-in-light-theme-by-nav-index-5", "selector": ".settings-navigation__item", "index": 5, "frames": 0 },
{ "kind": "wait", "step_id": "personalization-light-final-state-confirmed", "duration_ms": 500, "frames": 1 }
]
}
@@ -0,0 +1,15 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
"#settings-local-memory-soul .general-settings-panel__section-title",
"#settings-local-memory-soul .general-settings-panel__section-action button",
"#settings-local-memory-soul .local-memory-long__preview",
".local-memory-edit-modal"
],
"actions": [
{ "kind": "scroll", "step_id": "scroll-persona-heading-to-bottom", "selector": "#settings-local-memory-soul .general-settings-panel__section-title", "delta_y": 300, "frames": 1 },
{ "kind": "click", "step_id": "retry-persona-edit-button", "selector": "#settings-local-memory-soul .general-settings-panel__section-action button", "index": 0, "frames": 1 },
{ "kind": "wait", "step_id": "persona-edit-button-retry-settled", "duration_ms": 350, "frames": 1 }
]
}
@@ -0,0 +1,16 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
"#settings-local-memory-soul .general-settings-panel__section-title",
"#settings-local-memory-soul .general-settings-panel__section-action button",
"#settings-local-memory-soul .local-memory-long__preview",
".local-memory-edit-modal"
],
"actions": [
{ "kind": "scroll", "step_id": "scroll-to-persona-button", "selector": ".settings-modal__panel", "delta_y": 300, "frames": 0 },
{ "kind": "scroll", "step_id": "scroll-persona-button-visible", "selector": "#settings-local-memory-soul .general-settings-panel__section-title", "delta_y": 300, "frames": 0 },
{ "kind": "click", "step_id": "activate-persona-edit-button", "selector": "#settings-local-memory-soul .general-settings-panel__section-action button", "index": 0, "frames": 1 },
{ "kind": "wait", "step_id": "persona-edit-button-settled", "duration_ms": 350, "frames": 1 }
]
}
@@ -0,0 +1,20 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
"#settings-local-memory-soul .general-settings-panel__section-title",
"#settings-local-memory-soul .general-settings-panel__section-action button",
".local-memory-edit-modal .wb-modal__footer button"
],
"actions": [
{ "kind": "scroll", "step_id": "scroll-to-persona-editor", "selector": ".settings-modal__panel", "delta_y": 300, "frames": 0 },
{ "kind": "scroll", "step_id": "scroll-persona-section-into-view", "selector": "#settings-local-memory-soul .general-settings-panel__section-title", "delta_y": 300, "frames": 0 },
{ "kind": "click", "step_id": "open-persona-editor", "selector": "#settings-local-memory-soul .general-settings-panel__section-action button", "index": 0, "frames": 0 },
{ "kind": "wait", "step_id": "persona-editor-open", "duration_ms": 350, "frames": 1 },
{ "kind": "click", "step_id": "cancel-persona-editor-without-change", "selector": ".local-memory-edit-modal .wb-modal__footer button", "index": 0, "frames": 1 },
{ "kind": "wait", "step_id": "persona-editor-cancelled", "duration_ms": 350, "frames": 1 },
{ "kind": "scroll", "step_id": "return-personalization-top-after-editor", "selector": "#settings-local-memory-soul .general-settings-panel__section-title", "delta_y": -1200, "frames": 1 },
{ "kind": "wait", "step_id": "personalization-top-confirmed", "duration_ms": 200, "frames": 1 }
]
}
@@ -0,0 +1,16 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".local-memory-edit-modal",
".local-memory-edit-modal .wb-modal__footer",
".local-memory-edit-modal .wb-modal__footer button",
"#settings-local-memory-soul .general-settings-panel__section-title"
],
"actions": [
{ "kind": "click", "step_id": "cancel-persona-editor", "selector": ".local-memory-edit-modal .wb-modal__footer button", "index": 0, "frames": 1 },
{ "kind": "wait", "step_id": "persona-editor-cancel-settled", "duration_ms": 300, "frames": 1 },
{ "kind": "scroll", "step_id": "restore-personalization-panel-top", "selector": "#settings-local-memory-soul .general-settings-panel__section-title", "delta_y": -1200, "frames": 1 },
{ "kind": "wait", "step_id": "personalization-panel-top-after-persona-editor", "duration_ms": 200, "frames": 1 }
]
}
@@ -0,0 +1,13 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
"#settings-local-memory-soul .local-memory-long__preview",
"#settings-local-memory-soul .general-settings-panel__section-action button"
],
"actions": [
{ "kind": "click", "step_id": "click-persona-preview-role-button", "selector": "#settings-local-memory-soul .local-memory-long__preview", "index": 0, "frames": 1 },
{ "kind": "wait", "step_id": "persona-preview-click-settled", "duration_ms": 350, "frames": 1 }
]
}
@@ -0,0 +1,16 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
"#settings-local-memory-ai-name",
"#settings-local-memory-ai-name input",
"#settings-local-memory-ai-name .local-memory-identity-row__actions"
],
"actions": [
{ "kind": "click", "step_id": "open-ai-name-inline-editor", "selector": "#settings-local-memory-ai-name .local-memory-pill", "index": 0, "frames": 1 },
{ "kind": "text", "step_id": "enter-temporary-ai-name-draft", "selector": "#settings-local-memory-ai-name input", "text": "CodexTmp", "frames": 1 },
{ "kind": "click", "step_id": "cancel-ai-name-draft", "selector": "#settings-local-memory-ai-name .local-memory-identity-row__actions button", "index": 0, "frames": 1 },
{ "kind": "wait", "step_id": "confirm-ai-name-remains-original-empty", "duration_ms": 200, "frames": 1 }
]
}
@@ -0,0 +1,12 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".local-memory-edit-modal",
".local-memory-edit-modal .wb-modal__footer",
".local-memory-edit-modal .wb-modal__footer button"
],
"actions": [
{ "kind": "click", "step_id": "cancel-workbuddy-instructions-editor", "selector": ".local-memory-edit-modal .wb-modal__footer button", "index": 0, "frames": 1 }
]
}
@@ -0,0 +1,13 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
"#settings-custom-prompt",
"#settings-custom-prompt .general-settings-panel__section-action button"
],
"actions": [
{ "kind": "click", "step_id": "open-workbuddy-instructions-editor", "selector": "#settings-custom-prompt .general-settings-panel__section-action button", "index": 0, "frames": 1 },
{ "kind": "key", "step_id": "close-workbuddy-instructions-editor-with-escape", "key": "Escape", "frames": 1 }
]
}
@@ -0,0 +1,15 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".local-memory-edit-modal",
".local-memory-edit-modal .local-memory-editor-host",
".local-memory-edit-modal .wb-modal__footer button"
],
"actions": [
{ "kind": "click", "step_id": "open-empty-workbuddy-instructions-editor", "selector": "#settings-custom-prompt .general-settings-panel__section-action button", "index": 0, "frames": 0 },
{ "kind": "wait", "step_id": "empty-instructions-editor-ready", "duration_ms": 300, "frames": 1 },
{ "kind": "click", "step_id": "save-unchanged-empty-instructions", "selector": ".local-memory-edit-modal .wb-modal__footer button", "index": 1, "frames": 1 },
{ "kind": "wait", "step_id": "instructions-save-result", "duration_ms": 300, "frames": 1 }
]
}
@@ -0,0 +1,16 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
".local-memory-pill",
"#settings-local-memory-user-call-name .local-memory-pill",
"#settings-local-memory-ai-name .local-memory-pill"
],
"actions": [
{ "kind": "click", "step_id": "open-user-call-name-editor", "selector": "#settings-local-memory-user-call-name .local-memory-pill", "index": 0, "frames": 1 },
{ "kind": "key", "step_id": "close-user-call-name-editor-with-escape", "key": "Escape", "frames": 1 },
{ "kind": "click", "step_id": "open-ai-name-editor", "selector": "#settings-local-memory-ai-name .local-memory-pill", "index": 0, "frames": 1 },
{ "kind": "key", "step_id": "close-ai-name-editor-with-escape", "key": "Escape", "frames": 1 }
]
}
@@ -0,0 +1,22 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
".general-settings-panel.personalization-panel",
"#settings-local-memory-soul .general-settings-panel__section-title",
"#settings-local-memory-soul .local-memory-long__preview"
],
"actions": [
{ "kind": "wait", "step_id": "personalization-full-page-top", "duration_ms": 200, "frames": 1 },
{ "kind": "scroll", "step_id": "scroll-page-to-persona-section", "selector": ".settings-modal__panel", "delta_y": 300, "frames": 1 },
{ "kind": "scroll", "step_id": "scroll-page-to-bottom-on-visible-title", "selector": "#settings-local-memory-soul .general-settings-panel__section-title", "delta_y": 300, "frames": 1 },
{ "kind": "scroll", "step_id": "persona-preview-text-1", "selector": "#settings-local-memory-soul .local-memory-long__preview", "delta_y": 200, "frames": 1 },
{ "kind": "scroll", "step_id": "persona-preview-text-2", "selector": "#settings-local-memory-soul .local-memory-long__preview", "delta_y": 200, "frames": 1 },
{ "kind": "scroll", "step_id": "persona-preview-text-3", "selector": "#settings-local-memory-soul .local-memory-long__preview", "delta_y": 200, "frames": 1 },
{ "kind": "scroll", "step_id": "persona-preview-text-4-bottom", "selector": "#settings-local-memory-soul .local-memory-long__preview", "delta_y": 200, "frames": 1 },
{ "kind": "scroll", "step_id": "persona-preview-return-top", "selector": "#settings-local-memory-soul .local-memory-long__preview", "delta_y": -1600, "frames": 1 },
{ "kind": "scroll", "step_id": "return-page-to-top-from-visible-title", "selector": "#settings-local-memory-soul .general-settings-panel__section-title", "delta_y": -1200, "frames": 1 },
{ "kind": "wait", "step_id": "personalization-full-page-returned-top", "duration_ms": 200, "frames": 1 }
]
}
@@ -0,0 +1,15 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
"#settings-local-memory-user-call-name",
"#settings-local-memory-user-call-name .local-memory-identity-row__actions",
"#settings-tone-style"
],
"actions": [
{ "kind": "click", "step_id": "open-user-call-name-inline-editor", "selector": "#settings-local-memory-user-call-name .local-memory-pill", "index": 0, "frames": 1 },
{ "kind": "text", "step_id": "enter-temporary-call-name", "selector": "#settings-local-memory-user-call-name input", "text": "CodexTmp", "frames": 1 },
{ "kind": "click", "step_id": "blur-call-name-editor", "selector": "#settings-tone-style .general-settings-panel__section-title", "index": 0, "frames": 1 }
]
}
@@ -0,0 +1,14 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
"#settings-local-memory-user-call-name",
"#settings-local-memory-user-call-name input",
"#settings-local-memory-user-call-name .local-memory-identity-row__actions"
],
"actions": [
{ "kind": "click", "step_id": "edit-saved-user-call-name", "selector": "#settings-local-memory-user-call-name .local-memory-pill", "index": 0, "frames": 1 },
{ "kind": "click", "step_id": "test-first-identity-action", "selector": "#settings-local-memory-user-call-name .local-memory-identity-row__actions button", "index": 0, "frames": 1 }
]
}
@@ -0,0 +1,13 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
"#settings-local-memory-user-call-name",
"#settings-local-memory-user-call-name .local-memory-pill",
"#settings-local-memory-user-call-name .local-memory-identity-row__actions"
],
"actions": [
{ "kind": "click", "step_id": "close-empty-identity-editor", "selector": "#settings-local-memory-user-call-name .local-memory-identity-row__actions button", "index": 0, "frames": 1 }
]
}
@@ -0,0 +1,11 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
"#settings-local-memory-user-call-name .local-memory-pill"
],
"actions": [
{ "kind": "hover", "step_id": "inspect-saved-identity-hover-actions", "selector": "#settings-local-memory-user-call-name .local-memory-pill", "index": 0, "frames": 1 }
]
}
@@ -0,0 +1,15 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
"#settings-local-memory-user-call-name",
"#settings-local-memory-user-call-name input",
"#settings-local-memory-user-call-name .local-memory-identity-row__actions"
],
"actions": [
{ "kind": "click", "step_id": "reopen-saved-user-call-name", "selector": "#settings-local-memory-user-call-name .local-memory-pill", "index": 0, "frames": 1 },
{ "kind": "text", "step_id": "clear-user-call-name-to-original-empty", "selector": "#settings-local-memory-user-call-name input", "text": "", "frames": 1 },
{ "kind": "click", "step_id": "save-original-empty-user-call-name", "selector": "#settings-local-memory-user-call-name .local-memory-identity-row__actions button", "index": 1, "frames": 1 }
]
}
@@ -0,0 +1,15 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
"#settings-local-memory-user-call-name",
"#settings-local-memory-user-call-name input",
"#settings-local-memory-user-call-name .local-memory-identity-row__actions"
],
"actions": [
{ "kind": "click", "step_id": "reopen-user-call-name-editor", "selector": "#settings-local-memory-user-call-name .local-memory-pill", "index": 0, "frames": 1 },
{ "kind": "text", "step_id": "set-temporary-user-call-name", "selector": "#settings-local-memory-user-call-name input", "text": "CodexTmp", "frames": 1 },
{ "kind": "click", "step_id": "save-temporary-user-call-name", "selector": "#settings-local-memory-user-call-name .local-memory-identity-row__actions button", "index": 1, "frames": 1 }
]
}
@@ -0,0 +1,19 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
".personalization-panel__tone-trigger",
"#settings-loading-tips .wb-switch__control",
"#settings-file-changes .wb-switch__control"
],
"actions": [
{ "kind": "wait", "step_id": "control-baseline", "duration_ms": 200, "frames": 1 },
{ "kind": "click", "step_id": "open-reply-style-dropdown", "selector": ".personalization-panel__tone-trigger", "index": 0, "frames": 1 },
{ "kind": "key", "step_id": "close-reply-style-dropdown", "key": "Escape", "frames": 1 },
{ "kind": "click", "step_id": "toggle-welcome-off", "selector": "#settings-loading-tips .wb-switch__control", "index": 0, "frames": 1 },
{ "kind": "click", "step_id": "restore-welcome-on", "selector": "#settings-loading-tips .wb-switch__control", "index": 0, "frames": 1 },
{ "kind": "click", "step_id": "toggle-file-changes-on", "selector": "#settings-file-changes .wb-switch__control", "index": 0, "frames": 1 },
{ "kind": "click", "step_id": "restore-file-changes-off", "selector": "#settings-file-changes .wb-switch__control", "index": 0, "frames": 1 }
]
}
@@ -0,0 +1,11 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
"#settings-custom-prompt .general-settings-panel__section-action button"
],
"actions": [
{ "kind": "click", "step_id": "open-custom-prompt-editor-for-layout", "selector": "#settings-custom-prompt .general-settings-panel__section-action button", "index": 0, "frames": 1 }
]
}
@@ -0,0 +1,14 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
"html",
".settings-modal__panel",
".settings-navigation__item",
".personalization-settings-panel"
],
"actions": [
{ "kind": "click", "step_id": "select-personalization-by-observed-nav-order", "selector": ".settings-navigation__item", "index": 5, "frames": 0 },
{ "kind": "wait", "step_id": "personalization-navigation-confirmation", "duration_ms": 500, "frames": 1 }
]
}
@@ -0,0 +1,14 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
".general-settings-panel__section-title",
"#settings-local-memory-soul .general-settings-panel__section-title",
"#settings-local-memory-body .general-settings-panel__section-title"
],
"actions": [
{ "kind": "scroll", "step_id": "return-panel-to-top-from-visible-heading", "selector": "#settings-local-memory-soul .general-settings-panel__section-title", "delta_y": -1200, "frames": 1 },
{ "kind": "wait", "step_id": "confirm-personalization-top", "duration_ms": 200, "frames": 1 }
]
}
@@ -0,0 +1,17 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
".general-settings-panel.personalization-panel",
".general-settings-panel__group",
".local-memory-long-card"
],
"actions": [
{ "kind": "wait", "step_id": "personalization-top", "duration_ms": 250, "frames": 1 },
{ "kind": "scroll", "step_id": "personalization-scroll-1", "selector": ".settings-modal__panel", "delta_y": 300, "frames": 1 },
{ "kind": "scroll", "step_id": "personalization-scroll-2", "selector": ".settings-modal__panel", "delta_y": 300, "frames": 1 },
{ "kind": "scroll", "step_id": "personalization-scroll-3-bottom", "selector": ".settings-modal__panel", "delta_y": 300, "frames": 1 },
{ "kind": "scroll", "step_id": "personalization-return-top", "selector": ".settings-modal__panel", "delta_y": -1200, "frames": 1 }
]
}
@@ -0,0 +1,25 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
"#settings-custom-prompt .local-memory-long__preview",
"#settings-local-memory-soul .general-settings-panel__section-title",
"#settings-local-memory-body .local-memory-long__preview",
".local-memory-edit-modal"
],
"actions": [
{ "kind": "click", "step_id": "click-instructions-preview-role-button", "selector": "#settings-custom-prompt .local-memory-long__preview", "index": 0, "frames": 1 },
{ "kind": "wait", "step_id": "instructions-preview-editor-open", "duration_ms": 300, "frames": 1 },
{ "kind": "click", "step_id": "cancel-instructions-preview-editor", "selector": ".local-memory-edit-modal .wb-modal__footer button", "index": 0, "frames": 0 },
{ "kind": "wait", "step_id": "instructions-preview-editor-closed", "duration_ms": 350, "frames": 1 },
{ "kind": "scroll", "step_id": "scroll-to-bottom-memory-card-1", "selector": ".settings-modal__panel", "delta_y": 300, "frames": 1 },
{ "kind": "scroll", "step_id": "scroll-to-bottom-memory-card-2", "selector": "#settings-local-memory-soul .general-settings-panel__section-title", "delta_y": 300, "frames": 1 },
{ "kind": "click", "step_id": "click-long-memory-preview-role-button", "selector": "#settings-local-memory-body .local-memory-long__preview", "index": 0, "frames": 1 },
{ "kind": "wait", "step_id": "long-memory-preview-editor-open", "duration_ms": 300, "frames": 1 },
{ "kind": "click", "step_id": "cancel-long-memory-preview-editor", "selector": ".local-memory-edit-modal .wb-modal__footer button", "index": 0, "frames": 0 },
{ "kind": "wait", "step_id": "long-memory-preview-editor-closed", "duration_ms": 350, "frames": 1 },
{ "kind": "scroll", "step_id": "return-panel-top-after-preview-checks", "selector": "#settings-local-memory-body .general-settings-panel__section-title", "delta_y": -1200, "frames": 1 },
{ "kind": "wait", "step_id": "top-after-preview-checks-confirmed", "duration_ms": 200, "frames": 1 }
]
}
@@ -0,0 +1,15 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".settings-modal__panel",
"#settings-local-memory-user-call-name",
"#settings-local-memory-user-call-name input",
"#settings-local-memory-user-call-name .local-memory-pill"
],
"actions": [
{ "kind": "click", "step_id": "open-saved-call-name", "selector": "#settings-local-memory-user-call-name .local-memory-pill", "index": 0, "frames": 1 },
{ "kind": "text", "step_id": "replace-with-single-space", "selector": "#settings-local-memory-user-call-name input", "text": " ", "frames": 1 },
{ "kind": "click", "step_id": "confirm-space-value", "selector": "#settings-local-memory-user-call-name .local-memory-identity-row__actions button", "index": 1, "frames": 2 }
]
}
@@ -0,0 +1,8 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [],
"actions": [
{ "kind": "click", "step_id": "restore-light-theme-for-final-state", "selector": ".appearance-card--light", "index": 0, "frames": 0 }
]
}
@@ -0,0 +1,8 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [],
"actions": [
{ "kind": "click", "step_id": "select-dark-theme-for-personalization-sample", "selector": ".appearance-card--dark", "index": 0, "frames": 0 }
]
}
@@ -0,0 +1,17 @@
{
"include_fonts": false,
"include_message_content": false,
"track_selectors": [
".personalization-panel__tone-trigger",
".personalization-panel__tone-popover",
".wb-select__option",
".personalization-panel__option-name",
".personalization-panel__option-hint"
],
"actions": [
{ "kind": "click", "step_id": "open-reply-style-dropdown-for-all-options", "selector": ".personalization-panel__tone-trigger", "index": 0, "frames": 1 },
{ "kind": "scroll", "step_id": "reply-style-dropdown-lower-options", "selector": ".personalization-panel__tone-popover", "delta_y": 300, "frames": 1 },
{ "kind": "scroll", "step_id": "reply-style-dropdown-return-to-top", "selector": ".personalization-panel__tone-popover", "delta_y": -300, "frames": 1 },
{ "kind": "key", "step_id": "close-reply-style-dropdown-after-sampling", "key": "Escape", "frames": 1 }
]
}
@@ -0,0 +1,85 @@
// Recover only already-retained REA CSS; never access the installed application here.
// Source: REA evidence ev_af920edf33af5e811d58f05dad15210b29cd891f28e0fa74f6b18d63212241b1
// (WorkBuddy 5.8.3 设置 → 个性化), PersonalizationPanel-D16rRGjy.css.
import fs from 'node:fs/promises'
import { createHash } from 'node:crypto'
import postcss from 'postcss'
const sha = value => createHash('sha256').update(value).digest('hex')
const evidenceId = 'ev_af920edf33af5e811d58f05dad15210b29cd891f28e0fa74f6b18d63212241b1'
const evidence = JSON.parse(await fs.readFile(`.tmp/rea-css-evidence/${evidenceId}.json`, 'utf8'))
if (evidence.evidence_id !== evidenceId) throw new Error('REA identity mismatch')
const module = evidence.normalized_result.styles.items.find(item => /PersonalizationPanel-D16rRGjy\.css$/.test(item.file_path))
if (!module) throw new Error('Personalization panel module CSS is absent from the evidence')
const moduleCss = module.source.artifact.text
const moduleSha = sha(moduleCss)
if (moduleSha !== '318664f96253adace047d7b1d2d213fbf6139461c10d80ae12135998b7b98f3d') throw new Error('Personalization panel module CSS changed')
const tokens = await fs.readFile('.tmp/rea-css-recovered/tokens-Df-i-zsO.css', 'utf8')
const tokensSha = sha(tokens)
if (tokensSha !== '13f2bf82c96e5167a7d7098e36950c6c22c475b3337dbb8bb29ad2fe79cde696') throw new Error('Tokens CSS changed')
const lightTokens = new Map()
const darkTokens = new Map()
for (const rule of postcss.parse(tokens).nodes) {
if (rule.type !== 'rule') continue
const selectors = rule.selectors ?? []
const dark = selectors.some(selector => selector.includes('[data-theme=dark]'))
const light = selectors.some(selector => selector.trim() === ':root')
if (!dark && !light) continue
for (const node of rule.nodes ?? []) {
if (node.type !== 'decl' || !node.prop.startsWith('--')) continue
if (dark) darkTokens.set(node.prop, node.value)
if (light) lightTokens.set(node.prop, node.value)
}
}
const relatedSelector = /\.(?:personalization-panel|local-memory)(?:[\w-]*)?(?![\w-])/i
const darkScope = /^\s*(?:\[data-theme=["']?dark["']?\]|body\[data-vscode-theme-name=["']IDE Night["']\]|body\.vscode-dark|\.vscode-dark|body\.dark|\.dark)(?=\s|$)/i
function project(node) {
if (node.type === 'rule') {
const selectors = []
for (const selector of node.selectors) {
if (!relatedSelector.test(selector)) continue
const mapped = selector.replace(darkScope, '[data-theme=dark]')
if (!selectors.includes(mapped)) selectors.push(mapped)
}
return selectors.length ? node.clone({ selector: selectors.join(',') }) : null
}
if (node.type === 'atrule' && node.nodes) {
const nodes = node.nodes.map(project).filter(Boolean)
return nodes.length ? node.clone({ nodes }) : null
}
return null
}
const root = postcss.root({ nodes: postcss.parse(moduleCss).nodes.map(project).filter(Boolean) })
const referenced = new Set()
const collect = text => {
for (const match of text.matchAll(/var\(\s*(--[\w-]+)/g)) referenced.add(match[1])
}
collect(root.toString())
for (let depth = 0; depth < 8; depth++) {
const before = referenced.size
for (const name of [...referenced]) {
for (const value of [lightTokens.get(name), darkTokens.get(name)]) {
if (typeof value === 'string') collect(value)
}
}
if (referenced.size === before) break
}
const missingLight = [...referenced].filter(name => !lightTokens.has(name))
if (missingLight.length) throw new Error(`Tokens missing from light root scope: ${missingLight.join(', ')}`)
const pick = map => new Map([...referenced].map(name => [name, map.get(name) ?? lightTokens.get(name)]))
const scope = (selector, map) => `${selector}{${[...map].map(([property, value]) => `${property}:${value}`).join(';')}}`
const scopedTokens = `${scope('.general-settings-panel.personalization-panel', pick(lightTokens))}\n${scope(':root[data-theme=dark] .general-settings-panel.personalization-panel', pick(darkTokens))}\n`
const css = `/* REA ${evidenceId}; PersonalizationPanel-D16rRGjy.css sha256=${moduleSha}; tokens sha256=${tokensSha}. */\n${root.toString()}\n${scopedTokens}`
await fs.writeFile('src/renderer/src/components/source-personalization-panel-recovered.css', css)
const rules = []
root.walkRules(rule => rules.push(rule.selector))
console.log(`Recovered ${rules.length} personalization rules (${Buffer.byteLength(css)} bytes); scoped ${pick(lightTokens).size} light / ${pick(darkTokens).size} dark tokens`)
console.log(rules.slice(0, 16).join('\n'))
if (rules.length < 30) throw new Error('Unexpectedly few personalization rules')