synabun 2.4.0 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/README.md +1 -1
- package/browser-extension/content.js +73 -11
- package/browser-extension/engine.js +196 -15
- package/browser-extension/manifest.json +4 -2
- package/browser-extension/popup-strings.js +10 -4
- package/browser-extension/popup-view.js +1 -1
- package/browser-extension/popup.css +1 -0
- package/browser-extension/popup.html +4 -1
- package/browser-extension/popup.js +22 -10
- package/browser-extension/protocol.js +102 -11
- package/browser-extension/service-worker.js +20 -4
- package/browser-extension/tokens.css +1 -1
- package/docs/browser-extension-bridge.md +25 -5
- package/lib/data-home-files.js +47 -0
- package/lib/data-home-migration.js +34 -58
- package/lib/first-launch-protection.js +8 -2
- package/lib/update-snapshot.js +11 -4
- package/mcp-server/dist/http.d.ts.map +1 -1
- package/mcp-server/dist/http.js +25 -2
- package/mcp-server/dist/http.js.map +1 -1
- package/mcp-server/dist/index.d.ts.map +1 -1
- package/mcp-server/dist/index.js +62 -17
- package/mcp-server/dist/index.js.map +1 -1
- package/mcp-server/dist/services/browser-bench.d.ts +22 -22
- package/mcp-server/dist/services/memory-maintenance.d.ts +1 -0
- package/mcp-server/dist/services/memory-maintenance.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-maintenance.js +34 -45
- package/mcp-server/dist/services/memory-maintenance.js.map +1 -1
- package/mcp-server/dist/services/memory-migration-copy.d.ts +144 -0
- package/mcp-server/dist/services/memory-migration-copy.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-migration-copy.js +467 -0
- package/mcp-server/dist/services/memory-migration-copy.js.map +1 -0
- package/mcp-server/dist/services/memory-migration-worker.d.ts +2 -0
- package/mcp-server/dist/services/memory-migration-worker.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-migration-worker.js +60 -0
- package/mcp-server/dist/services/memory-migration-worker.js.map +1 -0
- package/mcp-server/dist/services/memory-retrieval.d.ts +4 -0
- package/mcp-server/dist/services/memory-retrieval.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-retrieval.js +188 -40
- package/mcp-server/dist/services/memory-retrieval.js.map +1 -1
- package/mcp-server/dist/services/memory-schema.d.ts +58 -2
- package/mcp-server/dist/services/memory-schema.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-schema.js +190 -13
- package/mcp-server/dist/services/memory-schema.js.map +1 -1
- package/mcp-server/dist/services/memory-sessions.d.ts +19 -1
- package/mcp-server/dist/services/memory-sessions.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-sessions.js +56 -20
- package/mcp-server/dist/services/memory-sessions.js.map +1 -1
- package/mcp-server/dist/services/memory-verification.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-verification.js +8 -5
- package/mcp-server/dist/services/memory-verification.js.map +1 -1
- package/mcp-server/dist/services/neural-interface.d.ts +6 -0
- package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
- package/mcp-server/dist/services/neural-interface.js +19 -2
- package/mcp-server/dist/services/neural-interface.js.map +1 -1
- package/mcp-server/dist/services/retrieval-reader-worker.d.ts +2 -0
- package/mcp-server/dist/services/retrieval-reader-worker.d.ts.map +1 -0
- package/mcp-server/dist/services/retrieval-reader-worker.js +76 -0
- package/mcp-server/dist/services/retrieval-reader-worker.js.map +1 -0
- package/mcp-server/dist/services/retrieval-reader.d.ts +38 -0
- package/mcp-server/dist/services/retrieval-reader.d.ts.map +1 -0
- package/mcp-server/dist/services/retrieval-reader.js +145 -0
- package/mcp-server/dist/services/retrieval-reader.js.map +1 -0
- package/mcp-server/dist/services/sqlite-write.d.ts +14 -0
- package/mcp-server/dist/services/sqlite-write.d.ts.map +1 -0
- package/mcp-server/dist/services/sqlite-write.js +94 -0
- package/mcp-server/dist/services/sqlite-write.js.map +1 -0
- package/mcp-server/dist/services/sqlite.d.ts +39 -0
- package/mcp-server/dist/services/sqlite.d.ts.map +1 -1
- package/mcp-server/dist/services/sqlite.js +249 -8
- package/mcp-server/dist/services/sqlite.js.map +1 -1
- package/mcp-server/dist/services/tool-catalog.d.ts +1 -1
- package/mcp-server/dist/services/typesafe-config.d.ts +7 -1
- package/mcp-server/dist/services/typesafe-config.d.ts.map +1 -1
- package/mcp-server/dist/services/typesafe-config.js +32 -10
- package/mcp-server/dist/services/typesafe-config.js.map +1 -1
- package/mcp-server/dist/services/typesafe.d.ts.map +1 -1
- package/mcp-server/dist/services/typesafe.js +9 -7
- package/mcp-server/dist/services/typesafe.js.map +1 -1
- package/mcp-server/dist/services/vector-cache.d.ts +32 -0
- package/mcp-server/dist/services/vector-cache.d.ts.map +1 -1
- package/mcp-server/dist/services/vector-cache.js +161 -8
- package/mcp-server/dist/services/vector-cache.js.map +1 -1
- package/mcp-server/dist/tools/agent-definition.d.ts +2 -2
- package/mcp-server/dist/tools/agents.d.ts +13 -8
- package/mcp-server/dist/tools/agents.d.ts.map +1 -1
- package/mcp-server/dist/tools/agents.js +35 -15
- package/mcp-server/dist/tools/agents.js.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts +1 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.js +10 -3
- package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
- package/mcp-server/dist/tools/browser-extension-setup.d.ts +5 -0
- package/mcp-server/dist/tools/browser-extension-setup.d.ts.map +1 -0
- package/mcp-server/dist/tools/browser-extension-setup.js +23 -0
- package/mcp-server/dist/tools/browser-extension-setup.js.map +1 -0
- package/mcp-server/dist/tools/browser-interact.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-interact.js +6 -1
- package/mcp-server/dist/tools/browser-interact.js.map +1 -1
- package/mcp-server/dist/tools/fb-groups.d.ts +2 -2
- package/mcp-server/dist/tools/skill-tools.d.ts +4 -4
- package/mcp-server/dist/tools/tool-groups.d.ts +1 -1
- package/mcp-server/package-lock.json +2 -2
- package/mcp-server/package.json +1 -1
- package/mcp-server/src/http.ts +20 -2
- package/mcp-server/src/index.ts +59 -17
- package/mcp-server/src/services/memory-maintenance.ts +31 -28
- package/mcp-server/src/services/memory-migration-copy.ts +419 -0
- package/mcp-server/src/services/memory-migration-worker.ts +55 -0
- package/mcp-server/src/services/memory-retrieval.ts +173 -32
- package/mcp-server/src/services/memory-schema.ts +194 -12
- package/mcp-server/src/services/memory-sessions.ts +54 -21
- package/mcp-server/src/services/memory-verification.ts +7 -4
- package/mcp-server/src/services/neural-interface.ts +23 -2
- package/mcp-server/src/services/retrieval-reader-worker.ts +67 -0
- package/mcp-server/src/services/retrieval-reader.ts +131 -0
- package/mcp-server/src/services/sqlite-write.ts +60 -0
- package/mcp-server/src/services/sqlite.ts +246 -8
- package/mcp-server/src/services/typesafe-config.ts +25 -6
- package/mcp-server/src/services/typesafe.ts +9 -7
- package/mcp-server/src/services/vector-cache.ts +154 -9
- package/mcp-server/src/tools/agents.ts +33 -14
- package/mcp-server/src/tools/browser-advanced.ts +10 -3
- package/mcp-server/src/tools/browser-extension-setup.ts +30 -0
- package/mcp-server/src/tools/browser-interact.ts +5 -1
- package/neural-interface/i18n/en.json +266 -2
- package/neural-interface/i18n/pt-BR.json +267 -3
- package/neural-interface/lib/agents/builtins.json +207 -0
- package/neural-interface/lib/agents/registry.js +60 -15
- package/neural-interface/lib/agents/resolve.js +69 -10
- package/neural-interface/lib/agents/split.js +32 -4
- package/neural-interface/lib/assistant-api.js +19 -8
- package/neural-interface/lib/assistant-brains/claude.js +2 -0
- package/neural-interface/lib/assistant-brains/opencode.js +60 -11
- package/neural-interface/lib/assistant-catalog.js +2 -2
- package/neural-interface/lib/assistant-config.js +0 -7
- package/neural-interface/lib/assistant-dispatch.js +384 -119
- package/neural-interface/lib/assistant-persona.js +17 -5
- package/neural-interface/lib/assistant-pricing.js +65 -14
- package/neural-interface/lib/assistant-router.js +181 -54
- package/neural-interface/lib/assistant-run-wait.js +45 -28
- package/neural-interface/lib/assistant-runtime.js +48 -34
- package/neural-interface/lib/backup-contents.js +158 -0
- package/neural-interface/lib/backup-crypto-io.js +330 -0
- package/neural-interface/lib/backup-crypto-worker.js +130 -0
- package/neural-interface/lib/backup-crypto.js +525 -0
- package/neural-interface/lib/backup-download.js +268 -0
- package/neural-interface/lib/backup-encryption.js +318 -0
- package/neural-interface/lib/backup-groups.js +287 -0
- package/neural-interface/lib/backup-restore-session.js +176 -0
- package/neural-interface/lib/backup-restore-stage.js +60 -0
- package/neural-interface/lib/backup-service.js +836 -322
- package/neural-interface/lib/backup-zip-reader.js +30 -18
- package/neural-interface/lib/backup-zip-writer.js +34 -10
- package/neural-interface/lib/browser-extension-adapter.js +109 -24
- package/neural-interface/lib/browser-extension-bridge.js +42 -8
- package/neural-interface/lib/claude-agent-bridge.js +1 -0
- package/neural-interface/lib/claude-session-cleanup.js +5 -1
- package/neural-interface/lib/cli-update-planner.js +105 -6
- package/neural-interface/lib/client-diagnostics.js +42 -0
- package/neural-interface/lib/confined-fs.js +7 -2
- package/neural-interface/lib/coordination/README.md +8 -2
- package/neural-interface/lib/coordination/contract.js +161 -0
- package/neural-interface/lib/coordination/database.js +999 -0
- package/neural-interface/lib/coordination/operations.js +436 -0
- package/neural-interface/lib/coordination/service.js +68 -537
- package/neural-interface/lib/coordination/storage-worker.js +101 -0
- package/neural-interface/lib/coordination/store.js +219 -1111
- package/neural-interface/lib/db.js +70 -32
- package/neural-interface/lib/health-count.js +37 -0
- package/neural-interface/lib/loop-stall.js +139 -0
- package/neural-interface/lib/maritaca/client.js +2 -2
- package/neural-interface/lib/maritaca/models.js +12 -17
- package/neural-interface/lib/maritaca/opencode.js +4 -2
- package/neural-interface/lib/memory-api.js +9 -1
- package/neural-interface/lib/memory-session-capture.js +42 -10
- package/neural-interface/lib/memory-store-gate.js +313 -0
- package/neural-interface/lib/memory-store-migrate.js +65 -0
- package/neural-interface/lib/memory-timers.js +7 -7
- package/neural-interface/lib/native-loop-providers.js +13 -16
- package/neural-interface/lib/native-loop-runtime.js +34 -14
- package/neural-interface/lib/opencode-build-preflight.js +30 -8
- package/neural-interface/lib/opencode-native-boundary.js +69 -8
- package/neural-interface/lib/opencode-provider-view.js +14 -3
- package/neural-interface/lib/opencode-v2-ws-requests.js +31 -1
- package/neural-interface/lib/opencode2-client.js +2 -1
- package/neural-interface/lib/peer-identity.js +13 -8
- package/neural-interface/lib/recall-impact.js +122 -0
- package/neural-interface/lib/scratch-evidence.js +420 -0
- package/neural-interface/lib/scratch-process-guard.js +139 -0
- package/neural-interface/lib/scratch-references.js +279 -0
- package/neural-interface/lib/scratch-retention-core.js +385 -0
- package/neural-interface/lib/scratch-retention-worker.js +37 -0
- package/neural-interface/lib/scratch-retention.js +151 -0
- package/neural-interface/lib/session-cache-builder.js +70 -44
- package/neural-interface/lib/session-cache-worker.js +157 -0
- package/neural-interface/lib/session-indexer.js +28 -21
- package/neural-interface/lib/session-search-index.js +85 -0
- package/neural-interface/lib/skills/creation.js +1 -1
- package/neural-interface/lib/sqlite-integrity-worker.js +3 -1
- package/neural-interface/lib/style-guide/store.js +43 -3
- package/neural-interface/lib/system-restore.js +50 -0
- package/neural-interface/lib/teams/api.js +15 -6
- package/neural-interface/lib/teams/claims.js +67 -31
- package/neural-interface/lib/teams/index.js +7 -7
- package/neural-interface/lib/teams/integration.js +40 -40
- package/neural-interface/lib/teams/landing.js +6 -6
- package/neural-interface/lib/teams/recovery.js +24 -23
- package/neural-interface/lib/teams/scheduler.js +196 -97
- package/neural-interface/lib/teams/schema.js +1 -1
- package/neural-interface/lib/teams/state.js +14 -14
- package/neural-interface/lib/teams/worktrees.js +27 -27
- package/neural-interface/lib/whatsapp/bridge.js +2 -1
- package/neural-interface/lib/worker-confinement.js +47 -2
- package/neural-interface/lib/worker-mcp-channel.js +2 -0
- package/neural-interface/lib/worker-resume.js +5 -0
- package/neural-interface/lib/worker-stop.js +86 -0
- package/neural-interface/package-lock.json +2 -2
- package/neural-interface/package.json +1 -1
- package/neural-interface/public/index.html +260 -0
- package/neural-interface/public/offline.html +4 -3
- package/neural-interface/public/onboarding.html +259 -34
- package/neural-interface/public/shared/agents/studio/ax-agent-view.js +2 -2
- package/neural-interface/public/shared/agents/studio/ax-editor-view.js +1 -1
- package/neural-interface/public/shared/agents/studio/ax-library.js +0 -6
- package/neural-interface/public/shared/agents/studio/ax-main.js +14 -7
- package/neural-interface/public/shared/agents/studio/ax-ui.js +2 -2
- package/neural-interface/public/shared/agy/agy-options.js +11 -0
- package/neural-interface/public/shared/agy/agy-panel.js +29 -10
- package/neural-interface/public/shared/agy/agy-styles.js +14 -12
- package/neural-interface/public/shared/agy/agy-tabs-logic.js +4 -1
- package/neural-interface/public/shared/api.js +3 -2
- package/neural-interface/public/shared/assistant/asst-api.js +3 -3
- package/neural-interface/public/shared/assistant/asst-brain-picker.js +13 -6
- package/neural-interface/public/shared/assistant/asst-control.js +2 -0
- package/neural-interface/public/shared/assistant/asst-motion-gate.js +78 -4
- package/neural-interface/public/shared/assistant/asst-panel.js +18 -2
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +4 -0
- package/neural-interface/public/shared/assistant/asst-render.js +106 -38
- package/neural-interface/public/shared/assistant/asst-route.js +102 -21
- package/neural-interface/public/shared/assistant/asst-routes-editor.js +1 -1
- package/neural-interface/public/shared/assistant/asst-sidepanel.js +4 -2
- package/neural-interface/public/shared/assistant/asst-state.js +11 -0
- package/neural-interface/public/shared/assistant/asst-styles.js +10 -23
- package/neural-interface/public/shared/assistant/route-identity.js +2 -1
- package/neural-interface/public/shared/cc-dropdown.js +21 -15
- package/neural-interface/public/shared/cdx/cdx-render.js +9 -0
- package/neural-interface/public/shared/cdx/cdx-settings.js +3 -1
- package/neural-interface/public/shared/cdx/cdx-styles.js +6 -0
- package/neural-interface/public/shared/cdx/cdx-tabs.js +29 -9
- package/neural-interface/public/shared/client-diagnostics.js +94 -0
- package/neural-interface/public/shared/cp/cp-markdown.js +7 -2
- package/neural-interface/public/shared/cp/cp-styles.js +1 -1
- package/neural-interface/public/shared/effort-i18n.js +118 -0
- package/neural-interface/public/shared/html-shell.js +4 -51
- package/neural-interface/public/shared/loading-diagnostic-entry.js +64 -0
- package/neural-interface/public/shared/memory-store-wait.js +52 -0
- package/neural-interface/public/shared/morelogin-profile-field.js +1 -1
- package/neural-interface/public/shared/mtc/mtc-logic.js +2 -1
- package/neural-interface/public/shared/mtc/mtc-panel.js +8 -1
- package/neural-interface/public/shared/mtc/mtc-styles.js +13 -12
- package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +7 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-location-logic.js +109 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-modelpicker.js +8 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +118 -6
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +27 -3
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +13 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-session-actions.js +2 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +27 -93
- package/neural-interface/public/shared/ocp-v2/ocp-v2-variantpicker.js +17 -6
- package/neural-interface/public/shared/output-format.js +294 -0
- package/neural-interface/public/shared/owner-authority-view.js +4 -10
- package/neural-interface/public/shared/page-session.js +1 -1
- package/neural-interface/public/shared/provider-icons.js +6 -0
- package/neural-interface/public/shared/schedules-view.js +2 -1
- package/neural-interface/public/shared/server-presence.js +77 -0
- package/neural-interface/public/shared/settings/settings-ai-browser.js +5 -5
- package/neural-interface/public/shared/settings/settings-backup-contents.js +241 -0
- package/neural-interface/public/shared/settings/settings-backup-download.js +298 -0
- package/neural-interface/public/shared/settings/settings-backup-encryption-pane.js +335 -0
- package/neural-interface/public/shared/settings/settings-backup-encryption.js +545 -0
- package/neural-interface/public/shared/settings/settings-ia.js +1 -1
- package/neural-interface/public/shared/skills/studio/sx-geometry.js +12 -3
- package/neural-interface/public/shared/skills/studio/sx-main.js +14 -7
- package/neural-interface/public/shared/start-bridge.js +2 -2
- package/neural-interface/public/shared/studio-attention.js +6 -0
- package/neural-interface/public/shared/styles.css +354 -438
- package/neural-interface/public/shared/transcript-rows.js +28 -3
- package/neural-interface/public/shared/tray-auto-close.js +18 -5
- package/neural-interface/public/shared/ui-agents.js +1 -2
- package/neural-interface/public/shared/ui-automation-studio.js +168 -108
- package/neural-interface/public/shared/ui-claude-panel.js +42 -65
- package/neural-interface/public/shared/ui-loading.js +185 -25
- package/neural-interface/public/shared/ui-native-loop-router.js +59 -20
- package/neural-interface/public/shared/ui-navbar.js +2 -1
- package/neural-interface/public/shared/ui-output.js +533 -0
- package/neural-interface/public/shared/ui-owner-authority.js +48 -25
- package/neural-interface/public/shared/ui-schedules-studio.js +165 -128
- package/neural-interface/public/shared/ui-scroll-follow.js +97 -6
- package/neural-interface/public/shared/ui-sessions.js +2 -2
- package/neural-interface/public/shared/ui-settings-entry.js +18 -0
- package/neural-interface/public/shared/ui-settings.js +234 -67
- package/neural-interface/public/shared/ui-sidepanel-tray.js +3 -2
- package/neural-interface/public/shared/ui-sync.js +1 -0
- package/neural-interface/public/shared/ui-tooltip.js +16 -0
- package/neural-interface/public/shared/ui-tutorial.js +5 -6
- package/neural-interface/public/shared/ui-worker-end.js +27 -8
- package/neural-interface/public/shared/worker-end.js +9 -4
- package/neural-interface/public/sw.js +4 -3
- package/neural-interface/public/variant/2d/main.js +5 -0
- package/neural-interface/public/variant/3d/app.js +10 -0
- package/neural-interface/public/variant/3d/main.js +17 -4
- package/neural-interface/scripts/scratch-retention.mjs +20 -0
- package/neural-interface/server.js +507 -160
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -1
- package/scripts/restore-data-home-from-backup.mjs +175 -8
- package/setup.js +18 -4
|
@@ -7,7 +7,7 @@ import { configureToolPickerTranslation, toolPickerHTML, readToolPicker, updateT
|
|
|
7
7
|
|
|
8
8
|
import { emit, on } from './state.js';
|
|
9
9
|
import { storage } from './storage.js';
|
|
10
|
-
import { frameRect
|
|
10
|
+
import { frameRect } from './app-frame.js';
|
|
11
11
|
import { t, tp, getLocale } from './i18n.js';
|
|
12
12
|
import { KEYS } from './constants.js';
|
|
13
13
|
import { isGuest, hasPermission, showGuestToast } from './ui-sync.js';
|
|
@@ -105,12 +105,21 @@ const $ = (id) => document.getElementById(id);
|
|
|
105
105
|
const PANEL_ID = 'schedules-studio-panel';
|
|
106
106
|
const POLL_INTERVAL = 1000;
|
|
107
107
|
const LAYOUT_KEY = KEYS.PANEL_PREFIX + 'schedules-window';
|
|
108
|
+
const DOCK_KEY = 'sched-window-docked';
|
|
109
|
+
const DIM_KEY = 'sched-window-dim';
|
|
110
|
+
const RAIL_KEY = 'sched-window-rail-collapsed';
|
|
108
111
|
const SCOPE_KEY = 'sched-view-scope';
|
|
109
112
|
const SORT_KEY = 'sched-view-sort';
|
|
110
113
|
const COLLAPSED_KEY = 'sched-collapsed-groups';
|
|
111
114
|
const REOPEN_KEY = 'synabun-schedules-reopen'; // sessionStorage, for one reload
|
|
112
115
|
const DEFAULT_GROUP_COLOR = '#4fc3f7';
|
|
113
116
|
|
|
117
|
+
// The Studios' icons and window geometry load on the first open: this module is loaded before the page is shown and
|
|
118
|
+
// the boot budget (tests/boot-critical-path.test.mjs) has no room for them. A close during that load cancels the open.
|
|
119
|
+
let studioIcons = null;
|
|
120
|
+
let studioOpenRect = null;
|
|
121
|
+
let _shellLoads = 0;
|
|
122
|
+
let _closeCount = 0;
|
|
114
123
|
let _panel = null;
|
|
115
124
|
let _backdrop = null;
|
|
116
125
|
let _abort = null; // the window's document/window listeners
|
|
@@ -338,7 +347,7 @@ export function initSchedulesStudio() {
|
|
|
338
347
|
registerLaunchPrefetch('schedules', () => (isGuest() && !hasPermission('automations') ? undefined : loadData()), { order: 74 });
|
|
339
348
|
on('automations:open-schedules', (opts) => openPanel(opts || {}));
|
|
340
349
|
on('schedules:open', (opts) => openPanel(opts || {}));
|
|
341
|
-
on('schedules:toggle', () => (_panel ? closePanel() : openPanel({})));
|
|
350
|
+
on('schedules:toggle', () => (_panel || _shellLoads ? closePanel() : openPanel({})));
|
|
342
351
|
setupSync();
|
|
343
352
|
// A language change reloads the app (i18n.js): an open window opens again, in the new language,
|
|
344
353
|
// on the view it showed (Settings does the same for itself).
|
|
@@ -364,6 +373,20 @@ async function openPanel(opts = {}) {
|
|
|
364
373
|
showGuestToast(t('schedules.window.guestDisabled'));
|
|
365
374
|
return;
|
|
366
375
|
}
|
|
376
|
+
if (!studioIcons) {
|
|
377
|
+
const closesBefore = _closeCount;
|
|
378
|
+
_shellLoads++;
|
|
379
|
+
try {
|
|
380
|
+
const [{ ICONS }, { openRect }] = await Promise.all([
|
|
381
|
+
import('./skills/studio/sx-dom.js'), import('./skills/studio/sx-geometry.js'),
|
|
382
|
+
]);
|
|
383
|
+
studioIcons = ICONS;
|
|
384
|
+
studioOpenRect = openRect;
|
|
385
|
+
} finally {
|
|
386
|
+
_shellLoads--;
|
|
387
|
+
}
|
|
388
|
+
if (_closeCount !== closesBefore) return;
|
|
389
|
+
}
|
|
367
390
|
if (_panel) {
|
|
368
391
|
// Rebuilt only when the request changes what shows: an open editor keeps what is typed in it.
|
|
369
392
|
if (applyOpenOptions(opts)) render({ frame: true });
|
|
@@ -382,7 +405,7 @@ async function openPanel(opts = {}) {
|
|
|
382
405
|
document.body.appendChild(_backdrop);
|
|
383
406
|
|
|
384
407
|
_panel = document.createElement('section');
|
|
385
|
-
_panel.className = 'schedules-studio-panel glass resizable';
|
|
408
|
+
_panel.className = 'skills-studio-panel sx schedules-studio-panel glass resizable';
|
|
386
409
|
_panel.id = PANEL_ID;
|
|
387
410
|
_panel.setAttribute('role', 'region');
|
|
388
411
|
_panel.setAttribute('aria-labelledby', 'sched-title');
|
|
@@ -390,6 +413,7 @@ async function openPanel(opts = {}) {
|
|
|
390
413
|
document.body.appendChild(_panel);
|
|
391
414
|
document.body.classList.add('schedules-window-open');
|
|
392
415
|
placePanel();
|
|
416
|
+
syncWindowControls();
|
|
393
417
|
|
|
394
418
|
wirePanel();
|
|
395
419
|
// Before the options: an editor asked for waits for the data (applyOpenOptions). Lists that arrived once (an
|
|
@@ -436,32 +460,46 @@ function applyOpenOptions(opts = {}) {
|
|
|
436
460
|
|
|
437
461
|
function placePanel() {
|
|
438
462
|
const saved = readJson(LAYOUT_KEY, null);
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
}
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
const
|
|
448
|
-
const
|
|
449
|
-
const
|
|
450
|
-
_panel.
|
|
451
|
-
_panel.
|
|
463
|
+
const rect = studioOpenRect({
|
|
464
|
+
vw: window.innerWidth, vh: window.innerHeight, frame: frameRect(),
|
|
465
|
+
saved: saved && { left: saved.x, top: saved.y },
|
|
466
|
+
});
|
|
467
|
+
for (const [key, value] of Object.entries(rect)) _panel.style[key] = value + 'px';
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function syncWindowControls() {
|
|
471
|
+
const docked = storage.getItem(DOCK_KEY) === 'true';
|
|
472
|
+
const dimmed = !docked && storage.getItem(DIM_KEY) !== 'false';
|
|
473
|
+
const collapsed = storage.getItem(RAIL_KEY) === 'true';
|
|
474
|
+
_panel.classList.toggle('sx-docked', docked);
|
|
475
|
+
_panel.classList.toggle('sx-rail-collapsed', collapsed);
|
|
476
|
+
_panel.querySelector('.sx-head').classList.toggle('drag-handle', !docked);
|
|
477
|
+
document.body.classList.toggle('sched-studio-docked', docked);
|
|
478
|
+
_backdrop.classList.toggle('backdrop-hidden', !dimmed);
|
|
479
|
+
const dock = $('sched-dock-toggle');
|
|
480
|
+
dock.innerHTML = String(docked ? studioIcons.undock : studioIcons.dock);
|
|
481
|
+
dock.setAttribute('aria-pressed', String(docked));
|
|
482
|
+
$('sched-rail-toggle').setAttribute('aria-pressed', String(collapsed));
|
|
483
|
+
const dim = $('sched-backdrop-toggle');
|
|
484
|
+
dim.disabled = docked;
|
|
485
|
+
dim.title = t(dimmed ? 'schedules.window.hideBackdrop' : 'schedules.window.showBackdrop');
|
|
486
|
+
dim.setAttribute('aria-pressed', String(dimmed));
|
|
452
487
|
}
|
|
453
488
|
|
|
454
489
|
function saveLayout() {
|
|
455
|
-
if (!_panel) return;
|
|
490
|
+
if (!_panel || _panel.classList.contains('sx-docked')) return;
|
|
456
491
|
const rect = _panel.getBoundingClientRect();
|
|
492
|
+
// Only the position is used on open; a size saved earlier is left as it was.
|
|
493
|
+
const before = readJson(LAYOUT_KEY, null);
|
|
457
494
|
try {
|
|
458
495
|
storage.setItem(LAYOUT_KEY, JSON.stringify({
|
|
459
|
-
|
|
496
|
+
...(before && typeof before === 'object' ? before : {}), x: Math.round(rect.left), y: Math.round(rect.top),
|
|
460
497
|
}));
|
|
461
498
|
} catch { /* the default layout is used next time */ }
|
|
462
499
|
}
|
|
463
500
|
|
|
464
501
|
function closePanel() {
|
|
502
|
+
_closeCount++;
|
|
465
503
|
if (!_panel) return;
|
|
466
504
|
saveLayout();
|
|
467
505
|
stopPolling();
|
|
@@ -481,7 +519,7 @@ function closePanel() {
|
|
|
481
519
|
_groupEditorId = null;
|
|
482
520
|
_groupEditorDraft = null;
|
|
483
521
|
_draggingScheduleId = null;
|
|
484
|
-
document.body.classList.remove('schedules-window-open');
|
|
522
|
+
document.body.classList.remove('schedules-window-open', 'sched-studio-docked');
|
|
485
523
|
emit('schedules:window', { open: false });
|
|
486
524
|
const opener = _opener;
|
|
487
525
|
_opener = null;
|
|
@@ -499,29 +537,30 @@ function focusInitial() {
|
|
|
499
537
|
function buildPanelHTML() {
|
|
500
538
|
return `
|
|
501
539
|
${['t', 'r', 'b', 'l', 'tl', 'tr', 'bl', 'br'].map(edge => `<div aria-hidden="true" class="resize-handle resize-handle-${edge}" data-resize="${edge}"></div>`).join('')}
|
|
502
|
-
<header class="
|
|
503
|
-
<
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
</
|
|
508
|
-
<button type="button" class="
|
|
509
|
-
<button type="button" class="
|
|
540
|
+
<header class="sx-head drag-handle" data-drag="${PANEL_ID}">
|
|
541
|
+
<span class="sx-head-mark" aria-hidden="true">${ICONS.clock}</span>
|
|
542
|
+
<h3 class="sx-title" id="sched-title">${te('schedules.window.title')}</h3>
|
|
543
|
+
<span class="sx-head-note" id="sched-total-count"></span>
|
|
544
|
+
<span class="sx-spacer"></span>
|
|
545
|
+
<button type="button" class="sx-icon-btn" id="sched-rail-toggle" aria-controls="sched-rail" aria-label="${te('skillsStudio.shell.collapseRail')}" title="${te('skillsStudio.shell.collapseRail')}">${studioIcons.library}</button>
|
|
546
|
+
<button type="button" class="sx-icon-btn" id="sched-dock-toggle" aria-label="${te('skillsStudio.shell.dock')}" title="${te('skillsStudio.shell.dockHelp')}"></button>
|
|
547
|
+
<button type="button" class="sx-icon-btn" id="sched-backdrop-toggle" aria-label="${te('skillsStudio.shell.dim')}" title="${te('skillsStudio.shell.dim')}">${studioIcons.dim}</button>
|
|
548
|
+
<button type="button" class="sx-icon-btn sx-close" id="sched-close" aria-label="${te('schedules.window.close')}" title="${te('schedules.window.closeTip')}">${studioIcons.close}</button>
|
|
510
549
|
</header>
|
|
511
|
-
<div class="sched-body">
|
|
512
|
-
<nav class="sched-rail" id="sched-rail" aria-label="${te('schedules.window.railLabel')}"></nav>
|
|
513
|
-
<section class="sched-main" aria-labelledby="sched-view-title">
|
|
550
|
+
<div class="sx-body sched-body">
|
|
551
|
+
<nav class="sx-rail sched-rail" id="sched-rail" aria-label="${te('schedules.window.railLabel')}"></nav>
|
|
552
|
+
<section class="sx-main sched-main" aria-labelledby="sched-view-title">
|
|
514
553
|
<!-- A window too narrow for the rail: its views and groups as a popup, and New group. Outside
|
|
515
554
|
the frame below, which each view and editor replaces, so it is there in every one. -->
|
|
516
555
|
<div class="sched-narrow-nav" id="sched-narrow-nav">
|
|
517
556
|
<span class="sched-sr" id="sched-scope-label">${te('schedules.window.viewLabel')}</span>
|
|
518
557
|
${dropdownHTML('sched-scope-select', [], { classes: 'sched-scope-select', labelledBy: 'sched-scope-label', inputAttrs: 'data-change="scope"' })}
|
|
519
|
-
<button type="button" class="sched-btn" data-action="group-new" id="sched-narrow-new-group">${ICONS.plus}<span>${te('schedules.rail.newGroup')}</span></button>
|
|
558
|
+
<button type="button" class="sx-btn sched-btn" data-action="group-new" id="sched-narrow-new-group">${ICONS.plus}<span>${te('schedules.rail.newGroup')}</span></button>
|
|
520
559
|
</div>
|
|
521
560
|
<div class="sched-frame" id="sched-main"></div>
|
|
522
561
|
</section>
|
|
523
562
|
</div>
|
|
524
|
-
<div class="sched-dialog-layer" id="sched-dialog-layer" hidden></div>
|
|
563
|
+
<div class="ss-file-dialog-overlay sched-dialog-layer" id="sched-dialog-layer" hidden></div>
|
|
525
564
|
`;
|
|
526
565
|
}
|
|
527
566
|
|
|
@@ -529,16 +568,14 @@ function wirePanel() {
|
|
|
529
568
|
_abort = new AbortController();
|
|
530
569
|
const { signal } = _abort;
|
|
531
570
|
$('sched-close')?.addEventListener('click', closePanel, { signal });
|
|
532
|
-
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
btn.dataset.tooltip = label;
|
|
541
|
-
}, { signal });
|
|
571
|
+
for (const [id, key] of [['sched-rail-toggle', RAIL_KEY], ['sched-dock-toggle', DOCK_KEY], ['sched-backdrop-toggle', DIM_KEY]]) {
|
|
572
|
+
const button = $(id);
|
|
573
|
+
button.addEventListener('click', () => {
|
|
574
|
+
if (key === DOCK_KEY) saveLayout(); // Save the floating rectangle before docking.
|
|
575
|
+
storage.setItem(key, String(button.getAttribute('aria-pressed') !== 'true'));
|
|
576
|
+
syncWindowControls();
|
|
577
|
+
}, { signal });
|
|
578
|
+
}
|
|
542
579
|
|
|
543
580
|
_panel.addEventListener('click', handleClick, { signal });
|
|
544
581
|
_panel.addEventListener('change', handleChange, { signal });
|
|
@@ -725,8 +762,8 @@ function renderRail() {
|
|
|
725
762
|
const view = (scope, count, { alert = false } = {}) => {
|
|
726
763
|
const { icon } = VIEWS[scope];
|
|
727
764
|
const current = _scope === scope;
|
|
728
|
-
const countHTML = count == null || !countsKnown() ? '' : `<span class="sched-nav-count${alert && count ? ' sched-nav-count--alert' : ''}">${count}</span>`;
|
|
729
|
-
return `<button type="button" class="sched-nav-item" data-action="set-scope" data-scope="${scope}"${current ? ' aria-current="page"' : ''}>
|
|
765
|
+
const countHTML = count == null || !countsKnown() ? '' : `<span class="sx-rail-count sched-nav-count${alert && count ? ' sched-nav-count--alert' : ''}">${count}</span>`;
|
|
766
|
+
return `<button type="button" class="sx-rail-item sched-nav-item" data-action="set-scope" data-scope="${scope}"${current ? ' aria-current="page"' : ''}>
|
|
730
767
|
<span class="sched-nav-icon">${icon}</span><span class="sched-nav-label">${esc(viewLabel(scope))}</span>${countHTML}</button>`;
|
|
731
768
|
};
|
|
732
769
|
const groupRows = orderedGroups().map(group => {
|
|
@@ -739,12 +776,12 @@ function renderRail() {
|
|
|
739
776
|
group.mutualExclusion ? t('schedules.rail.oneAtATimeFact') : '',
|
|
740
777
|
].filter(Boolean).join(', ');
|
|
741
778
|
const name = t('schedules.rail.groupLabel', { name: group.name, facts });
|
|
742
|
-
return `<button type="button" class="sched-nav-item" data-action="set-scope" data-scope="${esc(scope)}" data-drop-group="${esc(group.id)}" aria-label="${esc(name)}"${_scope === scope ? ' aria-current="page"' : ''}>
|
|
779
|
+
return `<button type="button" class="sx-rail-item sched-nav-item" data-action="set-scope" data-scope="${esc(scope)}" data-drop-group="${esc(group.id)}" aria-label="${esc(name)}"${_scope === scope ? ' aria-current="page"' : ''}>
|
|
743
780
|
<span class="sched-nav-icon"><span class="sched-dot" style="--dot:${esc(cssColor(group.color))}"></span></span>
|
|
744
781
|
<span class="sched-nav-label">${esc(group.name)}</span>
|
|
745
782
|
${group.mutualExclusion ? `<span class="sched-nav-flag" data-tooltip="${te('schedules.oneAtATime')}">${ICONS.lock}</span>` : ''}
|
|
746
783
|
${summary.attention ? `<span class="sched-nav-flag sched-nav-flag--alert" data-tooltip="${tpe('schedules.rail.attentionTip', summary.attention)}">${ICONS.alert}${summary.attention}</span>` : ''}
|
|
747
|
-
<span class="sched-nav-count">${summary.total}</span>
|
|
784
|
+
<span class="sx-rail-count sched-nav-count">${summary.total}</span>
|
|
748
785
|
</button>`;
|
|
749
786
|
}).join('');
|
|
750
787
|
const ungrouped = _schedules.filter(s => !s.groupId || !ids.has(s.groupId)).length;
|
|
@@ -763,11 +800,11 @@ function renderRail() {
|
|
|
763
800
|
<div class="sched-rail-sep" role="presentation"></div>
|
|
764
801
|
${view('timers', timers || null)}
|
|
765
802
|
${view('activity', null)}
|
|
766
|
-
<div class="sched-rail-head"><span id="sched-rail-groups">${te('schedules.rail.groups')}</span><button type="button" class="sched-icon-btn" data-action="group-new" aria-label="${te('schedules.rail.newGroup')}" data-tooltip="${te('schedules.rail.newGroup')}"${editorsWait() ? ' disabled' : ''}>${ICONS.plus}</button></div>
|
|
803
|
+
<div class="sched-rail-head"><span id="sched-rail-groups">${te('schedules.rail.groups')}</span><button type="button" class="sx-icon-btn sched-icon-btn" data-action="group-new" aria-label="${te('schedules.rail.newGroup')}" data-tooltip="${te('schedules.rail.newGroup')}"${editorsWait() ? ' disabled' : ''}>${ICONS.plus}</button></div>
|
|
767
804
|
<div role="group" aria-labelledby="sched-rail-groups">
|
|
768
805
|
${groupRows || (countsKnown() ? `<div class="sched-rail-empty">${te('schedules.rail.noGroups')}</div>` : '')}
|
|
769
|
-
<button type="button" class="sched-nav-item" data-action="set-scope" data-scope="ungrouped" data-drop-group="" aria-label="${countsKnown() ? te('schedules.rail.groupLabel', { name: viewLabel('ungrouped'), facts: tp('schedules.count.schedules', ungrouped) }) : esc(viewLabel('ungrouped'))}"${_scope === 'ungrouped' ? ' aria-current="page"' : ''}>
|
|
770
|
-
<span class="sched-nav-icon">${ICONS.folder}</span><span class="sched-nav-label">${esc(viewLabel('ungrouped'))}</span><span class="sched-nav-count">${countsKnown() ? ungrouped : ''}</span>
|
|
806
|
+
<button type="button" class="sx-rail-item sched-nav-item" data-action="set-scope" data-scope="ungrouped" data-drop-group="" aria-label="${countsKnown() ? te('schedules.rail.groupLabel', { name: viewLabel('ungrouped'), facts: tp('schedules.count.schedules', ungrouped) }) : esc(viewLabel('ungrouped'))}"${_scope === 'ungrouped' ? ' aria-current="page"' : ''}>
|
|
807
|
+
<span class="sched-nav-icon">${ICONS.folder}</span><span class="sched-nav-label">${esc(viewLabel('ungrouped'))}</span><span class="sx-rail-count sched-nav-count">${countsKnown() ? ungrouped : ''}</span>
|
|
771
808
|
</button>
|
|
772
809
|
</div>
|
|
773
810
|
`;
|
|
@@ -814,14 +851,14 @@ function buildListFrame(frame) {
|
|
|
814
851
|
const search = document.activeElement?.id === 'sched-search' ? document.activeElement : null;
|
|
815
852
|
const caret = search ? [search.selectionStart, search.selectionEnd] : null;
|
|
816
853
|
main.innerHTML = `
|
|
817
|
-
<div class="sched-view-head" id="sched-view-head"></div>
|
|
854
|
+
<div class="sx-place-head sched-view-head" id="sched-view-head"></div>
|
|
818
855
|
<div class="sched-toolbar">
|
|
819
856
|
<div class="sched-search">
|
|
820
857
|
${ICONS.search}
|
|
821
858
|
<label class="sched-sr" for="sched-search">${activity ? te('schedules.list.searchRuns') : te('schedules.list.searchSchedules')}</label>
|
|
822
859
|
<input id="sched-search" type="search" autocomplete="off" spellcheck="false"
|
|
823
860
|
placeholder="${activity ? te('schedules.list.searchRunsPlaceholder') : te('schedules.list.searchPlaceholder')}" value="${esc(_query)}">
|
|
824
|
-
<button type="button" class="sched-icon-btn" data-action="clear-search" aria-label="${te('schedules.list.clearSearch')}"${_query ? '' : ' hidden'}>${ICONS.close}</button>
|
|
861
|
+
<button type="button" class="sx-icon-btn sched-icon-btn" data-action="clear-search" aria-label="${te('schedules.list.clearSearch')}"${_query ? '' : ' hidden'}>${ICONS.close}</button>
|
|
825
862
|
<kbd aria-hidden="true">/</kbd>
|
|
826
863
|
</div>
|
|
827
864
|
${activity ? '' : `<span class="sched-sort" id="sched-sort-wrap"><span class="sched-sr" id="sched-sort-label">${te('schedules.list.order')}</span>
|
|
@@ -849,9 +886,9 @@ function headActions({ group = null } = {}) {
|
|
|
849
886
|
// An editor needs the automations and groups: nothing opens one before they have loaded.
|
|
850
887
|
const wait = editorsWait() ? ' disabled' : '';
|
|
851
888
|
return `<div class="sched-view-actions">
|
|
852
|
-
${group ? `<button type="button" class="sched-btn" data-action="group-edit" data-id="${esc(group.id)}"${wait}>${ICONS.edit}<span>${te('schedules.head.editGroup')}</span></button>` : ''}
|
|
853
|
-
<button type="button" class="
|
|
854
|
-
<button type="button" class="
|
|
889
|
+
${group ? `<button type="button" class="sx-btn sched-btn" data-action="group-edit" data-id="${esc(group.id)}"${wait}>${ICONS.edit}<span>${te('schedules.head.editGroup')}</span></button>` : ''}
|
|
890
|
+
<button type="button" class="sx-btn sched-btn sx-btn--ghost" data-action="schedule-prompt" data-tooltip="${te('schedules.head.promptTip')}">${ICONS.sparkle}<span>${te('schedules.head.prompt')}</span></button>
|
|
891
|
+
<button type="button" class="sx-btn sched-btn sx-btn--primary" data-action="schedule-new"${wait}>${ICONS.plus}<span>${te('schedules.head.newSchedule')}</span></button>
|
|
855
892
|
</div>`;
|
|
856
893
|
}
|
|
857
894
|
|
|
@@ -925,7 +962,7 @@ function renderViewHead() {
|
|
|
925
962
|
head.dataset.key = key;
|
|
926
963
|
head.innerHTML = `
|
|
927
964
|
<div class="sched-view-titles">
|
|
928
|
-
<h2 id="sched-view-title">${dot}${esc(title)}</h2>
|
|
965
|
+
<h2 class="sx-place-title" id="sched-view-title">${dot}${esc(title)}</h2>
|
|
929
966
|
<p class="sched-view-sub">${esc(sub)}</p>
|
|
930
967
|
${meta}
|
|
931
968
|
</div>
|
|
@@ -980,8 +1017,8 @@ function renderNote() {
|
|
|
980
1017
|
note.classList.toggle('sched-load-note--ok', kind === 'ok');
|
|
981
1018
|
note.classList.toggle('sched-load-note--busy', kind === 'busy');
|
|
982
1019
|
const icon = kind === 'ok' ? ICONS.ok : kind === 'busy' ? ICONS.clock : ICONS.alert;
|
|
983
|
-
const action = kind === 'load' ? `<button type="button" class="sched-btn" data-action="retry-load">${te('schedules.note.tryAgain')}</button>`
|
|
984
|
-
: kind === 'busy' ? '' : `<button type="button" class="sched-btn" data-action="dismiss-report">${te('schedules.note.dismiss')}</button>`;
|
|
1020
|
+
const action = kind === 'load' ? `<button type="button" class="sx-btn sched-btn" data-action="retry-load">${te('schedules.note.tryAgain')}</button>`
|
|
1021
|
+
: kind === 'busy' ? '' : `<button type="button" class="sx-btn sched-btn" data-action="dismiss-report">${te('schedules.note.dismiss')}</button>`;
|
|
985
1022
|
note.innerHTML = text ? `${icon}<span>${esc(text)}</span>${action}` : '';
|
|
986
1023
|
}
|
|
987
1024
|
|
|
@@ -1005,7 +1042,7 @@ function cliReportNote() {
|
|
|
1005
1042
|
function loadFailedHTML() {
|
|
1006
1043
|
const waiting = _pendingAction ? t(_pendingAction === 'new-group' ? 'schedules.loadFailed.waitingGroup' : 'schedules.loadFailed.waitingSchedule') : '';
|
|
1007
1044
|
return emptyState(ICONS.alert, t('schedules.loadFailed.title'), [_loadError || t('schedules.loadFailed.notEverything'), waiting].filter(Boolean).join(' '),
|
|
1008
|
-
`<button type="button" class="sched-btn" data-action="retry-load">${te('schedules.note.tryAgain')}</button>`);
|
|
1045
|
+
`<button type="button" class="sx-btn sched-btn" data-action="retry-load">${te('schedules.note.tryAgain')}</button>`);
|
|
1009
1046
|
}
|
|
1010
1047
|
|
|
1011
1048
|
/** Keep the place: scroll position and the focused control survive a re-render of the list. */
|
|
@@ -1077,14 +1114,14 @@ function renderList() {
|
|
|
1077
1114
|
const query = _query.trim();
|
|
1078
1115
|
if (!_schedules.length) {
|
|
1079
1116
|
list.innerHTML = emptyState(ICONS.clock, t('schedules.empty.none'), t('schedules.empty.noneText'),
|
|
1080
|
-
`<button type="button" class="
|
|
1081
|
-
<button type="button" class="sched-btn" data-action="schedule-prompt">${ICONS.sparkle}<span>${te('schedules.head.prompt')}</span></button>`);
|
|
1117
|
+
`<button type="button" class="sx-btn sched-btn sx-btn--primary" data-action="schedule-new">${ICONS.plus}<span>${te('schedules.head.newSchedule')}</span></button>
|
|
1118
|
+
<button type="button" class="sx-btn sched-btn" data-action="schedule-prompt">${ICONS.sparkle}<span>${te('schedules.head.prompt')}</span></button>`);
|
|
1082
1119
|
} else if (!shown.length && query) {
|
|
1083
1120
|
const elsewhere = _scope !== 'all' && _schedules.some(s => matchesQuery(s, _query, scheduleExtras(s)));
|
|
1084
1121
|
list.innerHTML = emptyState(ICONS.search, t('schedules.empty.noMatch', { query }),
|
|
1085
1122
|
elsewhere ? t('schedules.empty.elsewhere') : t('schedules.empty.tryAnother'),
|
|
1086
|
-
`<button type="button" class="sched-btn" data-action="clear-search">${te('schedules.list.clearSearch')}</button>
|
|
1087
|
-
${elsewhere ? `<button type="button" class="sched-btn" data-action="search-all">${te('schedules.empty.searchAll')}</button>` : ''}`);
|
|
1123
|
+
`<button type="button" class="sx-btn sched-btn" data-action="clear-search">${te('schedules.list.clearSearch')}</button>
|
|
1124
|
+
${elsewhere ? `<button type="button" class="sx-btn sched-btn" data-action="search-all">${te('schedules.empty.searchAll')}</button>` : ''}`);
|
|
1088
1125
|
} else if (!shown.length) {
|
|
1089
1126
|
list.innerHTML = scopeEmptyState();
|
|
1090
1127
|
} else if (_scope === 'all') {
|
|
@@ -1100,9 +1137,9 @@ function renderList() {
|
|
|
1100
1137
|
}
|
|
1101
1138
|
|
|
1102
1139
|
function emptyState(icon, title, text, actions = '') {
|
|
1103
|
-
return `<div class="sched-empty">
|
|
1104
|
-
<div class="sched-empty-icon">${icon}</div>
|
|
1105
|
-
<h3>${esc(title)}</h3>
|
|
1140
|
+
return `<div class="sx-empty sched-empty">
|
|
1141
|
+
<div class="sx-placeholder-icon sched-empty-icon">${icon}</div>
|
|
1142
|
+
<h3 class="sx-empty-title">${esc(title)}</h3>
|
|
1106
1143
|
${text ? `<p>${esc(text)}</p>` : ''}
|
|
1107
1144
|
${actions ? `<div class="sched-empty-actions">${actions}</div>` : ''}
|
|
1108
1145
|
</div>`;
|
|
@@ -1114,7 +1151,7 @@ function scopeEmptyState() {
|
|
|
1114
1151
|
if (_scope === 'upcoming') return emptyState(ICONS.next, t('schedules.empty.upcoming'), t('schedules.empty.upcomingText'));
|
|
1115
1152
|
if (_scope === 'ungrouped') return emptyState(ICONS.folder, t('schedules.empty.ungrouped'), '');
|
|
1116
1153
|
return emptyState(ICONS.folder, t('schedules.empty.group'), t('schedules.empty.groupText'),
|
|
1117
|
-
`<button type="button" class="
|
|
1154
|
+
`<button type="button" class="sx-btn sched-btn sx-btn--primary" data-action="schedule-new">${ICONS.plus}<span>${te('schedules.head.newSchedule')}</span></button>`);
|
|
1118
1155
|
}
|
|
1119
1156
|
|
|
1120
1157
|
/** All schedules: one box per group, in the groups' order, then the ungrouped ones. */
|
|
@@ -1143,7 +1180,7 @@ function renderGroupedList(shown, now) {
|
|
|
1143
1180
|
<span class="sched-group-count">${items.length === all.length ? items.length : te('schedules.list.shownOf', { shown: items.length, total: all.length })}</span>
|
|
1144
1181
|
</button>
|
|
1145
1182
|
${meta ? `<span class="sched-group-meta">${meta}</span>` : ''}
|
|
1146
|
-
${group ? `<button type="button" class="sched-icon-btn" data-action="group-edit" data-id="${esc(group.id)}" aria-label="${te('schedules.list.editGroupNamed', { name })}" data-tooltip="${te('schedules.head.editGroup')}">${ICONS.edit}</button>` : ''}
|
|
1183
|
+
${group ? `<button type="button" class="sx-icon-btn sched-icon-btn" data-action="group-edit" data-id="${esc(group.id)}" aria-label="${te('schedules.list.editGroupNamed', { name })}" data-tooltip="${te('schedules.head.editGroup')}">${ICONS.edit}</button>` : ''}
|
|
1147
1184
|
</div>
|
|
1148
1185
|
<ul class="sched-rows" id="${listId}" aria-label="${esc(name)}"${collapsed ? ' hidden' : ''}>
|
|
1149
1186
|
${sortSchedules(items, _sort).map(s => rowHTML(s, { now, showGroup: false })).join('')}
|
|
@@ -1279,10 +1316,10 @@ function detailHTML(s, now, run) {
|
|
|
1279
1316
|
${dropdownHTML(`sched-move-${domId(s.id)}`, groupOptions, { label: t('schedules.detail.groupOf', { name: s.name }), inputAttrs: `data-change="move-group" data-id="${esc(s.id)}"` })}
|
|
1280
1317
|
</div>
|
|
1281
1318
|
<span class="sched-detail-spacer"></span>
|
|
1282
|
-
<button type="button" class="sched-btn" data-action="schedule-test" data-id="${esc(s.id)}" data-tooltip="${te('schedules.detail.runNowTip')}">${ICONS.bolt}<span>${te('schedules.detail.runNow')}</span></button>
|
|
1283
|
-
<button type="button" class="sched-btn" data-action="schedule-edit-prompt" data-id="${esc(s.id)}" data-template-id="${esc(s.templateId || '')}" data-tooltip="${te('schedules.detail.editPromptTip')}">${ICONS.script}<span>${te('schedules.detail.editPrompt')}</span></button>
|
|
1284
|
-
<button type="button" class="sched-btn" data-action="schedule-edit" data-id="${esc(s.id)}">${ICONS.edit}<span>${te('schedules.detail.editSchedule')}</span></button>
|
|
1285
|
-
<button type="button" class="
|
|
1319
|
+
<button type="button" class="sx-btn sched-btn" data-action="schedule-test" data-id="${esc(s.id)}" data-tooltip="${te('schedules.detail.runNowTip')}">${ICONS.bolt}<span>${te('schedules.detail.runNow')}</span></button>
|
|
1320
|
+
<button type="button" class="sx-btn sched-btn" data-action="schedule-edit-prompt" data-id="${esc(s.id)}" data-template-id="${esc(s.templateId || '')}" data-tooltip="${te('schedules.detail.editPromptTip')}">${ICONS.script}<span>${te('schedules.detail.editPrompt')}</span></button>
|
|
1321
|
+
<button type="button" class="sx-btn sched-btn" data-action="schedule-edit" data-id="${esc(s.id)}">${ICONS.edit}<span>${te('schedules.detail.editSchedule')}</span></button>
|
|
1322
|
+
<button type="button" class="sx-btn sched-btn sx-btn--danger" data-action="schedule-delete" data-id="${esc(s.id)}">${ICONS.trash}<span>${te('schedules.detail.delete')}</span></button>
|
|
1286
1323
|
</div>`;
|
|
1287
1324
|
}
|
|
1288
1325
|
|
|
@@ -1303,7 +1340,7 @@ function renderActivityList() {
|
|
|
1303
1340
|
const query = _query.trim();
|
|
1304
1341
|
if (!shown.length) {
|
|
1305
1342
|
list.innerHTML = query
|
|
1306
|
-
? emptyState(ICONS.search, t('schedules.empty.noRunMatch', { query }), t('schedules.empty.tryAnother'), `<button type="button" class="sched-btn" data-action="clear-search">${te('schedules.list.clearSearch')}</button>`)
|
|
1343
|
+
? emptyState(ICONS.search, t('schedules.empty.noRunMatch', { query }), t('schedules.empty.tryAnother'), `<button type="button" class="sx-btn sched-btn" data-action="clear-search">${te('schedules.list.clearSearch')}</button>`)
|
|
1307
1344
|
: emptyState(ICONS.activity, t('schedules.empty.noRuns'), t('schedules.empty.noRunsText'));
|
|
1308
1345
|
setStatus(query ? t('schedules.list.statusNoMatches') : t('schedules.empty.noRuns'));
|
|
1309
1346
|
restoreListState(list, saved);
|
|
@@ -1374,7 +1411,7 @@ function renderTimersView() {
|
|
|
1374
1411
|
_qtMoreLogin = readMoreLoginField('sched-qt-mlprofile') || _qtMoreLogin;
|
|
1375
1412
|
ensureMoreLoginProfiles();
|
|
1376
1413
|
const qtPresetButtons = [5, 15, 30, 60, 120, 240]
|
|
1377
|
-
.map(min => `<button type="button" class="sched-chip" data-action="qt-select" data-minutes="${min}" aria-pressed="${_selectedQtMinutes === min}">${min >= 60 ? te('schedules.timers.presetHours', { n: min / 60 }) : te('schedules.timers.presetMinutes', { n: min })}</button>`)
|
|
1414
|
+
.map(min => `<button type="button" class="sx-btn sx-btn--sm sched-chip" data-action="qt-select" data-minutes="${min}" aria-pressed="${_selectedQtMinutes === min}">${min >= 60 ? te('schedules.timers.presetHours', { n: min / 60 }) : te('schedules.timers.presetMinutes', { n: min })}</button>`)
|
|
1378
1415
|
.join('');
|
|
1379
1416
|
|
|
1380
1417
|
const modelLoadKey = `${_launchProfile}:${_launchAccount}`;
|
|
@@ -1388,9 +1425,9 @@ function renderTimersView() {
|
|
|
1388
1425
|
}
|
|
1389
1426
|
|
|
1390
1427
|
main.innerHTML = `
|
|
1391
|
-
<div class="sched-view-head">
|
|
1428
|
+
<div class="sx-place-head sched-view-head">
|
|
1392
1429
|
<div class="sched-view-titles">
|
|
1393
|
-
<h2 id="sched-view-title">${esc(viewLabel('timers'))}</h2>
|
|
1430
|
+
<h2 class="sx-place-title" id="sched-view-title">${esc(viewLabel('timers'))}</h2>
|
|
1394
1431
|
<p class="sched-view-sub">${te('schedules.timers.sub')}</p>
|
|
1395
1432
|
</div>
|
|
1396
1433
|
</div>
|
|
@@ -1398,11 +1435,11 @@ function renderTimersView() {
|
|
|
1398
1435
|
<div class="sched-editor-body">
|
|
1399
1436
|
<div class="sched-form">
|
|
1400
1437
|
<section class="sched-form-section" aria-labelledby="sched-timers-active-title">
|
|
1401
|
-
<h3 class="sched-form-title" id="sched-timers-active-title">${te('schedules.timers.waiting')}</h3>
|
|
1438
|
+
<h3 class="sx-section-title sched-form-title" id="sched-timers-active-title">${te('schedules.timers.waiting')}</h3>
|
|
1402
1439
|
<div id="sched-active-timers"></div>
|
|
1403
1440
|
</section>
|
|
1404
1441
|
<section class="sched-form-section" aria-labelledby="sched-qt-title">
|
|
1405
|
-
<h3 class="sched-form-title" id="sched-qt-title">${te('schedules.timers.runOnce')}</h3>
|
|
1442
|
+
<h3 class="sx-section-title sched-form-title" id="sched-qt-title">${te('schedules.timers.runOnce')}</h3>
|
|
1406
1443
|
<div class="sched-form-group">
|
|
1407
1444
|
${dropdownRow('sched-qt-template', t('schedules.form.automation'), templateOptions)}
|
|
1408
1445
|
${dropdownRow('sched-qt-profile', t('schedules.form.cli'), profileOptions)}
|
|
@@ -1414,22 +1451,22 @@ function renderTimersView() {
|
|
|
1414
1451
|
${formRow('sched-qt-browser', t('schedules.timers.usesBrowser'), toggleHTML('sched-qt-browser', usesBrowser), { toggle: true })}
|
|
1415
1452
|
${moreLoginFieldHTML({ id: 'sched-qt-mlprofile', value: _qtMoreLogin.moreloginEnvId || '', savedName: _qtMoreLogin.moreloginEnvName || null, context: 'run' })}
|
|
1416
1453
|
${formRow('sched-qt-custom-min', t('schedules.timers.startIn'), `<span class="sched-chip-list" role="group" aria-label="${te('schedules.timers.delay')}">${qtPresetButtons}</span>
|
|
1417
|
-
<input class="sched-input" id="sched-qt-custom-min" type="number" min="1" max="1440" value="${esc(customMinutes)}" placeholder="${te('schedules.timers.minutesPlaceholder')}" aria-label="${te('schedules.timers.minutesFromNow')}">`, { top: true })}
|
|
1454
|
+
<input class="sx-input sched-input" id="sched-qt-custom-min" type="number" min="1" max="1440" value="${esc(customMinutes)}" placeholder="${te('schedules.timers.minutesPlaceholder')}" aria-label="${te('schedules.timers.minutesFromNow')}">`, { top: true })}
|
|
1418
1455
|
</div>
|
|
1419
1456
|
<div class="sched-form-actions">
|
|
1420
|
-
<button type="button" class="sched-btn" data-action="qt-now">${ICONS.bolt}<span>${te('schedules.detail.runNow')}</span></button>
|
|
1421
|
-
<button type="button" class="
|
|
1457
|
+
<button type="button" class="sx-btn sched-btn" data-action="qt-now">${ICONS.bolt}<span>${te('schedules.detail.runNow')}</span></button>
|
|
1458
|
+
<button type="button" class="sx-btn sched-btn sx-btn--primary" data-action="qt-go">${ICONS.timer}<span>${te('schedules.timers.start')}</span></button>
|
|
1422
1459
|
</div>
|
|
1423
1460
|
</section>
|
|
1424
1461
|
<section class="sched-form-section" aria-labelledby="sched-st-title">
|
|
1425
|
-
<h3 class="sched-form-title" id="sched-st-title">${te('schedules.timers.fireSaved')}</h3>
|
|
1462
|
+
<h3 class="sx-section-title sched-form-title" id="sched-st-title">${te('schedules.timers.fireSaved')}</h3>
|
|
1426
1463
|
<p class="sched-form-intro">${te('schedules.timers.fireSavedIntro')}</p>
|
|
1427
1464
|
<div class="sched-form-group">
|
|
1428
1465
|
${dropdownRow('sched-existing-timer-schedule', t('schedules.timers.schedule'), scheduleOptions)}
|
|
1429
|
-
${formRow('sched-existing-timer-min', t('schedules.timers.minutesFromNow'), `<input class="sched-input" id="sched-existing-timer-min" type="number" min="1" max="1440" value="${esc(scheduleMinutes)}" placeholder="15">`)}
|
|
1466
|
+
${formRow('sched-existing-timer-min', t('schedules.timers.minutesFromNow'), `<input class="sx-input sched-input" id="sched-existing-timer-min" type="number" min="1" max="1440" value="${esc(scheduleMinutes)}" placeholder="15">`)}
|
|
1430
1467
|
</div>
|
|
1431
1468
|
<div class="sched-form-actions">
|
|
1432
|
-
<button type="button" class="
|
|
1469
|
+
<button type="button" class="sx-btn sched-btn sx-btn--primary" data-action="schedule-timer-create">${te('schedules.timers.set')}</button>
|
|
1433
1470
|
</div>
|
|
1434
1471
|
</section>
|
|
1435
1472
|
</div>
|
|
@@ -1631,7 +1668,7 @@ function renderActiveTimersInto() {
|
|
|
1631
1668
|
<div class="sched-timer-row" data-timer-id="${esc(scheduleId)}" data-timer-kind="schedule">
|
|
1632
1669
|
<span class="sched-timer-name">${esc(name)}<span class="sched-timer-meta">${te('schedules.timers.savedOnce')}</span></span>
|
|
1633
1670
|
<strong class="sched-timer-count" data-fires-at="${esc(timer.firesAt)}">${esc(formatTimerCountdown(timer.firesAt))}</strong>
|
|
1634
|
-
<button type="button" class="sched-btn" data-action="schedule-timer-cancel" data-id="${esc(scheduleId)}" aria-label="${te('schedules.timers.cancelFor', { name })}">${te('schedules.timers.cancel')}</button>
|
|
1671
|
+
<button type="button" class="sx-btn sched-btn" data-action="schedule-timer-cancel" data-id="${esc(scheduleId)}" aria-label="${te('schedules.timers.cancelFor', { name })}">${te('schedules.timers.cancel')}</button>
|
|
1635
1672
|
</div>`;
|
|
1636
1673
|
}).join('');
|
|
1637
1674
|
|
|
@@ -1648,13 +1685,13 @@ function renderActiveTimersInto() {
|
|
|
1648
1685
|
<div class="sched-timer-row" data-timer-id="${esc(timer.id)}" data-timer-kind="quick">
|
|
1649
1686
|
<span class="sched-timer-name">${esc(timer.templateName)}<span class="sched-timer-meta">${esc(meta || t('schedules.timers.automationOnce'))}</span></span>
|
|
1650
1687
|
<strong class="sched-timer-count" data-fires-at="${esc(timer.firesAt)}">${esc(formatTimerCountdown(timer.firesAt))}</strong>
|
|
1651
|
-
<button type="button" class="sched-btn" data-action="qt-cancel" data-id="${esc(timer.id)}" aria-label="${te('schedules.timers.cancelFor', { name: timer.templateName })}">${te('schedules.timers.cancel')}</button>
|
|
1688
|
+
<button type="button" class="sx-btn sched-btn" data-action="qt-cancel" data-id="${esc(timer.id)}" aria-label="${te('schedules.timers.cancelFor', { name: timer.templateName })}">${te('schedules.timers.cancel')}</button>
|
|
1652
1689
|
</div>`;
|
|
1653
1690
|
}).join('');
|
|
1654
1691
|
|
|
1655
1692
|
// The timers load on their own: until they answer (or when they could not), say so here.
|
|
1656
1693
|
const note = _timersError
|
|
1657
|
-
? `<div class="sched-load-note">${ICONS.alert}<span>${esc(_timersError)}</span><button type="button" class="sched-btn" data-action="retry-timers">${te('schedules.note.tryAgain')}</button></div>`
|
|
1694
|
+
? `<div class="sched-load-note">${ICONS.alert}<span>${esc(_timersError)}</span><button type="button" class="sx-btn sched-btn" data-action="retry-timers">${te('schedules.note.tryAgain')}</button></div>`
|
|
1658
1695
|
: '';
|
|
1659
1696
|
const empty = _timersError ? '' : `<p class="sched-form-intro">${_timersLoaded ? te('schedules.timers.none') : te('schedules.timers.loading')}</p>`;
|
|
1660
1697
|
box.innerHTML = note + (scheduleTimers || quickTimers ? `<div class="sched-form-group">${quickTimers}${scheduleTimers}</div>` : empty);
|
|
@@ -1715,9 +1752,9 @@ function redrawEditor(main, html) {
|
|
|
1715
1752
|
}
|
|
1716
1753
|
|
|
1717
1754
|
function editorHead({ back, title, sub, titleId }) {
|
|
1718
|
-
return `<header class="sched-editor-head">
|
|
1719
|
-
<button type="button" class="sched-icon-btn" data-action="${back}" aria-label="${te('schedules.editor.back')}" data-tooltip="${te('schedules.editor.backTip')}">${ICONS.back}</button>
|
|
1720
|
-
<div class="sched-editor-titles"><h2 id="${titleId}">${esc(title)}</h2>${sub ? `<p>${esc(sub)}</p>` : ''}</div>
|
|
1755
|
+
return `<header class="sx-place-head sched-editor-head">
|
|
1756
|
+
<button type="button" class="sx-icon-btn sched-icon-btn" data-action="${back}" aria-label="${te('schedules.editor.back')}" data-tooltip="${te('schedules.editor.backTip')}">${ICONS.back}</button>
|
|
1757
|
+
<div class="sched-editor-titles"><h2 class="sx-place-title" id="${titleId}">${esc(title)}</h2>${sub ? `<p>${esc(sub)}</p>` : ''}</div>
|
|
1721
1758
|
</header>`;
|
|
1722
1759
|
}
|
|
1723
1760
|
|
|
@@ -1795,16 +1832,16 @@ function renderGroupEditor(group) {
|
|
|
1795
1832
|
<div class="sched-editor-body">
|
|
1796
1833
|
<div class="sched-form">
|
|
1797
1834
|
<section class="sched-form-section" aria-labelledby="sched-ge-sec-group">
|
|
1798
|
-
<h3 class="sched-form-title" id="sched-ge-sec-group">${te('schedules.form.group')}</h3>
|
|
1835
|
+
<h3 class="sx-section-title sched-form-title" id="sched-ge-sec-group">${te('schedules.form.group')}</h3>
|
|
1799
1836
|
<div class="sched-form-group">
|
|
1800
|
-
${formRow('sched-ge-name', t('schedules.form.name'), `<input class="sched-input" id="sched-ge-name" type="text" value="${esc(d.name || '')}" placeholder="${te('schedules.groupEditor.namePlaceholder')}" autocomplete="off">`)}
|
|
1801
|
-
${formRow('sched-ge-color', t('schedules.groupEditor.colour'), `<input class="sched-input" id="sched-ge-color" type="color" value="${esc(/^#[0-9a-f]{6}$/i.test(d.color || '') ? d.color : DEFAULT_GROUP_COLOR)}">`)}
|
|
1837
|
+
${formRow('sched-ge-name', t('schedules.form.name'), `<input class="sx-input sched-input" id="sched-ge-name" type="text" value="${esc(d.name || '')}" placeholder="${te('schedules.groupEditor.namePlaceholder')}" autocomplete="off">`)}
|
|
1838
|
+
${formRow('sched-ge-color', t('schedules.groupEditor.colour'), `<input class="sx-input sched-input" id="sched-ge-color" type="color" value="${esc(/^#[0-9a-f]{6}$/i.test(d.color || '') ? d.color : DEFAULT_GROUP_COLOR)}">`)}
|
|
1802
1839
|
${formRow('sched-ge-mutex', t('schedules.oneAtATime'), toggleHTML('sched-ge-mutex', !!d.mutualExclusion, 'sched-ge-mutex-help'),
|
|
1803
1840
|
{ help: te('schedules.groupEditor.oneAtATimeHelp'), toggle: true })}
|
|
1804
1841
|
</div>
|
|
1805
1842
|
</section>
|
|
1806
1843
|
<section class="sched-form-section" aria-labelledby="sched-ge-sec-launch">
|
|
1807
|
-
<h3 class="sched-form-title" id="sched-ge-sec-launch">${te('schedules.form.launchOverrides')}</h3>
|
|
1844
|
+
<h3 class="sx-section-title sched-form-title" id="sched-ge-sec-launch">${te('schedules.form.launchOverrides')}</h3>
|
|
1808
1845
|
<p class="sched-form-intro">${te('schedules.groupEditor.launchIntro')}</p>
|
|
1809
1846
|
<div class="sched-form-group">
|
|
1810
1847
|
${dropdownRow('sched-ge-profile', t('schedules.form.cli'), profileOptions)}
|
|
@@ -1823,24 +1860,24 @@ function renderGroupEditor(group) {
|
|
|
1823
1860
|
</section>
|
|
1824
1861
|
${!group ? '' : `
|
|
1825
1862
|
<section class="sched-form-section" aria-labelledby="sched-ge-sec-order">
|
|
1826
|
-
<h3 class="sched-form-title" id="sched-ge-sec-order">${te('schedules.groupEditor.order')}</h3>
|
|
1863
|
+
<h3 class="sx-section-title sched-form-title" id="sched-ge-sec-order">${te('schedules.groupEditor.order')}</h3>
|
|
1827
1864
|
<div class="sched-form-group">
|
|
1828
1865
|
<div class="sched-form-row">
|
|
1829
1866
|
<span class="sched-form-label">${te('schedules.groupEditor.position', { position: position + 1, count: ordered.length })}</span>
|
|
1830
1867
|
<div class="sched-form-control">
|
|
1831
|
-
<button type="button" class="sched-btn" data-action="group-up" data-id="${esc(group.id)}"${position <= 0 ? ' disabled' : ''}>${ICONS.up}<span>${te('schedules.groupEditor.moveUp')}</span></button>
|
|
1832
|
-
<button type="button" class="sched-btn" data-action="group-down" data-id="${esc(group.id)}"${position >= ordered.length - 1 ? ' disabled' : ''}>${ICONS.down}<span>${te('schedules.groupEditor.moveDown')}</span></button>
|
|
1868
|
+
<button type="button" class="sx-btn sched-btn" data-action="group-up" data-id="${esc(group.id)}"${position <= 0 ? ' disabled' : ''}>${ICONS.up}<span>${te('schedules.groupEditor.moveUp')}</span></button>
|
|
1869
|
+
<button type="button" class="sx-btn sched-btn" data-action="group-down" data-id="${esc(group.id)}"${position >= ordered.length - 1 ? ' disabled' : ''}>${ICONS.down}<span>${te('schedules.groupEditor.moveDown')}</span></button>
|
|
1833
1870
|
</div>
|
|
1834
1871
|
</div>
|
|
1835
1872
|
</div>
|
|
1836
1873
|
</section>
|
|
1837
1874
|
<section class="sched-form-section" aria-labelledby="sched-ge-sec-delete">
|
|
1838
|
-
<h3 class="sched-form-title" id="sched-ge-sec-delete">${te('schedules.groupEditor.delete')}</h3>
|
|
1875
|
+
<h3 class="sx-section-title sched-form-title" id="sched-ge-sec-delete">${te('schedules.groupEditor.delete')}</h3>
|
|
1839
1876
|
<div class="sched-form-group">
|
|
1840
1877
|
<div class="sched-form-row">
|
|
1841
1878
|
<span class="sched-form-label">${members ? tpe('schedules.groupEditor.membersStay', members) : te('schedules.groupEditor.empty')}</span>
|
|
1842
1879
|
<div class="sched-form-control">
|
|
1843
|
-
<button type="button" class="
|
|
1880
|
+
<button type="button" class="sx-btn sched-btn sx-btn--danger" data-action="group-delete" data-id="${esc(group.id)}">${ICONS.trash}<span>${te('schedules.groupEditor.deleteGroup')}</span></button>
|
|
1844
1881
|
</div>
|
|
1845
1882
|
</div>
|
|
1846
1883
|
</div>
|
|
@@ -1848,8 +1885,8 @@ function renderGroupEditor(group) {
|
|
|
1848
1885
|
</div>
|
|
1849
1886
|
</div>
|
|
1850
1887
|
<footer class="sched-editor-actions">
|
|
1851
|
-
<button type="button" class="sched-btn" data-action="group-editor-cancel">${te('schedules.editor.cancel')}</button>
|
|
1852
|
-
<button type="button" class="
|
|
1888
|
+
<button type="button" class="sx-btn sched-btn" data-action="group-editor-cancel">${te('schedules.editor.cancel')}</button>
|
|
1889
|
+
<button type="button" class="sx-btn sched-btn sx-btn--primary" data-action="group-editor-save" data-id="${esc(_groupEditorId || '')}">${creating ? te('schedules.groupEditor.create') : te('schedules.editor.save')}</button>
|
|
1853
1890
|
</footer>
|
|
1854
1891
|
</div>`);
|
|
1855
1892
|
wireGroupEditor();
|
|
@@ -1937,7 +1974,7 @@ function renderScheduleEditor() {
|
|
|
1937
1974
|
return `
|
|
1938
1975
|
<div class="sched-preset-group" role="group" aria-label="${te('schedules.scheduleEditor.presetGroup', { group: name })}">
|
|
1939
1976
|
<span>${esc(name)}</span>
|
|
1940
|
-
<div class="sched-chip-list">${group.presets.map(p => `<button type="button" class="sched-chip" data-action="cron-preset" data-cron="${esc(p.cron)}" aria-pressed="${p.cron === cron}" data-tooltip="${esc(describeCron(p.cron))}">${esc(presetLabel(p))}</button>`).join('')}</div>
|
|
1977
|
+
<div class="sched-chip-list">${group.presets.map(p => `<button type="button" class="sx-btn sx-btn--sm sched-chip" data-action="cron-preset" data-cron="${esc(p.cron)}" aria-pressed="${p.cron === cron}" data-tooltip="${esc(describeCron(p.cron))}">${esc(presetLabel(p))}</button>`).join('')}</div>
|
|
1941
1978
|
</div>`;
|
|
1942
1979
|
}).join('');
|
|
1943
1980
|
const dayOrder = [1, 2, 3, 4, 5, 6, 0];
|
|
@@ -1951,10 +1988,10 @@ function renderScheduleEditor() {
|
|
|
1951
1988
|
const help = entry?.label ? te('schedules.scheduleEditor.themeLabel', { label: entry.label }) : '';
|
|
1952
1989
|
// A day without an entry keeps the button's room, so the fields line up.
|
|
1953
1990
|
const remove = entry
|
|
1954
|
-
? `<button type="button" class="sched-icon-btn sched-icon-btn--danger sched-day-remove" data-action="day-theme-remove" data-day="${idx}" aria-label="${te('schedules.scheduleEditor.removeTheme', { day })}" data-tooltip="${te('schedules.scheduleEditor.removeThemeTip')}">${ICONS.trash}</button>`
|
|
1955
|
-
: '<span class="sched-icon-btn sched-day-remove sched-day-remove--room" aria-hidden="true"></span>';
|
|
1991
|
+
? `<button type="button" class="sx-icon-btn sched-icon-btn sched-icon-btn--danger sched-day-remove" data-action="day-theme-remove" data-day="${idx}" aria-label="${te('schedules.scheduleEditor.removeTheme', { day })}" data-tooltip="${te('schedules.scheduleEditor.removeThemeTip')}">${ICONS.trash}</button>`
|
|
1992
|
+
: '<span class="sx-icon-btn sched-icon-btn sched-day-remove sched-day-remove--room" aria-hidden="true"></span>';
|
|
1956
1993
|
return formRow(`sched-ed-day-${idx}`, day,
|
|
1957
|
-
`<textarea class="sched-input sched-textarea" id="sched-ed-day-${idx}" data-day="${idx}" rows="2" spellcheck="false" placeholder="${te('schedules.scheduleEditor.themePlaceholder', { day })}"${help ? ` aria-describedby="sched-ed-day-${idx}-help"` : ''}>${esc(entry?.contextOverride || '')}</textarea>${remove}`,
|
|
1994
|
+
`<textarea class="sx-input sched-input sched-textarea" id="sched-ed-day-${idx}" data-day="${idx}" rows="2" spellcheck="false" placeholder="${te('schedules.scheduleEditor.themePlaceholder', { day })}"${help ? ` aria-describedby="sched-ed-day-${idx}-help"` : ''}>${esc(entry?.contextOverride || '')}</textarea>${remove}`,
|
|
1958
1995
|
{ help });
|
|
1959
1996
|
}).join('');
|
|
1960
1997
|
|
|
@@ -1983,9 +2020,9 @@ function renderScheduleEditor() {
|
|
|
1983
2020
|
${isEdit ? approvalNoteHTML(_schedules.find(x => x.id === s.id) || s) : ''}
|
|
1984
2021
|
<div class="sched-form">
|
|
1985
2022
|
<section class="sched-form-section" aria-labelledby="sched-ed-sec-basics">
|
|
1986
|
-
<h3 class="sched-form-title" id="sched-ed-sec-basics">${te('schedules.timers.schedule')}</h3>
|
|
2023
|
+
<h3 class="sx-section-title sched-form-title" id="sched-ed-sec-basics">${te('schedules.timers.schedule')}</h3>
|
|
1987
2024
|
<div class="sched-form-group">
|
|
1988
|
-
${formRow('sched-ed-name', t('schedules.form.name'), `<input class="sched-input" id="sched-ed-name" type="text" value="${esc(s.name || '')}" placeholder="${te('schedules.scheduleEditor.namePlaceholder')}" autocomplete="off">`)}
|
|
2025
|
+
${formRow('sched-ed-name', t('schedules.form.name'), `<input class="sx-input sched-input" id="sched-ed-name" type="text" value="${esc(s.name || '')}" placeholder="${te('schedules.scheduleEditor.namePlaceholder')}" autocomplete="off">`)}
|
|
1989
2026
|
${dropdownRow('sched-ed-template', t('schedules.form.automation'), templateOptions)}
|
|
1990
2027
|
${dropdownRow('sched-ed-group', t('schedules.form.group'), groupOptions)}
|
|
1991
2028
|
${formRow('sched-ed-enabled', t('schedules.scheduleEditor.active'), toggleHTML('sched-ed-enabled', s.enabled !== false, 'sched-ed-enabled-help'),
|
|
@@ -1994,12 +2031,12 @@ function renderScheduleEditor() {
|
|
|
1994
2031
|
</section>
|
|
1995
2032
|
|
|
1996
2033
|
<section class="sched-form-section" aria-labelledby="sched-ed-sec-when">
|
|
1997
|
-
<h3 class="sched-form-title" id="sched-ed-sec-when">${te('schedules.scheduleEditor.when')}</h3>
|
|
2034
|
+
<h3 class="sx-section-title sched-form-title" id="sched-ed-sec-when">${te('schedules.scheduleEditor.when')}</h3>
|
|
1998
2035
|
<div class="sched-form-group">
|
|
1999
2036
|
<div class="sched-form-row sched-form-row--top">
|
|
2000
2037
|
<label class="sched-form-label" for="sched-ed-cron">${te('schedules.scheduleEditor.cron')}</label>
|
|
2001
2038
|
<div class="sched-form-stack">
|
|
2002
|
-
<div class="sched-form-control"><input class="sched-input sched-mono" id="sched-ed-cron" type="text" value="${esc(cron)}" placeholder="0 9 * * *" spellcheck="false" autocomplete="off" aria-describedby="sched-ed-cron-desc"></div>
|
|
2039
|
+
<div class="sched-form-control"><input class="sx-input sched-input sched-mono" id="sched-ed-cron" type="text" value="${esc(cron)}" placeholder="0 9 * * *" spellcheck="false" autocomplete="off" aria-describedby="sched-ed-cron-desc"></div>
|
|
2003
2040
|
<p class="sched-help" id="sched-ed-cron-desc" aria-live="polite">${esc(describeCron(cron))}</p>
|
|
2004
2041
|
</div>
|
|
2005
2042
|
</div>
|
|
@@ -2007,12 +2044,12 @@ function renderScheduleEditor() {
|
|
|
2007
2044
|
<span class="sched-form-label">${te('schedules.scheduleEditor.presets')}</span>
|
|
2008
2045
|
<div class="sched-presets">${presetsHTML}</div>
|
|
2009
2046
|
</div>
|
|
2010
|
-
${formRow('sched-ed-tz', t('schedules.detail.timeZone'), `<input class="sched-input" id="sched-ed-tz" type="text" value="${esc(tz)}" spellcheck="false" autocomplete="off">`)}
|
|
2047
|
+
${formRow('sched-ed-tz', t('schedules.detail.timeZone'), `<input class="sx-input sched-input" id="sched-ed-tz" type="text" value="${esc(tz)}" spellcheck="false" autocomplete="off">`)}
|
|
2011
2048
|
</div>
|
|
2012
2049
|
</section>
|
|
2013
2050
|
|
|
2014
2051
|
<section class="sched-form-section" aria-labelledby="sched-ed-sec-launch">
|
|
2015
|
-
<h3 class="sched-form-title" id="sched-ed-sec-launch">${te('schedules.form.launchOverrides')}</h3>
|
|
2052
|
+
<h3 class="sx-section-title sched-form-title" id="sched-ed-sec-launch">${te('schedules.form.launchOverrides')}</h3>
|
|
2016
2053
|
<p class="sched-form-intro">${te('schedules.scheduleEditor.launchIntro')}</p>
|
|
2017
2054
|
<div class="sched-form-group">
|
|
2018
2055
|
${dropdownRow('sched-ed-profile', t('schedules.form.cli'), profileOptions)}
|
|
@@ -2032,15 +2069,15 @@ function renderScheduleEditor() {
|
|
|
2032
2069
|
</section>
|
|
2033
2070
|
|
|
2034
2071
|
<details class="sched-form-section"${hasThemes ? ' open' : ''}>
|
|
2035
|
-
<summary class="sched-form-title">${te('schedules.detail.dayThemes')} <small>${te('schedules.scheduleEditor.optional')}</small></summary>
|
|
2072
|
+
<summary class="sx-section-title sched-form-title">${te('schedules.detail.dayThemes')} <small>${te('schedules.scheduleEditor.optional')}</small></summary>
|
|
2036
2073
|
<p class="sched-form-intro">${te('schedules.scheduleEditor.dayThemesIntro')}</p>
|
|
2037
2074
|
<div class="sched-form-group" id="sched-ed-daythemes">${dayThemes}</div>
|
|
2038
2075
|
</details>
|
|
2039
2076
|
</div>
|
|
2040
2077
|
</div>
|
|
2041
2078
|
<footer class="sched-editor-actions">
|
|
2042
|
-
<button type="button" class="sched-btn" data-action="schedule-editor-close">${te('schedules.editor.cancel')}</button>
|
|
2043
|
-
<button type="button" class="
|
|
2079
|
+
<button type="button" class="sx-btn sched-btn" data-action="schedule-editor-close">${te('schedules.editor.cancel')}</button>
|
|
2080
|
+
<button type="button" class="sx-btn sched-btn sx-btn--primary" data-action="schedule-editor-save">${isEdit ? te('schedules.editor.save') : te('schedules.scheduleEditor.create')}</button>
|
|
2044
2081
|
</footer>
|
|
2045
2082
|
</div>
|
|
2046
2083
|
`);
|
|
@@ -2727,26 +2764,26 @@ function openConfirm({ kind, id, opener }) {
|
|
|
2727
2764
|
accept = t('schedules.confirm.groupAccept');
|
|
2728
2765
|
}
|
|
2729
2766
|
_confirm = { kind, id, opener };
|
|
2730
|
-
layer.innerHTML = `<div class="sched-dialog" role="alertdialog" aria-modal="true" aria-labelledby="sched-dialog-title" aria-describedby="sched-dialog-text">
|
|
2731
|
-
<h4 id="sched-dialog-title">${esc(title)}</h4>
|
|
2732
|
-
<div class="
|
|
2767
|
+
layer.innerHTML = `<div class="ss-fd-backdrop" aria-hidden="true"></div><div class="ss-file-dialog ss-dlg sched-dialog" role="alertdialog" aria-modal="true" aria-labelledby="sched-dialog-title" aria-describedby="sched-dialog-text">
|
|
2768
|
+
<h4 class="ss-dlg-title" id="sched-dialog-title">${esc(title)}</h4>
|
|
2769
|
+
<div class="ss-dlg-body">
|
|
2733
2770
|
<p class="sched-dialog-name">${esc(name)}</p>
|
|
2734
2771
|
<p class="sched-help" id="sched-dialog-text">${esc(text)}</p>
|
|
2735
2772
|
</div>
|
|
2736
|
-
<div class="sched-dialog-actions">
|
|
2737
|
-
<button type="button" class="sched-btn" data-action="confirm-cancel">${te('schedules.editor.cancel')}</button>
|
|
2738
|
-
<button type="button" class="
|
|
2773
|
+
<div class="ss-dlg-actions sched-dialog-actions">
|
|
2774
|
+
<button type="button" class="sx-btn sched-btn" data-action="confirm-cancel">${te('schedules.editor.cancel')}</button>
|
|
2775
|
+
<button type="button" class="sx-btn sched-btn sx-btn--danger" data-action="confirm-accept">${ICONS.trash}<span>${esc(accept)}</span></button>
|
|
2739
2776
|
</div>
|
|
2740
2777
|
</div>`;
|
|
2741
2778
|
layer.hidden = false;
|
|
2742
|
-
for (const part of _panel.querySelectorAll(':scope > .
|
|
2779
|
+
for (const part of _panel.querySelectorAll(':scope > .sx-head, :scope > .sched-body')) part.inert = true;
|
|
2743
2780
|
layer.querySelector('[data-action="confirm-cancel"]')?.focus();
|
|
2744
2781
|
}
|
|
2745
2782
|
|
|
2746
2783
|
function closeConfirm() {
|
|
2747
2784
|
const layer = $('sched-dialog-layer');
|
|
2748
2785
|
if (layer) { layer.hidden = true; layer.innerHTML = ''; }
|
|
2749
|
-
for (const part of _panel?.querySelectorAll(':scope > .
|
|
2786
|
+
for (const part of _panel?.querySelectorAll(':scope > .sx-head, :scope > .sched-body') || []) part.inert = false;
|
|
2750
2787
|
const opener = _confirm?.opener;
|
|
2751
2788
|
_confirm = null;
|
|
2752
2789
|
if (opener?.isConnected) opener.focus();
|
|
@@ -2986,12 +3023,12 @@ function openPromptScheduleModal() {
|
|
|
2986
3023
|
const opencodeMeta = getProviderMeta('opencode');
|
|
2987
3024
|
const codexMeta = getProviderMeta('codex');
|
|
2988
3025
|
_promptModal = document.createElement('div');
|
|
2989
|
-
_promptModal.className = 'sched-prompt-modal glass';
|
|
3026
|
+
_promptModal.className = 'sched-prompt-modal sx glass';
|
|
2990
3027
|
_promptModal.setAttribute('role', 'dialog');
|
|
2991
3028
|
_promptModal.setAttribute('aria-modal', 'true');
|
|
2992
3029
|
_promptModal.setAttribute('aria-labelledby', 'sched-prompt-title');
|
|
2993
3030
|
_promptModal.innerHTML = `
|
|
2994
|
-
<header class="sched-prompt-head">
|
|
3031
|
+
<header class="sx-head sched-prompt-head">
|
|
2995
3032
|
<div class="sched-prompt-head-text">
|
|
2996
3033
|
<span class="sched-prompt-icon">${ICONS.sparkle}</span>
|
|
2997
3034
|
<div>
|
|
@@ -2999,10 +3036,10 @@ function openPromptScheduleModal() {
|
|
|
2999
3036
|
<p>${te('schedules.prompt.sub')}</p>
|
|
3000
3037
|
</div>
|
|
3001
3038
|
</div>
|
|
3002
|
-
<button class="sched-prompt-close" data-action="prompt-modal-close" aria-label="${te('schedules.prompt.close')}">${ICONS.close}</button>
|
|
3039
|
+
<button class="sx-icon-btn sx-close sched-prompt-close" data-action="prompt-modal-close" aria-label="${te('schedules.prompt.close')}">${ICONS.close}</button>
|
|
3003
3040
|
</header>
|
|
3004
3041
|
<div class="sched-prompt-tiles">
|
|
3005
|
-
<button class="sched-prompt-tile" style="--provider-color:${claudeMeta.color};" data-action="prompt-modal-pick" data-runtime="claude-code">
|
|
3042
|
+
<button class="sx-card sched-prompt-tile" style="--provider-color:${claudeMeta.color};" data-action="prompt-modal-pick" data-runtime="claude-code">
|
|
3006
3043
|
<span class="sched-prompt-tile-logo" aria-hidden="true">${claudeMeta.icon}</span>
|
|
3007
3044
|
<span class="sched-prompt-tile-body">
|
|
3008
3045
|
<span class="sched-prompt-tile-title">${claudeMeta.label}</span>
|
|
@@ -3010,7 +3047,7 @@ function openPromptScheduleModal() {
|
|
|
3010
3047
|
</span>
|
|
3011
3048
|
<span class="sched-prompt-pill sched-prompt-pill--active">${te('schedules.prompt.ready')}</span>
|
|
3012
3049
|
</button>
|
|
3013
|
-
<button class="sched-prompt-tile" style="--provider-color:${antigravityMeta.color};" data-action="prompt-modal-pick" data-runtime="antigravity">
|
|
3050
|
+
<button class="sx-card sched-prompt-tile" style="--provider-color:${antigravityMeta.color};" data-action="prompt-modal-pick" data-runtime="antigravity">
|
|
3014
3051
|
<span class="sched-prompt-tile-logo" aria-hidden="true">${antigravityMeta.icon}</span>
|
|
3015
3052
|
<span class="sched-prompt-tile-body">
|
|
3016
3053
|
<span class="sched-prompt-tile-title">${antigravityMeta.label}</span>
|
|
@@ -3018,7 +3055,7 @@ function openPromptScheduleModal() {
|
|
|
3018
3055
|
</span>
|
|
3019
3056
|
<span class="sched-prompt-pill sched-prompt-pill--active">${te('schedules.prompt.ready')}</span>
|
|
3020
3057
|
</button>
|
|
3021
|
-
<button class="sched-prompt-tile disabled" style="--provider-color:${opencodeMeta.color};" disabled aria-disabled="true">
|
|
3058
|
+
<button class="sx-card sched-prompt-tile disabled" style="--provider-color:${opencodeMeta.color};" disabled aria-disabled="true">
|
|
3022
3059
|
<span class="sched-prompt-tile-logo" aria-hidden="true">${opencodeMeta.icon}</span>
|
|
3023
3060
|
<span class="sched-prompt-tile-body">
|
|
3024
3061
|
<span class="sched-prompt-tile-title">${opencodeMeta.label}</span>
|
|
@@ -3026,7 +3063,7 @@ function openPromptScheduleModal() {
|
|
|
3026
3063
|
</span>
|
|
3027
3064
|
<span class="sched-prompt-pill">${te('schedules.prompt.planned')}</span>
|
|
3028
3065
|
</button>
|
|
3029
|
-
<button class="sched-prompt-tile disabled" style="--provider-color:${codexMeta.color};" disabled aria-disabled="true">
|
|
3066
|
+
<button class="sx-card sched-prompt-tile disabled" style="--provider-color:${codexMeta.color};" disabled aria-disabled="true">
|
|
3030
3067
|
<span class="sched-prompt-tile-logo" aria-hidden="true">${codexMeta.icon}</span>
|
|
3031
3068
|
<span class="sched-prompt-tile-body">
|
|
3032
3069
|
<span class="sched-prompt-tile-title">Codex CLI</span>
|