Preserve preview harness, editor, email and task improvements

Snapshot current maintainer-preview application changes and regression fixtures for integration into lab. Excludes local runtime data, evaluation outputs and source backups. Focused Python regression selection: 140 passed; full suite not certified.
This commit is contained in:
pewdiepie-archdaemon
2026-10-01 01:34:26 +00:00
parent 86f376ac3a
commit 2e8413a54a
170 changed files with 11010 additions and 1094 deletions
+14
View File
@@ -4118,6 +4118,20 @@ export function initEmailLibrary(config) {
export function isOpen() { return state._libOpen; }
export async function openEmailFromTool(target, isCurrent = () => true) {
const response = await fetch(`${API_BASE}/api/email/accounts`, { credentials: 'same-origin' });
if (!response.ok) throw new Error('Could not load email accounts');
const data = await response.json();
const key = String(target.account || '').trim().toLowerCase();
const matches = (data.accounts || []).filter(account =>
[account.id, account.from_address, account.imap_user, account.name]
.some(value => value && String(value).trim().toLowerCase() === key));
if (matches.length !== 1) throw new Error('Could not uniquely identify the email account');
if (!/^\d+$/.test(String(target.uid || ''))) throw new Error('Invalid email message ID');
if (!isCurrent()) return;
openEmailLibrary({ uid: String(target.uid), folder: target.folder || 'INBOX', account_id: matches[0].id });
}
export function openEmailLibrary(opts = {}) {
// Foreground email always wins: cancel a delayed/idle callback and abort the
// one optional request if it has already started. Generation checks make a