mirror of
https://github.com/logancyang/obsidian-copilot.git
synced 2026-07-22 07:50:24 +00:00
* fix(mobile): keep Agent Mode off the emulated-mobile load path `app.emulateMobile(true)` flips Platform.isMobile to true (stubbing Node's built-ins to null) but leaves Platform.isDesktopApp true — so gating Agent Mode on isDesktopApp still imported the @/agentMode barrel, whose module-scope `promisify(execFile)` then crashed the whole plugin with "Cannot read properties of null (reading 'promisify')". Add isDesktopRuntime() (Platform.isDesktopApp && !Platform.isMobile) and gate every Agent Mode load/registration on it so the barrel is never imported on a Node-less runtime. Update the mobile-load smoke gate rule to enforce the new gate and add a unit test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore(lint): ban Platform.isDesktopApp; route desktop gating through isDesktopRuntime() Platform.isDesktopApp stays true under app.emulateMobile(true) (which stubs Node), so it doesn't keep desktop-only/Node code off the emulated-mobile path. Add a no-restricted-properties ESLint rule banning it (the canonical check in src/utils/desktopRuntime.ts is exempt via an inline disable), and migrate all 14 existing usages — web viewer, encryption/keychain, Miyo discovery, web-tab and @-mention chat hooks, and main.ts's web-viewer gates — to isDesktopRuntime(). Behavior is unchanged on real desktop and mobile; only emulateMobile now faithfully hides these desktop-only features. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| stubs | ||
| test-fixtures | ||
| mobile-load-smoke.cjs | ||
| patchRendererUnsafeUnref.js | ||
| printPromptDebug.js | ||
| printPromptDebugEntry.ts | ||
| seed-skills-scenarios.sh | ||
| test-reset-data.sh | ||
| test-vault.sh | ||