fix: move page ai launcher to pi lab

This commit is contained in:
Agent Board
2026-07-13 09:00:19 +08:00
parent 2f5902e3e7
commit d6a25afa0a
11 changed files with 80 additions and 73 deletions
@@ -4624,15 +4624,29 @@
function installLauncher() {
if (piLabLauncherEl) return;
piLabLauncherEl = el('button', {
type: 'button',
className: 'wolai-page-ai-pi-lab-launcher',
'data-page-ai-pi-lab-launcher': 'true',
title: 'Pi Lab',
'aria-label': '打开 Pi Lab',
}, ');
piLabLauncherEl.addEventListener('click', showPiLab);
document.body.appendChild(piLabLauncherEl);
var hostButton = document.querySelector('[data-mnote-action="open-page-ai-pi-lab"], [data-testid="wolai-floating-ai"]');
if (hostButton instanceof HTMLElement) {
piLabLauncherEl = hostButton;
piLabLauncherEl.setAttribute('data-page-ai-pi-lab-launcher', 'true');
piLabLauncherEl.setAttribute('data-mnote-action', 'open-page-ai-pi-lab');
piLabLauncherEl.setAttribute('aria-label', '打开 Pi Lab');
piLabLauncherEl.setAttribute('title', '打开 Pi Lab');
piLabLauncherEl.textContent = 'π';
} else {
piLabLauncherEl = el('button', {
type: 'button',
className: 'wolai-page-ai-pi-lab-launcher',
'data-page-ai-pi-lab-launcher': 'true',
title: 'Pi Lab',
'aria-label': '打开 Pi Lab',
}, 'π');
document.body.appendChild(piLabLauncherEl);
}
piLabLauncherEl.addEventListener('click', function (event) {
event.preventDefault();
event.stopPropagation();
showPiLab();
});
}
function wireEvents() {