logancyang_obsidian-copilot/src/components/modals
Zero Liu 6a71cf8586
chore(react): centralize React root creation via createPluginRoot helper (#2467)
* chore(react): centralize React root creation via createPluginRoot helper

Every standalone React root in the plugin must wrap its tree in
AppContext.Provider so descendants can rely on useApp() — PR #2466 fixed
one missing wrap (QuickAskOverlay) but the contract was implicit and any
new createRoot callsite could silently re-introduce the same crash.
Introduce a createPluginRoot(container, app) helper that injects the
provider automatically, migrate all 17 createRoot callsites to use it,
and add a Jest guardrail that fails if any non-helper file imports
createRoot from react-dom/client.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(lint): replace createRoot Jest guardrail with ESLint rule

Switch the createPluginRoot enforcement from a Jest test (walks src/
and greps imports) to an ESLint no-restricted-syntax rule. Same
invariant, faster feedback (in-editor instead of on test run), and one
fewer test file to maintain. The helper file is exempted via the
config block's `ignores`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 11:49:03 -07:00
..
project chore(react): centralize React root creation via createPluginRoot helper (#2467) 2026-05-15 11:49:03 -07:00
AddContextNoteModal.tsx chore(lint): enable obsidianmd/rule-custom-message and fix violations (#2416) 2026-05-13 01:39:35 -07:00
ApplyCustomCommandModal.tsx chore(promises): explicit handling of floating promises (W2/9) (#2407) 2026-05-12 17:42:22 -07:00
BaseNoteModal.tsx chore(lint): enable obsidianmd/rule-custom-message and fix violations (#2416) 2026-05-13 01:39:35 -07:00
CachePreviewModal.ts chore(eslint): enable @typescript-eslint/no-floating-promises and fix violations (#2437) 2026-05-13 21:45:35 -07:00
ConfirmModal.tsx chore(react): centralize React root creation via createPluginRoot helper (#2467) 2026-05-15 11:49:03 -07:00
CopilotPlusExpiredModal.tsx chore(react): centralize React root creation via createPluginRoot helper (#2467) 2026-05-15 11:49:03 -07:00
CopilotPlusWelcomeModal.tsx chore(react): centralize React root creation via createPluginRoot helper (#2467) 2026-05-15 11:49:03 -07:00
CustomPatternInputModal.tsx chore(react): centralize React root creation via createPluginRoot helper (#2467) 2026-05-15 11:49:03 -07:00
ExtensionInputModal.tsx chore(react): centralize React root creation via createPluginRoot helper (#2467) 2026-05-15 11:49:03 -07:00
FolderSearchModal.tsx Enhance inclusion/exclusion patterns settings (#1261) 2025-02-18 23:01:20 -08:00
LoadChatHistoryModal.tsx feat: add recent usage sorting for chat history and project list. (#2077) 2026-01-12 19:29:41 -08:00
MigrateConfirmModal.test.tsx feat(keychain): migrate API key storage to Obsidian Keychain (#2364) 2026-05-14 13:57:21 -07:00
MigrateConfirmModal.tsx chore(react): centralize React root creation via createPluginRoot helper (#2467) 2026-05-15 11:49:03 -07:00
ProjectFileSelectModal.tsx Squash preview (#1502) 2025-05-30 20:06:25 -07:00
RebuildIndexConfirmModal.tsx chore(eslint): enable no-unnecessary-type-assertion and no-misused-promises (#2441) 2026-05-13 21:27:35 -07:00
ResetSettingsConfirmModal.tsx fix(keychain): empty-keychain banner, reset modal copy, lifecycle reset (followup to #2364) (#2455) 2026-05-14 14:30:44 -07:00
SemanticSearchToggleModal.tsx chore(promises): explicit handling of floating promises (W2/9) (#2407) 2026-05-12 17:42:22 -07:00
SourcesModal.tsx chore(eslint): enable no-explicit-any; fix ~395 violations (#2452) 2026-05-14 02:08:45 -07:00
TagSearchModal.tsx refactor(react): replace global app with useApp() hook in React layer (#2448) 2026-05-14 00:57:38 -07:00
YoutubeTranscriptModal.tsx chore(react): centralize React root creation via createPluginRoot helper (#2467) 2026-05-15 11:49:03 -07:00