@machina.ai/cell-cli 1.4.0-rc2 → 1.6.1-rc1
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/dist/package.json +12 -8
- package/dist/src/commands/extensions/disable.d.ts +2 -3
- package/dist/src/commands/extensions/disable.js +20 -6
- package/dist/src/commands/extensions/disable.js.map +1 -1
- package/dist/src/commands/extensions/enable.d.ts +2 -3
- package/dist/src/commands/extensions/enable.js +20 -9
- package/dist/src/commands/extensions/enable.js.map +1 -1
- package/dist/src/commands/extensions/install.d.ts +2 -0
- package/dist/src/commands/extensions/install.js +20 -4
- package/dist/src/commands/extensions/install.js.map +1 -1
- package/dist/src/commands/extensions/install.test.js +80 -3
- package/dist/src/commands/extensions/install.test.js.map +1 -1
- package/dist/src/commands/extensions/link.js +1 -1
- package/dist/src/commands/extensions/link.js.map +1 -1
- package/dist/src/commands/extensions/uninstall.js +1 -1
- package/dist/src/commands/extensions/uninstall.js.map +1 -1
- package/dist/src/commands/extensions/update.js +42 -11
- package/dist/src/commands/extensions/update.js.map +1 -1
- package/dist/src/config/config.d.ts +2 -1
- package/dist/src/config/config.js +33 -16
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +10 -14
- package/dist/src/config/extension.js +160 -145
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/extensions/extensionEnablement.d.ts +44 -0
- package/dist/src/config/extensions/extensionEnablement.js +161 -0
- package/dist/src/config/extensions/extensionEnablement.js.map +1 -0
- package/dist/src/config/extensions/extensionEnablement.test.js +261 -0
- package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -0
- package/dist/src/config/extensions/github.d.ts +29 -0
- package/dist/src/config/extensions/github.js +306 -0
- package/dist/src/config/extensions/github.js.map +1 -0
- package/dist/src/config/extensions/github.test.d.ts +6 -0
- package/dist/src/config/extensions/github.test.js +267 -0
- package/dist/src/config/extensions/github.test.js.map +1 -0
- package/dist/src/config/extensions/update.d.ts +20 -0
- package/dist/src/config/extensions/update.js +94 -0
- package/dist/src/config/extensions/update.js.map +1 -0
- package/dist/src/config/extensions/update.test.d.ts +6 -0
- package/dist/src/config/extensions/update.test.js +324 -0
- package/dist/src/config/extensions/update.test.js.map +1 -0
- package/dist/src/config/extensions/variableSchema.d.ts +8 -0
- package/dist/src/config/extensions/variableSchema.js +4 -0
- package/dist/src/config/extensions/variableSchema.js.map +1 -1
- package/dist/src/config/keyBindings.d.ts +4 -1
- package/dist/src/config/keyBindings.js +8 -0
- package/dist/src/config/keyBindings.js.map +1 -1
- package/dist/src/config/settings.d.ts +3 -0
- package/dist/src/config/settings.js +58 -18
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +121 -12
- package/dist/src/config/settingsSchema.js +112 -9
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +68 -55
- package/dist/src/config/settingsSchema.test.js.map +1 -1
- package/dist/src/config/trustedFolders.d.ts +1 -1
- package/dist/src/config/trustedFolders.js +9 -4
- package/dist/src/config/trustedFolders.js.map +1 -1
- package/dist/src/config/trustedFolders.test.js +41 -25
- package/dist/src/config/trustedFolders.test.js.map +1 -1
- package/dist/src/core/auth.d.ts +13 -0
- package/dist/src/core/auth.js +27 -0
- package/dist/src/core/auth.js.map +1 -0
- package/dist/src/core/initializer.d.ts +21 -0
- package/dist/src/core/initializer.js +33 -0
- package/dist/src/core/initializer.js.map +1 -0
- package/dist/src/core/theme.d.ts +12 -0
- package/dist/src/core/theme.js +20 -0
- package/dist/src/core/theme.js.map +1 -0
- package/dist/src/gemini.d.ts +2 -1
- package/dist/src/gemini.js +110 -69
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +124 -14
- package/dist/src/gemini.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/nonInteractiveCli.js +87 -71
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.js +16 -17
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
- package/dist/src/services/FeedbackService.d.ts +21 -0
- package/dist/src/services/FeedbackService.js +124 -0
- package/dist/src/services/FeedbackService.js.map +1 -0
- package/dist/src/services/McpPromptLoader.js +43 -8
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.test.js +228 -1
- package/dist/src/services/McpPromptLoader.test.js.map +1 -1
- package/dist/src/services/prompt-processors/shellProcessor.js +8 -1
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
- package/dist/src/test-utils/createExtension.d.ts +15 -0
- package/dist/src/test-utils/createExtension.js +25 -0
- package/dist/src/test-utils/createExtension.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.js +2 -0
- package/dist/src/test-utils/mockCommandContext.js.map +1 -1
- package/dist/src/ui/App.d.ts +1 -10
- package/dist/src/ui/App.js +17 -729
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/AppContainer.d.ts +17 -0
- package/dist/src/ui/AppContainer.js +905 -0
- package/dist/src/ui/AppContainer.js.map +1 -0
- package/dist/src/ui/AppContainer.test.d.ts +6 -0
- package/dist/src/ui/AppContainer.test.js +422 -0
- package/dist/src/ui/AppContainer.test.js.map +1 -0
- package/dist/src/ui/IdeIntegrationNudge.js +2 -1
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.d.ts +18 -0
- package/dist/src/ui/auth/AuthDialog.js +81 -0
- package/dist/src/ui/auth/AuthDialog.js.map +1 -0
- package/dist/src/ui/auth/AuthDialog.test.d.ts +6 -0
- package/dist/src/ui/auth/AuthDialog.test.js +176 -0
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -0
- package/dist/src/ui/{components → auth}/AuthInProgress.js +2 -2
- package/dist/src/ui/auth/AuthInProgress.js.map +1 -0
- package/dist/src/ui/auth/useAuth.d.ts +15 -0
- package/dist/src/ui/auth/useAuth.js +73 -0
- package/dist/src/ui/auth/useAuth.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.d.ts +2 -0
- package/dist/src/ui/commands/chatCommand.js +82 -3
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/corgiCommand.js +1 -0
- package/dist/src/ui/commands/corgiCommand.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.js +86 -16
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.js +2 -2
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.js +1 -1
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +5 -1
- package/dist/src/ui/commands/types.js +0 -1
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/AboutBox.js +2 -2
- package/dist/src/ui/components/AboutBox.js.map +1 -1
- package/dist/src/ui/components/AnsiOutput.d.ts +13 -0
- package/dist/src/ui/components/AnsiOutput.js +12 -0
- package/dist/src/ui/components/AnsiOutput.js.map +1 -0
- package/dist/src/ui/components/AnsiOutput.test.d.ts +6 -0
- package/dist/src/ui/components/AnsiOutput.test.js +97 -0
- package/dist/src/ui/components/AnsiOutput.test.js.map +1 -0
- package/dist/src/ui/components/AppHeader.d.ts +10 -0
- package/dist/src/ui/components/AppHeader.js +22 -0
- package/dist/src/ui/components/AppHeader.js.map +1 -0
- package/dist/src/ui/components/AsciiArt.d.ts +3 -3
- package/dist/src/ui/components/AsciiArt.js +3 -3
- package/dist/src/ui/components/AutoAcceptIndicator.js +4 -4
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/components/Composer.d.ts +6 -0
- package/dist/src/ui/components/Composer.js +74 -0
- package/dist/src/ui/components/Composer.js.map +1 -0
- package/dist/src/ui/components/Composer.test.d.ts +6 -0
- package/dist/src/ui/components/Composer.test.js +340 -0
- package/dist/src/ui/components/Composer.test.js.map +1 -0
- package/dist/src/ui/components/ConfigInitDisplay.d.ts +6 -0
- package/dist/src/ui/components/ConfigInitDisplay.js +38 -0
- package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.js +2 -2
- package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +3 -3
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.js +2 -2
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/DebugProfiler.js +2 -2
- package/dist/src/ui/components/DebugProfiler.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.js +7 -7
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
- package/dist/src/ui/components/DialogManager.d.ts +6 -0
- package/dist/src/ui/components/DialogManager.js +85 -0
- package/dist/src/ui/components/DialogManager.js.map +1 -0
- package/dist/src/ui/components/EditorSettingsDialog.js +5 -5
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.js +16 -8
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js +18 -8
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Footer.d.ts +1 -2
- package/dist/src/ui/components/Footer.js +6 -2
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +5 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.js +7 -2
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -1
- package/dist/src/ui/components/Header.js +2 -2
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/Help.d.ts +1 -1
- package/dist/src/ui/components/Help.js +9 -6
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/Help.test.d.ts +6 -0
- package/dist/src/ui/components/Help.test.js +57 -0
- package/dist/src/ui/components/Help.test.js.map +1 -0
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +2 -2
- package/dist/src/ui/components/HistoryItemDisplay.js +2 -1
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.d.ts +3 -0
- package/dist/src/ui/components/InputPrompt.js +122 -22
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.js +2 -2
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +13 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.js +35 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +6 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js +25 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -0
- package/dist/src/ui/components/MainContent.d.ts +6 -0
- package/dist/src/ui/components/MainContent.js +23 -0
- package/dist/src/ui/components/MainContent.js.map +1 -0
- package/dist/src/ui/components/MemoryUsageDisplay.js +6 -4
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.js +7 -7
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/Notifications.d.ts +6 -0
- package/dist/src/ui/components/Notifications.js +23 -0
- package/dist/src/ui/components/Notifications.js.map +1 -0
- package/dist/src/ui/components/PrepareLabel.d.ts +5 -5
- package/dist/src/ui/components/PrepareLabel.js +67 -11
- package/dist/src/ui/components/PrepareLabel.js.map +1 -1
- package/dist/src/ui/components/PrepareLabel.test.d.ts +6 -0
- package/dist/src/ui/components/PrepareLabel.test.js +71 -0
- package/dist/src/ui/components/PrepareLabel.test.js.map +1 -0
- package/dist/src/ui/components/ProQuotaDialog.d.ts +2 -2
- package/dist/src/ui/components/ProQuotaDialog.js +3 -3
- package/dist/src/ui/components/ProQuotaDialog.js.map +1 -1
- package/dist/src/ui/components/ProQuotaDialog.test.js +3 -3
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -1
- package/dist/src/ui/components/QuittingDisplay.d.ts +6 -0
- package/dist/src/ui/components/QuittingDisplay.js +20 -0
- package/dist/src/ui/components/QuittingDisplay.js.map +1 -0
- package/dist/src/ui/components/RatingWidget.d.ts +14 -0
- package/dist/src/ui/components/RatingWidget.js +56 -0
- package/dist/src/ui/components/RatingWidget.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.d.ts +4 -0
- package/dist/src/ui/components/SessionSummaryDisplay.js +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +2 -1
- package/dist/src/ui/components/SettingsDialog.js +93 -22
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +435 -79
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js +2 -2
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/ShellInputPrompt.d.ts +11 -0
- package/dist/src/ui/components/ShellInputPrompt.js +36 -0
- package/dist/src/ui/components/ShellInputPrompt.js.map +1 -0
- package/dist/src/ui/components/ShellModeIndicator.js +2 -2
- package/dist/src/ui/components/ShellModeIndicator.js.map +1 -1
- package/dist/src/ui/components/ShowMoreLines.js +2 -2
- package/dist/src/ui/components/ShowMoreLines.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.d.ts +4 -0
- package/dist/src/ui/components/StatsDisplay.js +10 -7
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +7 -2
- package/dist/src/ui/components/SuggestionsDisplay.js +17 -17
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.js +12 -29
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ThemeDialog.test.js +75 -0
- package/dist/src/ui/components/ThemeDialog.test.js.map +1 -0
- package/dist/src/ui/components/Tips.js +2 -2
- package/dist/src/ui/components/Tips.js.map +1 -1
- package/dist/src/ui/components/ToolStatsDisplay.js +4 -4
- package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/UpdateNotification.js +2 -2
- package/dist/src/ui/components/UpdateNotification.js.map +1 -1
- package/dist/src/ui/components/WorkspaceMigrationDialog.js +4 -4
- package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +1 -1
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +1 -2
- package/dist/src/ui/components/messages/CompressionMessage.js +37 -8
- package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -1
- package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.js +160 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +2 -1
- package/dist/src/ui/components/messages/DiffRenderer.js +14 -22
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
- package/dist/src/ui/components/messages/ErrorMessage.js +2 -2
- package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.js +2 -2
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
- package/dist/src/ui/components/messages/InfoMessage.js +2 -2
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +31 -19
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +3 -2
- package/dist/src/ui/components/messages/ToolGroupMessage.js +17 -9
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +17 -15
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.d.ts +4 -0
- package/dist/src/ui/components/messages/ToolMessage.js +24 -10
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js +33 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/UserMessage.js +3 -3
- package/dist/src/ui/components/messages/UserMessage.js.map +1 -1
- package/dist/src/ui/components/messages/UserShellMessage.js +2 -2
- package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -1
- package/dist/src/ui/components/shared/EnumSelector.d.ts +18 -0
- package/dist/src/ui/components/shared/EnumSelector.js +44 -0
- package/dist/src/ui/components/shared/EnumSelector.js.map +1 -0
- package/dist/src/ui/components/shared/EnumSelector.test.d.ts +6 -0
- package/dist/src/ui/components/shared/EnumSelector.test.js +70 -0
- package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js +2 -2
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.js +12 -12
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/ScopeSelector.d.ts +19 -0
- package/dist/src/ui/components/shared/ScopeSelector.js +11 -0
- package/dist/src/ui/components/shared/ScopeSelector.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.d.ts +19 -2
- package/dist/src/ui/components/shared/text-buffer.js +191 -133
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionsList.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionsList.js +47 -0
- package/dist/src/ui/components/views/ExtensionsList.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionsList.test.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js +97 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -0
- package/dist/src/ui/constants.d.ts +1 -0
- package/dist/src/ui/constants.js +1 -0
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/AppContext.d.ts +11 -0
- package/dist/src/ui/contexts/AppContext.js +15 -0
- package/dist/src/ui/contexts/AppContext.js.map +1 -0
- package/dist/src/ui/contexts/ConfigContext.d.ts +9 -0
- package/dist/src/ui/contexts/ConfigContext.js +16 -0
- package/dist/src/ui/contexts/ConfigContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.d.ts +3 -0
- package/dist/src/ui/contexts/KeypressContext.js +51 -2
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +173 -1
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +36 -0
- package/dist/src/ui/contexts/UIActionsContext.js +20 -0
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -0
- package/dist/src/ui/contexts/UIStateContext.d.ts +103 -0
- package/dist/src/ui/contexts/UIStateContext.js +15 -0
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js +7 -5
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/keyToAnsi.d.ts +15 -0
- package/dist/src/ui/hooks/keyToAnsi.js +67 -0
- package/dist/src/ui/hooks/keyToAnsi.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +2 -1
- package/dist/src/ui/hooks/shellCommandProcessor.js +60 -15
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +196 -17
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +16 -2
- package/dist/src/ui/hooks/slashCommandProcessor.js +28 -70
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +3 -2
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +9 -5
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +69 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useExtensionUpdates.d.ts +12 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js +64 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +6 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.js +162 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -0
- package/dist/src/ui/hooks/useFolderTrust.d.ts +1 -1
- package/dist/src/ui/hooks/useFolderTrust.js +12 -13
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +11 -1
- package/dist/src/ui/hooks/useGeminiStream.js +124 -59
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js +15 -18
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.test.js +49 -53
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -1
- package/dist/src/ui/hooks/useIdeTrustListener.js +2 -2
- package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.d.ts +2 -1
- package/dist/src/ui/hooks/useMessageQueue.js +5 -3
- package/dist/src/ui/hooks/useMessageQueue.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.test.js +9 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +21 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.js +122 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.d.ts +6 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +267 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -0
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +3 -2
- package/dist/src/ui/hooks/useReactToolScheduler.js +23 -17
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.js +67 -20
- package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.js +16 -3
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.js +169 -270
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useThemeCommand.d.ts +1 -1
- package/dist/src/ui/hooks/useThemeCommand.js +3 -14
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js +12 -5
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/keyMatchers.test.js +8 -0
- package/dist/src/ui/keyMatchers.test.js.map +1 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +8 -8
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -1
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +2 -2
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +1 -1
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +2 -2
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +1 -1
- package/dist/src/ui/state/extensions.d.ts +15 -0
- package/dist/src/ui/state/extensions.js +17 -0
- package/dist/src/ui/state/extensions.js.map +1 -0
- package/dist/src/ui/themes/ayu.js +1 -1
- package/dist/src/ui/themes/dracula.js +2 -2
- package/dist/src/ui/themes/github-dark.js +1 -1
- package/dist/src/ui/themes/theme.js +17 -17
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/types.d.ts +29 -3
- package/dist/src/ui/types.js +11 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.js +3 -2
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +7 -7
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +10 -10
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.js +6 -2
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -1
- package/dist/src/ui/utils/TableRenderer.js +4 -4
- package/dist/src/ui/utils/TableRenderer.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.js +5 -6
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
- package/dist/src/ui/utils/displayUtils.js +4 -4
- package/dist/src/ui/utils/displayUtils.js.map +1 -1
- package/dist/src/ui/utils/highlight.d.ts +1 -1
- package/dist/src/ui/utils/highlight.js +15 -6
- package/dist/src/ui/utils/highlight.js.map +1 -1
- package/dist/src/ui/utils/highlight.test.js +56 -29
- package/dist/src/ui/utils/highlight.test.js.map +1 -1
- package/dist/src/ui/utils/kittyProtocolDetector.js +39 -29
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -1
- package/dist/src/ui/utils/textUtils.d.ts +9 -0
- package/dist/src/ui/utils/textUtils.js +52 -3
- package/dist/src/ui/utils/textUtils.js.map +1 -1
- package/dist/src/utils/commands.d.ts +20 -0
- package/dist/src/utils/commands.js +53 -0
- package/dist/src/utils/commands.js.map +1 -0
- package/dist/src/utils/commands.test.d.ts +6 -0
- package/dist/src/utils/commands.test.js +115 -0
- package/dist/src/utils/commands.test.js.map +1 -0
- package/dist/src/utils/commentJson.d.ts +9 -0
- package/dist/src/utils/commentJson.js +48 -0
- package/dist/src/utils/commentJson.js.map +1 -0
- package/dist/src/utils/commentJson.test.d.ts +6 -0
- package/dist/src/utils/commentJson.test.js +146 -0
- package/dist/src/utils/commentJson.test.js.map +1 -0
- package/dist/src/utils/errors.d.ts +21 -0
- package/dist/src/utils/errors.js +93 -0
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/errors.test.d.ts +6 -0
- package/dist/src/utils/errors.test.js +303 -0
- package/dist/src/utils/errors.test.js.map +1 -0
- package/dist/src/utils/processUtils.d.ts +13 -0
- package/dist/src/utils/processUtils.js +18 -0
- package/dist/src/utils/processUtils.js.map +1 -0
- package/dist/src/utils/processUtils.test.d.ts +6 -0
- package/dist/src/utils/processUtils.test.js +20 -0
- package/dist/src/utils/processUtils.test.js.map +1 -0
- package/dist/src/utils/sandbox.d.ts +1 -1
- package/dist/src/utils/sandbox.js +19 -8
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/settingsUtils.d.ts +16 -6
- package/dist/src/utils/settingsUtils.js +35 -25
- package/dist/src/utils/settingsUtils.js.map +1 -1
- package/dist/src/utils/settingsUtils.test.js +455 -158
- package/dist/src/utils/settingsUtils.test.js.map +1 -1
- package/dist/src/zed-integration/schema.d.ts +596 -596
- package/dist/src/zed-integration/zedIntegration.js +10 -7
- package/dist/src/zed-integration/zedIntegration.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -9
- package/dist/src/ui/components/AuthDialog.d.ts +0 -16
- package/dist/src/ui/components/AuthDialog.js +0 -62
- package/dist/src/ui/components/AuthDialog.js.map +0 -1
- package/dist/src/ui/components/AuthDialog.test.js +0 -175
- package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
- package/dist/src/ui/components/AuthInProgress.js.map +0 -1
- package/dist/src/ui/hooks/useAuthCommand.d.ts +0 -15
- package/dist/src/ui/hooks/useAuthCommand.js +0 -68
- package/dist/src/ui/hooks/useAuthCommand.js.map +0 -1
- /package/dist/src/{ui/components/AuthDialog.test.d.ts → config/extensions/extensionEnablement.test.d.ts} +0 -0
- /package/dist/src/ui/{components → auth}/AuthInProgress.d.ts +0 -0
|
@@ -8,14 +8,140 @@ import {
|
|
|
8
8
|
// Schema utilities
|
|
9
9
|
getSettingsByCategory, getSettingDefinition, requiresRestart, getDefaultValue, getRestartRequiredSettings, getEffectiveValue, getAllSettingKeys, getSettingsByType, getSettingsRequiringRestart, isValidSettingKey, getSettingCategory, shouldShowInDialog, getDialogSettingsByCategory, getDialogSettingsByType, getDialogSettingKeys,
|
|
10
10
|
// Business logic utilities
|
|
11
|
-
getSettingValue, isSettingModified, settingExistsInScope, setPendingSettingValue, hasRestartRequiredSettings, getRestartRequiredFromModified, getDisplayValue, isDefaultValue, isValueInherited, getEffectiveDisplayValue, } from './settingsUtils.js';
|
|
11
|
+
getSettingValue, isSettingModified, TEST_ONLY, settingExistsInScope, setPendingSettingValue, hasRestartRequiredSettings, getRestartRequiredFromModified, getDisplayValue, isDefaultValue, isValueInherited, getEffectiveDisplayValue, } from './settingsUtils.js';
|
|
12
|
+
import { getSettingsSchema, } from '../config/settingsSchema.js';
|
|
13
|
+
vi.mock('../config/settingsSchema.js', async (importOriginal) => {
|
|
14
|
+
const original = await importOriginal();
|
|
15
|
+
return {
|
|
16
|
+
...original,
|
|
17
|
+
getSettingsSchema: vi.fn(),
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
function makeMockSettings(settings) {
|
|
21
|
+
return settings;
|
|
22
|
+
}
|
|
12
23
|
describe('SettingsUtils', () => {
|
|
24
|
+
beforeEach(() => {
|
|
25
|
+
const SETTINGS_SCHEMA = {
|
|
26
|
+
mcpServers: {
|
|
27
|
+
type: 'object',
|
|
28
|
+
label: 'MCP Servers',
|
|
29
|
+
category: 'Advanced',
|
|
30
|
+
requiresRestart: true,
|
|
31
|
+
default: {},
|
|
32
|
+
description: 'Configuration for MCP servers.',
|
|
33
|
+
showInDialog: false,
|
|
34
|
+
},
|
|
35
|
+
test: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
label: 'Test',
|
|
38
|
+
category: 'Basic',
|
|
39
|
+
requiresRestart: false,
|
|
40
|
+
default: 'hello',
|
|
41
|
+
description: 'A test field',
|
|
42
|
+
showInDialog: true,
|
|
43
|
+
},
|
|
44
|
+
advanced: {
|
|
45
|
+
type: 'object',
|
|
46
|
+
label: 'Advanced',
|
|
47
|
+
category: 'Advanced',
|
|
48
|
+
requiresRestart: true,
|
|
49
|
+
default: {},
|
|
50
|
+
description: 'Advanced settings for power users.',
|
|
51
|
+
showInDialog: false,
|
|
52
|
+
},
|
|
53
|
+
ui: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
label: 'UI',
|
|
56
|
+
category: 'UI',
|
|
57
|
+
requiresRestart: false,
|
|
58
|
+
default: {},
|
|
59
|
+
description: 'User interface settings.',
|
|
60
|
+
showInDialog: false,
|
|
61
|
+
properties: {
|
|
62
|
+
theme: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
label: 'Theme',
|
|
65
|
+
category: 'UI',
|
|
66
|
+
requiresRestart: false,
|
|
67
|
+
default: undefined,
|
|
68
|
+
description: 'The color theme for the UI.',
|
|
69
|
+
showInDialog: false,
|
|
70
|
+
},
|
|
71
|
+
requiresRestart: {
|
|
72
|
+
type: 'boolean',
|
|
73
|
+
label: 'Requires Restart',
|
|
74
|
+
category: 'UI',
|
|
75
|
+
default: false,
|
|
76
|
+
requiresRestart: true,
|
|
77
|
+
},
|
|
78
|
+
accessibility: {
|
|
79
|
+
type: 'object',
|
|
80
|
+
label: 'Accessibility',
|
|
81
|
+
category: 'UI',
|
|
82
|
+
requiresRestart: true,
|
|
83
|
+
default: {},
|
|
84
|
+
description: 'Accessibility settings.',
|
|
85
|
+
showInDialog: false,
|
|
86
|
+
properties: {
|
|
87
|
+
disableLoadingPhrases: {
|
|
88
|
+
type: 'boolean',
|
|
89
|
+
label: 'Disable Loading Phrases',
|
|
90
|
+
category: 'UI',
|
|
91
|
+
requiresRestart: true,
|
|
92
|
+
default: false,
|
|
93
|
+
description: 'Disable loading phrases for accessibility',
|
|
94
|
+
showInDialog: true,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
tools: {
|
|
101
|
+
type: 'object',
|
|
102
|
+
label: 'Tools',
|
|
103
|
+
category: 'Tools',
|
|
104
|
+
requiresRestart: false,
|
|
105
|
+
default: {},
|
|
106
|
+
description: 'Tool settings.',
|
|
107
|
+
showInDialog: false,
|
|
108
|
+
properties: {
|
|
109
|
+
shell: {
|
|
110
|
+
type: 'object',
|
|
111
|
+
label: 'Shell',
|
|
112
|
+
category: 'Tools',
|
|
113
|
+
requiresRestart: false,
|
|
114
|
+
default: {},
|
|
115
|
+
description: 'Shell tool settings.',
|
|
116
|
+
showInDialog: false,
|
|
117
|
+
properties: {
|
|
118
|
+
pager: {
|
|
119
|
+
type: 'string',
|
|
120
|
+
label: 'Pager',
|
|
121
|
+
category: 'Tools',
|
|
122
|
+
requiresRestart: false,
|
|
123
|
+
default: 'less',
|
|
124
|
+
description: 'The pager to use for long output.',
|
|
125
|
+
showInDialog: true,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
vi.mocked(getSettingsSchema).mockReturnValue(SETTINGS_SCHEMA);
|
|
133
|
+
});
|
|
134
|
+
afterEach(() => {
|
|
135
|
+
TEST_ONLY.clearFlattenedSchema();
|
|
136
|
+
vi.clearAllMocks();
|
|
137
|
+
vi.resetAllMocks();
|
|
138
|
+
});
|
|
13
139
|
describe('Schema Utilities', () => {
|
|
14
140
|
describe('getSettingsByCategory', () => {
|
|
15
141
|
it('should group settings by category', () => {
|
|
16
142
|
const categories = getSettingsByCategory();
|
|
17
|
-
expect(categories).toHaveProperty('
|
|
18
|
-
expect(categories).toHaveProperty('
|
|
143
|
+
expect(categories).toHaveProperty('Advanced');
|
|
144
|
+
expect(categories).toHaveProperty('Basic');
|
|
19
145
|
});
|
|
20
146
|
it('should include key property in grouped settings', () => {
|
|
21
147
|
const categories = getSettingsByCategory();
|
|
@@ -28,9 +154,9 @@ describe('SettingsUtils', () => {
|
|
|
28
154
|
});
|
|
29
155
|
describe('getSettingDefinition', () => {
|
|
30
156
|
it('should return definition for valid setting', () => {
|
|
31
|
-
const definition = getSettingDefinition('ui.
|
|
157
|
+
const definition = getSettingDefinition('ui.theme');
|
|
32
158
|
expect(definition).toBeDefined();
|
|
33
|
-
expect(definition?.label).toBe('
|
|
159
|
+
expect(definition?.label).toBe('Theme');
|
|
34
160
|
});
|
|
35
161
|
it('should return undefined for invalid setting', () => {
|
|
36
162
|
const definition = getSettingDefinition('invalidSetting');
|
|
@@ -39,12 +165,10 @@ describe('SettingsUtils', () => {
|
|
|
39
165
|
});
|
|
40
166
|
describe('requiresRestart', () => {
|
|
41
167
|
it('should return true for settings that require restart', () => {
|
|
42
|
-
expect(requiresRestart('
|
|
43
|
-
expect(requiresRestart('general.checkpointing.enabled')).toBe(true);
|
|
168
|
+
expect(requiresRestart('ui.requiresRestart')).toBe(true);
|
|
44
169
|
});
|
|
45
170
|
it('should return false for settings that do not require restart', () => {
|
|
46
|
-
expect(requiresRestart('ui.
|
|
47
|
-
expect(requiresRestart('ui.hideTips')).toBe(false);
|
|
171
|
+
expect(requiresRestart('ui.theme')).toBe(false);
|
|
48
172
|
});
|
|
49
173
|
it('should return false for invalid settings', () => {
|
|
50
174
|
expect(requiresRestart('invalidSetting')).toBe(false);
|
|
@@ -52,8 +176,8 @@ describe('SettingsUtils', () => {
|
|
|
52
176
|
});
|
|
53
177
|
describe('getDefaultValue', () => {
|
|
54
178
|
it('should return correct default values', () => {
|
|
55
|
-
expect(getDefaultValue('
|
|
56
|
-
expect(getDefaultValue('
|
|
179
|
+
expect(getDefaultValue('test')).toBe('hello');
|
|
180
|
+
expect(getDefaultValue('ui.requiresRestart')).toBe(false);
|
|
57
181
|
});
|
|
58
182
|
it('should return undefined for invalid settings', () => {
|
|
59
183
|
expect(getDefaultValue('invalidSetting')).toBeUndefined();
|
|
@@ -62,43 +186,46 @@ describe('SettingsUtils', () => {
|
|
|
62
186
|
describe('getRestartRequiredSettings', () => {
|
|
63
187
|
it('should return all settings that require restart', () => {
|
|
64
188
|
const restartSettings = getRestartRequiredSettings();
|
|
65
|
-
expect(restartSettings).toContain('
|
|
66
|
-
expect(restartSettings).toContain('
|
|
67
|
-
expect(restartSettings).not.toContain('ui.showMemoryUsage');
|
|
189
|
+
expect(restartSettings).toContain('mcpServers');
|
|
190
|
+
expect(restartSettings).toContain('ui.requiresRestart');
|
|
68
191
|
});
|
|
69
192
|
});
|
|
70
193
|
describe('getEffectiveValue', () => {
|
|
71
194
|
it('should return value from settings when set', () => {
|
|
72
|
-
const settings = { ui: {
|
|
73
|
-
const mergedSettings = {
|
|
74
|
-
|
|
195
|
+
const settings = makeMockSettings({ ui: { requiresRestart: true } });
|
|
196
|
+
const mergedSettings = makeMockSettings({
|
|
197
|
+
ui: { requiresRestart: false },
|
|
198
|
+
});
|
|
199
|
+
const value = getEffectiveValue('ui.requiresRestart', settings, mergedSettings);
|
|
75
200
|
expect(value).toBe(true);
|
|
76
201
|
});
|
|
77
202
|
it('should return value from merged settings when not set in current scope', () => {
|
|
78
|
-
const settings = {};
|
|
79
|
-
const mergedSettings = {
|
|
80
|
-
|
|
203
|
+
const settings = makeMockSettings({});
|
|
204
|
+
const mergedSettings = makeMockSettings({
|
|
205
|
+
ui: { requiresRestart: true },
|
|
206
|
+
});
|
|
207
|
+
const value = getEffectiveValue('ui.requiresRestart', settings, mergedSettings);
|
|
81
208
|
expect(value).toBe(true);
|
|
82
209
|
});
|
|
83
210
|
it('should return default value when not set anywhere', () => {
|
|
84
|
-
const settings = {};
|
|
85
|
-
const mergedSettings = {};
|
|
86
|
-
const value = getEffectiveValue('ui.
|
|
211
|
+
const settings = makeMockSettings({});
|
|
212
|
+
const mergedSettings = makeMockSettings({});
|
|
213
|
+
const value = getEffectiveValue('ui.requiresRestart', settings, mergedSettings);
|
|
87
214
|
expect(value).toBe(false); // default value
|
|
88
215
|
});
|
|
89
216
|
it('should handle nested settings correctly', () => {
|
|
90
|
-
const settings = {
|
|
217
|
+
const settings = makeMockSettings({
|
|
91
218
|
ui: { accessibility: { disableLoadingPhrases: true } },
|
|
92
|
-
};
|
|
93
|
-
const mergedSettings = {
|
|
219
|
+
});
|
|
220
|
+
const mergedSettings = makeMockSettings({
|
|
94
221
|
ui: { accessibility: { disableLoadingPhrases: false } },
|
|
95
|
-
};
|
|
222
|
+
});
|
|
96
223
|
const value = getEffectiveValue('ui.accessibility.disableLoadingPhrases', settings, mergedSettings);
|
|
97
224
|
expect(value).toBe(true);
|
|
98
225
|
});
|
|
99
226
|
it('should return undefined for invalid settings', () => {
|
|
100
|
-
const settings = {};
|
|
101
|
-
const mergedSettings = {};
|
|
227
|
+
const settings = makeMockSettings({});
|
|
228
|
+
const mergedSettings = makeMockSettings({});
|
|
102
229
|
const value = getEffectiveValue('invalidSetting', settings, mergedSettings);
|
|
103
230
|
expect(value).toBeUndefined();
|
|
104
231
|
});
|
|
@@ -106,9 +233,8 @@ describe('SettingsUtils', () => {
|
|
|
106
233
|
describe('getAllSettingKeys', () => {
|
|
107
234
|
it('should return all setting keys', () => {
|
|
108
235
|
const keys = getAllSettingKeys();
|
|
109
|
-
expect(keys).toContain('
|
|
236
|
+
expect(keys).toContain('test');
|
|
110
237
|
expect(keys).toContain('ui.accessibility.disableLoadingPhrases');
|
|
111
|
-
expect(keys).toContain('general.checkpointing.enabled');
|
|
112
238
|
});
|
|
113
239
|
});
|
|
114
240
|
describe('getSettingsByType', () => {
|
|
@@ -131,7 +257,7 @@ describe('SettingsUtils', () => {
|
|
|
131
257
|
});
|
|
132
258
|
describe('isValidSettingKey', () => {
|
|
133
259
|
it('should return true for valid setting keys', () => {
|
|
134
|
-
expect(isValidSettingKey('ui.
|
|
260
|
+
expect(isValidSettingKey('ui.requiresRestart')).toBe(true);
|
|
135
261
|
expect(isValidSettingKey('ui.accessibility.disableLoadingPhrases')).toBe(true);
|
|
136
262
|
});
|
|
137
263
|
it('should return false for invalid setting keys', () => {
|
|
@@ -141,7 +267,7 @@ describe('SettingsUtils', () => {
|
|
|
141
267
|
});
|
|
142
268
|
describe('getSettingCategory', () => {
|
|
143
269
|
it('should return correct category for valid settings', () => {
|
|
144
|
-
expect(getSettingCategory('ui.
|
|
270
|
+
expect(getSettingCategory('ui.requiresRestart')).toBe('UI');
|
|
145
271
|
expect(getSettingCategory('ui.accessibility.disableLoadingPhrases')).toBe('UI');
|
|
146
272
|
});
|
|
147
273
|
it('should return undefined for invalid settings', () => {
|
|
@@ -150,17 +276,12 @@ describe('SettingsUtils', () => {
|
|
|
150
276
|
});
|
|
151
277
|
describe('shouldShowInDialog', () => {
|
|
152
278
|
it('should return true for settings marked to show in dialog', () => {
|
|
153
|
-
expect(shouldShowInDialog('ui.
|
|
279
|
+
expect(shouldShowInDialog('ui.requiresRestart')).toBe(true);
|
|
154
280
|
expect(shouldShowInDialog('general.vimMode')).toBe(true);
|
|
155
281
|
expect(shouldShowInDialog('ui.hideWindowTitle')).toBe(true);
|
|
156
|
-
expect(shouldShowInDialog('privacy.usageStatisticsEnabled')).toBe(false);
|
|
157
282
|
});
|
|
158
283
|
it('should return false for settings marked to hide from dialog', () => {
|
|
159
|
-
expect(shouldShowInDialog('
|
|
160
|
-
expect(shouldShowInDialog('tools.core')).toBe(false);
|
|
161
|
-
expect(shouldShowInDialog('ui.customThemes')).toBe(false);
|
|
162
|
-
expect(shouldShowInDialog('ui.theme')).toBe(false); // Changed to false
|
|
163
|
-
expect(shouldShowInDialog('general.preferredEditor')).toBe(false); // Changed to false
|
|
284
|
+
expect(shouldShowInDialog('ui.theme')).toBe(false);
|
|
164
285
|
});
|
|
165
286
|
it('should return true for invalid settings (default behavior)', () => {
|
|
166
287
|
expect(shouldShowInDialog('invalidSetting')).toBe(true);
|
|
@@ -173,9 +294,8 @@ describe('SettingsUtils', () => {
|
|
|
173
294
|
expect(categories['UI']).toBeDefined();
|
|
174
295
|
const uiSettings = categories['UI'];
|
|
175
296
|
const uiKeys = uiSettings.map((s) => s.key);
|
|
176
|
-
expect(uiKeys).toContain('ui.
|
|
177
|
-
expect(uiKeys).toContain('ui.
|
|
178
|
-
expect(uiKeys).not.toContain('ui.customThemes'); // This is marked false
|
|
297
|
+
expect(uiKeys).toContain('ui.requiresRestart');
|
|
298
|
+
expect(uiKeys).toContain('ui.accessibility.disableLoadingPhrases');
|
|
179
299
|
expect(uiKeys).not.toContain('ui.theme'); // This is now marked false
|
|
180
300
|
});
|
|
181
301
|
it('should not include Advanced category settings', () => {
|
|
@@ -187,13 +307,8 @@ describe('SettingsUtils', () => {
|
|
|
187
307
|
const categories = getDialogSettingsByCategory();
|
|
188
308
|
const allSettings = Object.values(categories).flat();
|
|
189
309
|
const allKeys = allSettings.map((s) => s.key);
|
|
190
|
-
expect(allKeys).toContain('
|
|
191
|
-
expect(allKeys).toContain('
|
|
192
|
-
expect(allKeys).toContain('general.disableAutoUpdate');
|
|
193
|
-
expect(allKeys).toContain('ui.showMemoryUsage');
|
|
194
|
-
expect(allKeys).not.toContain('privacy.usageStatisticsEnabled');
|
|
195
|
-
expect(allKeys).not.toContain('security.auth.selectedType');
|
|
196
|
-
expect(allKeys).not.toContain('tools.core');
|
|
310
|
+
expect(allKeys).toContain('test');
|
|
311
|
+
expect(allKeys).toContain('ui.requiresRestart');
|
|
197
312
|
expect(allKeys).not.toContain('ui.theme'); // Now hidden
|
|
198
313
|
expect(allKeys).not.toContain('general.preferredEditor'); // Now hidden
|
|
199
314
|
});
|
|
@@ -202,9 +317,8 @@ describe('SettingsUtils', () => {
|
|
|
202
317
|
it('should return only boolean dialog settings', () => {
|
|
203
318
|
const booleanSettings = getDialogSettingsByType('boolean');
|
|
204
319
|
const keys = booleanSettings.map((s) => s.key);
|
|
205
|
-
expect(keys).toContain('ui.
|
|
206
|
-
expect(keys).toContain('
|
|
207
|
-
expect(keys).toContain('ui.hideWindowTitle');
|
|
320
|
+
expect(keys).toContain('ui.requiresRestart');
|
|
321
|
+
expect(keys).toContain('ui.accessibility.disableLoadingPhrases');
|
|
208
322
|
expect(keys).not.toContain('privacy.usageStatisticsEnabled');
|
|
209
323
|
expect(keys).not.toContain('security.auth.selectedType'); // Advanced setting
|
|
210
324
|
expect(keys).not.toContain('security.auth.useExternal'); // Advanced setting
|
|
@@ -216,32 +330,23 @@ describe('SettingsUtils', () => {
|
|
|
216
330
|
expect(keys).not.toContain('ui.theme'); // Now marked false
|
|
217
331
|
expect(keys).not.toContain('general.preferredEditor'); // Now marked false
|
|
218
332
|
expect(keys).not.toContain('security.auth.selectedType'); // Advanced setting
|
|
219
|
-
//
|
|
220
|
-
expect(keys
|
|
333
|
+
// Check that user-facing tool settings are included
|
|
334
|
+
expect(keys).toContain('tools.shell.pager');
|
|
335
|
+
// Check that advanced/hidden tool settings are excluded
|
|
336
|
+
expect(keys).not.toContain('tools.discoveryCommand');
|
|
337
|
+
expect(keys).not.toContain('tools.callCommand');
|
|
338
|
+
expect(keys.every((key) => !key.startsWith('advanced.'))).toBe(true);
|
|
221
339
|
});
|
|
222
340
|
});
|
|
223
341
|
describe('getDialogSettingKeys', () => {
|
|
224
342
|
it('should return only settings marked for dialog display', () => {
|
|
225
343
|
const dialogKeys = getDialogSettingKeys();
|
|
226
344
|
// Should include settings marked for dialog
|
|
227
|
-
expect(dialogKeys).toContain('ui.
|
|
228
|
-
expect(dialogKeys).toContain('general.vimMode');
|
|
229
|
-
expect(dialogKeys).toContain('ui.hideWindowTitle');
|
|
230
|
-
expect(dialogKeys).not.toContain('privacy.usageStatisticsEnabled');
|
|
231
|
-
expect(dialogKeys).toContain('ide.enabled');
|
|
232
|
-
expect(dialogKeys).toContain('general.disableAutoUpdate');
|
|
345
|
+
expect(dialogKeys).toContain('ui.requiresRestart');
|
|
233
346
|
// Should include nested settings marked for dialog
|
|
234
|
-
expect(dialogKeys).toContain('
|
|
235
|
-
expect(dialogKeys).toContain('context.fileFiltering.respectGeminiIgnore');
|
|
236
|
-
expect(dialogKeys).toContain('context.fileFiltering.enableRecursiveFileSearch');
|
|
347
|
+
expect(dialogKeys).toContain('ui.accessibility.disableLoadingPhrases');
|
|
237
348
|
// Should NOT include settings marked as hidden
|
|
238
349
|
expect(dialogKeys).not.toContain('ui.theme'); // Hidden
|
|
239
|
-
expect(dialogKeys).not.toContain('ui.customThemes'); // Hidden
|
|
240
|
-
expect(dialogKeys).not.toContain('general.preferredEditor'); // Hidden
|
|
241
|
-
expect(dialogKeys).not.toContain('security.auth.selectedType'); // Advanced
|
|
242
|
-
expect(dialogKeys).not.toContain('tools.core'); // Advanced
|
|
243
|
-
expect(dialogKeys).not.toContain('mcpServers'); // Advanced
|
|
244
|
-
expect(dialogKeys).not.toContain('telemetry'); // Advanced
|
|
245
350
|
});
|
|
246
351
|
it('should return fewer keys than getAllSettingKeys', () => {
|
|
247
352
|
const allKeys = getAllSettingKeys();
|
|
@@ -250,10 +355,43 @@ describe('SettingsUtils', () => {
|
|
|
250
355
|
expect(dialogKeys.length).toBeGreaterThan(0);
|
|
251
356
|
});
|
|
252
357
|
it('should handle nested settings display correctly', () => {
|
|
358
|
+
vi.mocked(getSettingsSchema).mockReturnValue({
|
|
359
|
+
context: {
|
|
360
|
+
type: 'object',
|
|
361
|
+
label: 'Context',
|
|
362
|
+
category: 'Context',
|
|
363
|
+
requiresRestart: false,
|
|
364
|
+
default: {},
|
|
365
|
+
description: 'Settings for managing context provided to the model.',
|
|
366
|
+
showInDialog: false,
|
|
367
|
+
properties: {
|
|
368
|
+
fileFiltering: {
|
|
369
|
+
type: 'object',
|
|
370
|
+
label: 'File Filtering',
|
|
371
|
+
category: 'Context',
|
|
372
|
+
requiresRestart: true,
|
|
373
|
+
default: {},
|
|
374
|
+
description: 'Settings for git-aware file filtering.',
|
|
375
|
+
showInDialog: false,
|
|
376
|
+
properties: {
|
|
377
|
+
respectGitIgnore: {
|
|
378
|
+
type: 'boolean',
|
|
379
|
+
label: 'Respect .gitignore',
|
|
380
|
+
category: 'Context',
|
|
381
|
+
requiresRestart: true,
|
|
382
|
+
default: true,
|
|
383
|
+
description: 'Respect .gitignore files when searching',
|
|
384
|
+
showInDialog: true,
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
});
|
|
253
391
|
// Test the specific issue with fileFiltering.respectGitIgnore
|
|
254
392
|
const key = 'context.fileFiltering.respectGitIgnore';
|
|
255
|
-
const initialSettings = {};
|
|
256
|
-
const pendingSettings = {};
|
|
393
|
+
const initialSettings = makeMockSettings({});
|
|
394
|
+
const pendingSettings = makeMockSettings({});
|
|
257
395
|
// Set the nested setting to true
|
|
258
396
|
const updatedPendingSettings = setPendingSettingValue(key, true, pendingSettings);
|
|
259
397
|
// Check if the setting exists in pending settings
|
|
@@ -275,79 +413,83 @@ describe('SettingsUtils', () => {
|
|
|
275
413
|
describe('Business Logic Utilities', () => {
|
|
276
414
|
describe('getSettingValue', () => {
|
|
277
415
|
it('should return value from settings when set', () => {
|
|
278
|
-
const settings = { ui: {
|
|
279
|
-
const mergedSettings = {
|
|
280
|
-
|
|
416
|
+
const settings = makeMockSettings({ ui: { requiresRestart: true } });
|
|
417
|
+
const mergedSettings = makeMockSettings({
|
|
418
|
+
ui: { requiresRestart: false },
|
|
419
|
+
});
|
|
420
|
+
const value = getSettingValue('ui.requiresRestart', settings, mergedSettings);
|
|
281
421
|
expect(value).toBe(true);
|
|
282
422
|
});
|
|
283
423
|
it('should return value from merged settings when not set in current scope', () => {
|
|
284
|
-
const settings = {};
|
|
285
|
-
const mergedSettings = {
|
|
286
|
-
|
|
424
|
+
const settings = makeMockSettings({});
|
|
425
|
+
const mergedSettings = makeMockSettings({
|
|
426
|
+
ui: { requiresRestart: true },
|
|
427
|
+
});
|
|
428
|
+
const value = getSettingValue('ui.requiresRestart', settings, mergedSettings);
|
|
287
429
|
expect(value).toBe(true);
|
|
288
430
|
});
|
|
289
431
|
it('should return default value for invalid setting', () => {
|
|
290
|
-
const settings = {};
|
|
291
|
-
const mergedSettings = {};
|
|
432
|
+
const settings = makeMockSettings({});
|
|
433
|
+
const mergedSettings = makeMockSettings({});
|
|
292
434
|
const value = getSettingValue('invalidSetting', settings, mergedSettings);
|
|
293
435
|
expect(value).toBe(false); // Default fallback
|
|
294
436
|
});
|
|
295
437
|
});
|
|
296
438
|
describe('isSettingModified', () => {
|
|
297
439
|
it('should return true when value differs from default', () => {
|
|
298
|
-
expect(isSettingModified('ui.
|
|
299
|
-
expect(isSettingModified('
|
|
440
|
+
expect(isSettingModified('ui.requiresRestart', true)).toBe(true);
|
|
441
|
+
expect(isSettingModified('ui.accessibility.disableLoadingPhrases', true)).toBe(true);
|
|
300
442
|
});
|
|
301
443
|
it('should return false when value matches default', () => {
|
|
302
|
-
expect(isSettingModified('ui.
|
|
303
|
-
expect(isSettingModified('
|
|
444
|
+
expect(isSettingModified('ui.requiresRestart', false)).toBe(false);
|
|
445
|
+
expect(isSettingModified('ui.accessibility.disableLoadingPhrases', false)).toBe(false);
|
|
304
446
|
});
|
|
305
447
|
});
|
|
306
448
|
describe('settingExistsInScope', () => {
|
|
307
449
|
it('should return true for top-level settings that exist', () => {
|
|
308
|
-
const settings = { ui: {
|
|
309
|
-
expect(settingExistsInScope('ui.
|
|
450
|
+
const settings = makeMockSettings({ ui: { requiresRestart: true } });
|
|
451
|
+
expect(settingExistsInScope('ui.requiresRestart', settings)).toBe(true);
|
|
310
452
|
});
|
|
311
453
|
it('should return false for top-level settings that do not exist', () => {
|
|
312
|
-
const settings = {};
|
|
313
|
-
expect(settingExistsInScope('ui.
|
|
454
|
+
const settings = makeMockSettings({});
|
|
455
|
+
expect(settingExistsInScope('ui.requiresRestart', settings)).toBe(false);
|
|
314
456
|
});
|
|
315
457
|
it('should return true for nested settings that exist', () => {
|
|
316
|
-
const settings = {
|
|
458
|
+
const settings = makeMockSettings({
|
|
317
459
|
ui: { accessibility: { disableLoadingPhrases: true } },
|
|
318
|
-
};
|
|
460
|
+
});
|
|
319
461
|
expect(settingExistsInScope('ui.accessibility.disableLoadingPhrases', settings)).toBe(true);
|
|
320
462
|
});
|
|
321
463
|
it('should return false for nested settings that do not exist', () => {
|
|
322
|
-
const settings = {};
|
|
464
|
+
const settings = makeMockSettings({});
|
|
323
465
|
expect(settingExistsInScope('ui.accessibility.disableLoadingPhrases', settings)).toBe(false);
|
|
324
466
|
});
|
|
325
467
|
it('should return false when parent exists but child does not', () => {
|
|
326
|
-
const settings = { ui: { accessibility: {} } };
|
|
468
|
+
const settings = makeMockSettings({ ui: { accessibility: {} } });
|
|
327
469
|
expect(settingExistsInScope('ui.accessibility.disableLoadingPhrases', settings)).toBe(false);
|
|
328
470
|
});
|
|
329
471
|
});
|
|
330
472
|
describe('setPendingSettingValue', () => {
|
|
331
473
|
it('should set top-level setting value', () => {
|
|
332
|
-
const pendingSettings = {};
|
|
333
|
-
const result = setPendingSettingValue('ui.
|
|
334
|
-
expect(result.ui?.
|
|
474
|
+
const pendingSettings = makeMockSettings({});
|
|
475
|
+
const result = setPendingSettingValue('ui.hideWindowTitle', true, pendingSettings);
|
|
476
|
+
expect(result.ui?.hideWindowTitle).toBe(true);
|
|
335
477
|
});
|
|
336
478
|
it('should set nested setting value', () => {
|
|
337
|
-
const pendingSettings = {};
|
|
479
|
+
const pendingSettings = makeMockSettings({});
|
|
338
480
|
const result = setPendingSettingValue('ui.accessibility.disableLoadingPhrases', true, pendingSettings);
|
|
339
481
|
expect(result.ui?.accessibility?.disableLoadingPhrases).toBe(true);
|
|
340
482
|
});
|
|
341
483
|
it('should preserve existing nested settings', () => {
|
|
342
|
-
const pendingSettings = {
|
|
484
|
+
const pendingSettings = makeMockSettings({
|
|
343
485
|
ui: { accessibility: { disableLoadingPhrases: false } },
|
|
344
|
-
};
|
|
486
|
+
});
|
|
345
487
|
const result = setPendingSettingValue('ui.accessibility.disableLoadingPhrases', true, pendingSettings);
|
|
346
488
|
expect(result.ui?.accessibility?.disableLoadingPhrases).toBe(true);
|
|
347
489
|
});
|
|
348
490
|
it('should not mutate original settings', () => {
|
|
349
|
-
const pendingSettings = {};
|
|
350
|
-
setPendingSettingValue('ui.
|
|
491
|
+
const pendingSettings = makeMockSettings({});
|
|
492
|
+
setPendingSettingValue('ui.requiresRestart', true, pendingSettings);
|
|
351
493
|
expect(pendingSettings).toEqual({});
|
|
352
494
|
});
|
|
353
495
|
});
|
|
@@ -355,15 +497,12 @@ describe('SettingsUtils', () => {
|
|
|
355
497
|
it('should return true when modified settings require restart', () => {
|
|
356
498
|
const modifiedSettings = new Set([
|
|
357
499
|
'advanced.autoConfigureMemory',
|
|
358
|
-
'ui.
|
|
500
|
+
'ui.requiresRestart',
|
|
359
501
|
]);
|
|
360
502
|
expect(hasRestartRequiredSettings(modifiedSettings)).toBe(true);
|
|
361
503
|
});
|
|
362
504
|
it('should return false when no modified settings require restart', () => {
|
|
363
|
-
const modifiedSettings = new Set([
|
|
364
|
-
'ui.showMemoryUsage',
|
|
365
|
-
'ui.hideTips',
|
|
366
|
-
]);
|
|
505
|
+
const modifiedSettings = new Set(['test']);
|
|
367
506
|
expect(hasRestartRequiredSettings(modifiedSettings)).toBe(false);
|
|
368
507
|
});
|
|
369
508
|
it('should return false for empty set', () => {
|
|
@@ -374,18 +513,16 @@ describe('SettingsUtils', () => {
|
|
|
374
513
|
describe('getRestartRequiredFromModified', () => {
|
|
375
514
|
it('should return only settings that require restart', () => {
|
|
376
515
|
const modifiedSettings = new Set([
|
|
377
|
-
'
|
|
378
|
-
'
|
|
379
|
-
'general.checkpointing.enabled',
|
|
516
|
+
'ui.requiresRestart',
|
|
517
|
+
'test',
|
|
380
518
|
]);
|
|
381
519
|
const result = getRestartRequiredFromModified(modifiedSettings);
|
|
382
|
-
expect(result).toContain('
|
|
383
|
-
expect(result).toContain('
|
|
384
|
-
expect(result).not.toContain('ui.showMemoryUsage');
|
|
520
|
+
expect(result).toContain('ui.requiresRestart');
|
|
521
|
+
expect(result).not.toContain('test');
|
|
385
522
|
});
|
|
386
523
|
it('should return empty array when no settings require restart', () => {
|
|
387
524
|
const modifiedSettings = new Set([
|
|
388
|
-
'
|
|
525
|
+
'requiresRestart',
|
|
389
526
|
'hideTips',
|
|
390
527
|
]);
|
|
391
528
|
const result = getRestartRequiredFromModified(modifiedSettings);
|
|
@@ -393,116 +530,276 @@ describe('SettingsUtils', () => {
|
|
|
393
530
|
});
|
|
394
531
|
});
|
|
395
532
|
describe('getDisplayValue', () => {
|
|
533
|
+
describe('enum behavior', () => {
|
|
534
|
+
let StringEnum;
|
|
535
|
+
(function (StringEnum) {
|
|
536
|
+
StringEnum["FOO"] = "foo";
|
|
537
|
+
StringEnum["BAR"] = "bar";
|
|
538
|
+
StringEnum["BAZ"] = "baz";
|
|
539
|
+
})(StringEnum || (StringEnum = {}));
|
|
540
|
+
let NumberEnum;
|
|
541
|
+
(function (NumberEnum) {
|
|
542
|
+
NumberEnum[NumberEnum["ONE"] = 1] = "ONE";
|
|
543
|
+
NumberEnum[NumberEnum["TWO"] = 2] = "TWO";
|
|
544
|
+
NumberEnum[NumberEnum["THREE"] = 3] = "THREE";
|
|
545
|
+
})(NumberEnum || (NumberEnum = {}));
|
|
546
|
+
const SETTING = {
|
|
547
|
+
type: 'enum',
|
|
548
|
+
label: 'Theme',
|
|
549
|
+
options: [
|
|
550
|
+
{
|
|
551
|
+
value: StringEnum.FOO,
|
|
552
|
+
label: 'Foo',
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
value: StringEnum.BAR,
|
|
556
|
+
label: 'Bar',
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
value: StringEnum.BAZ,
|
|
560
|
+
label: 'Baz',
|
|
561
|
+
},
|
|
562
|
+
],
|
|
563
|
+
category: 'UI',
|
|
564
|
+
requiresRestart: false,
|
|
565
|
+
default: StringEnum.BAR,
|
|
566
|
+
description: 'The color theme for the UI.',
|
|
567
|
+
showInDialog: false,
|
|
568
|
+
};
|
|
569
|
+
it('handles display of number-based enums', () => {
|
|
570
|
+
vi.mocked(getSettingsSchema).mockReturnValue({
|
|
571
|
+
ui: {
|
|
572
|
+
properties: {
|
|
573
|
+
theme: {
|
|
574
|
+
...SETTING,
|
|
575
|
+
options: [
|
|
576
|
+
{
|
|
577
|
+
value: NumberEnum.ONE,
|
|
578
|
+
label: 'One',
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
value: NumberEnum.TWO,
|
|
582
|
+
label: 'Two',
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
value: NumberEnum.THREE,
|
|
586
|
+
label: 'Three',
|
|
587
|
+
},
|
|
588
|
+
],
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
|
+
},
|
|
592
|
+
});
|
|
593
|
+
const settings = makeMockSettings({
|
|
594
|
+
ui: { theme: NumberEnum.THREE },
|
|
595
|
+
});
|
|
596
|
+
const mergedSettings = makeMockSettings({
|
|
597
|
+
ui: { theme: NumberEnum.THREE },
|
|
598
|
+
});
|
|
599
|
+
const modifiedSettings = new Set();
|
|
600
|
+
const result = getDisplayValue('ui.theme', settings, mergedSettings, modifiedSettings);
|
|
601
|
+
expect(result).toBe('Three*');
|
|
602
|
+
});
|
|
603
|
+
it('handles default values for number-based enums', () => {
|
|
604
|
+
vi.mocked(getSettingsSchema).mockReturnValue({
|
|
605
|
+
ui: {
|
|
606
|
+
properties: {
|
|
607
|
+
theme: {
|
|
608
|
+
...SETTING,
|
|
609
|
+
default: NumberEnum.THREE,
|
|
610
|
+
options: [
|
|
611
|
+
{
|
|
612
|
+
value: NumberEnum.ONE,
|
|
613
|
+
label: 'One',
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
value: NumberEnum.TWO,
|
|
617
|
+
label: 'Two',
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
value: NumberEnum.THREE,
|
|
621
|
+
label: 'Three',
|
|
622
|
+
},
|
|
623
|
+
],
|
|
624
|
+
},
|
|
625
|
+
},
|
|
626
|
+
},
|
|
627
|
+
});
|
|
628
|
+
const modifiedSettings = new Set();
|
|
629
|
+
const result = getDisplayValue('ui.theme', makeMockSettings({}), makeMockSettings({}), modifiedSettings);
|
|
630
|
+
expect(result).toBe('Three');
|
|
631
|
+
});
|
|
632
|
+
it('shows the enum display value', () => {
|
|
633
|
+
vi.mocked(getSettingsSchema).mockReturnValue({
|
|
634
|
+
ui: { properties: { theme: { ...SETTING } } },
|
|
635
|
+
});
|
|
636
|
+
const settings = makeMockSettings({ ui: { theme: StringEnum.BAR } });
|
|
637
|
+
const mergedSettings = makeMockSettings({
|
|
638
|
+
ui: { theme: StringEnum.BAR },
|
|
639
|
+
});
|
|
640
|
+
const modifiedSettings = new Set();
|
|
641
|
+
const result = getDisplayValue('ui.theme', settings, mergedSettings, modifiedSettings);
|
|
642
|
+
expect(result).toBe('Bar*');
|
|
643
|
+
});
|
|
644
|
+
it('passes through unknown values verbatim', () => {
|
|
645
|
+
vi.mocked(getSettingsSchema).mockReturnValue({
|
|
646
|
+
ui: {
|
|
647
|
+
properties: {
|
|
648
|
+
theme: { ...SETTING },
|
|
649
|
+
},
|
|
650
|
+
},
|
|
651
|
+
});
|
|
652
|
+
const settings = makeMockSettings({ ui: { theme: 'xyz' } });
|
|
653
|
+
const mergedSettings = makeMockSettings({ ui: { theme: 'xyz' } });
|
|
654
|
+
const modifiedSettings = new Set();
|
|
655
|
+
const result = getDisplayValue('ui.theme', settings, mergedSettings, modifiedSettings);
|
|
656
|
+
expect(result).toBe('xyz*');
|
|
657
|
+
});
|
|
658
|
+
it('shows the default value for string enums', () => {
|
|
659
|
+
vi.mocked(getSettingsSchema).mockReturnValue({
|
|
660
|
+
ui: {
|
|
661
|
+
properties: {
|
|
662
|
+
theme: { ...SETTING, default: StringEnum.BAR },
|
|
663
|
+
},
|
|
664
|
+
},
|
|
665
|
+
});
|
|
666
|
+
const modifiedSettings = new Set();
|
|
667
|
+
const result = getDisplayValue('ui.theme', makeMockSettings({}), makeMockSettings({}), modifiedSettings);
|
|
668
|
+
expect(result).toBe('Bar');
|
|
669
|
+
});
|
|
670
|
+
});
|
|
396
671
|
it('should show value without * when setting matches default', () => {
|
|
397
|
-
const settings = {
|
|
398
|
-
|
|
672
|
+
const settings = makeMockSettings({
|
|
673
|
+
ui: { requiresRestart: false },
|
|
674
|
+
}); // false matches default, so no *
|
|
675
|
+
const mergedSettings = makeMockSettings({
|
|
676
|
+
ui: { requiresRestart: false },
|
|
677
|
+
});
|
|
399
678
|
const modifiedSettings = new Set();
|
|
400
|
-
const result = getDisplayValue('ui.
|
|
679
|
+
const result = getDisplayValue('ui.requiresRestart', settings, mergedSettings, modifiedSettings);
|
|
401
680
|
expect(result).toBe('false*');
|
|
402
681
|
});
|
|
403
682
|
it('should show default value when setting is not in scope', () => {
|
|
404
|
-
const settings = {}; // no setting in scope
|
|
405
|
-
const mergedSettings = {
|
|
683
|
+
const settings = makeMockSettings({}); // no setting in scope
|
|
684
|
+
const mergedSettings = makeMockSettings({
|
|
685
|
+
ui: { requiresRestart: false },
|
|
686
|
+
});
|
|
406
687
|
const modifiedSettings = new Set();
|
|
407
|
-
const result = getDisplayValue('ui.
|
|
688
|
+
const result = getDisplayValue('ui.requiresRestart', settings, mergedSettings, modifiedSettings);
|
|
408
689
|
expect(result).toBe('false'); // shows default value
|
|
409
690
|
});
|
|
410
691
|
it('should show value with * when changed from default', () => {
|
|
411
|
-
const settings = { ui: {
|
|
412
|
-
const mergedSettings = {
|
|
692
|
+
const settings = makeMockSettings({ ui: { requiresRestart: true } }); // true is different from default (false)
|
|
693
|
+
const mergedSettings = makeMockSettings({
|
|
694
|
+
ui: { requiresRestart: true },
|
|
695
|
+
});
|
|
413
696
|
const modifiedSettings = new Set();
|
|
414
|
-
const result = getDisplayValue('ui.
|
|
697
|
+
const result = getDisplayValue('ui.requiresRestart', settings, mergedSettings, modifiedSettings);
|
|
415
698
|
expect(result).toBe('true*');
|
|
416
699
|
});
|
|
417
700
|
it('should show default value without * when setting does not exist in scope', () => {
|
|
418
|
-
const settings = {}; // setting doesn't exist in scope, show default
|
|
419
|
-
const mergedSettings = {
|
|
701
|
+
const settings = makeMockSettings({}); // setting doesn't exist in scope, show default
|
|
702
|
+
const mergedSettings = makeMockSettings({
|
|
703
|
+
ui: { requiresRestart: false },
|
|
704
|
+
});
|
|
420
705
|
const modifiedSettings = new Set();
|
|
421
|
-
const result = getDisplayValue('ui.
|
|
706
|
+
const result = getDisplayValue('ui.requiresRestart', settings, mergedSettings, modifiedSettings);
|
|
422
707
|
expect(result).toBe('false'); // default value (false) without *
|
|
423
708
|
});
|
|
424
709
|
it('should show value with * when user changes from default', () => {
|
|
425
|
-
const settings = {}; // setting doesn't exist in scope originally
|
|
426
|
-
const mergedSettings = {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
const
|
|
710
|
+
const settings = makeMockSettings({}); // setting doesn't exist in scope originally
|
|
711
|
+
const mergedSettings = makeMockSettings({
|
|
712
|
+
ui: { requiresRestart: false },
|
|
713
|
+
});
|
|
714
|
+
const modifiedSettings = new Set(['ui.requiresRestart']);
|
|
715
|
+
const pendingSettings = makeMockSettings({
|
|
716
|
+
ui: { requiresRestart: true },
|
|
717
|
+
}); // user changed to true
|
|
718
|
+
const result = getDisplayValue('ui.requiresRestart', settings, mergedSettings, modifiedSettings, pendingSettings);
|
|
430
719
|
expect(result).toBe('true*'); // changed from default (false) to true
|
|
431
720
|
});
|
|
432
721
|
});
|
|
433
722
|
describe('isDefaultValue', () => {
|
|
434
723
|
it('should return true when setting does not exist in scope', () => {
|
|
435
|
-
const settings = {}; // setting doesn't exist
|
|
436
|
-
const result = isDefaultValue('ui.
|
|
724
|
+
const settings = makeMockSettings({}); // setting doesn't exist
|
|
725
|
+
const result = isDefaultValue('ui.requiresRestart', settings);
|
|
437
726
|
expect(result).toBe(true);
|
|
438
727
|
});
|
|
439
728
|
it('should return false when setting exists in scope', () => {
|
|
440
|
-
const settings = { ui: {
|
|
441
|
-
const result = isDefaultValue('ui.
|
|
729
|
+
const settings = makeMockSettings({ ui: { requiresRestart: true } }); // setting exists
|
|
730
|
+
const result = isDefaultValue('ui.requiresRestart', settings);
|
|
442
731
|
expect(result).toBe(false);
|
|
443
732
|
});
|
|
444
733
|
it('should return true when nested setting does not exist in scope', () => {
|
|
445
|
-
const settings = {}; // nested setting doesn't exist
|
|
734
|
+
const settings = makeMockSettings({}); // nested setting doesn't exist
|
|
446
735
|
const result = isDefaultValue('ui.accessibility.disableLoadingPhrases', settings);
|
|
447
736
|
expect(result).toBe(true);
|
|
448
737
|
});
|
|
449
738
|
it('should return false when nested setting exists in scope', () => {
|
|
450
|
-
const settings = {
|
|
739
|
+
const settings = makeMockSettings({
|
|
451
740
|
ui: { accessibility: { disableLoadingPhrases: true } },
|
|
452
|
-
}; // nested setting exists
|
|
741
|
+
}); // nested setting exists
|
|
453
742
|
const result = isDefaultValue('ui.accessibility.disableLoadingPhrases', settings);
|
|
454
743
|
expect(result).toBe(false);
|
|
455
744
|
});
|
|
456
745
|
});
|
|
457
746
|
describe('isValueInherited', () => {
|
|
458
747
|
it('should return false for top-level settings that exist in scope', () => {
|
|
459
|
-
const settings = { ui: {
|
|
460
|
-
const mergedSettings = {
|
|
461
|
-
|
|
748
|
+
const settings = makeMockSettings({ ui: { requiresRestart: true } });
|
|
749
|
+
const mergedSettings = makeMockSettings({
|
|
750
|
+
ui: { requiresRestart: true },
|
|
751
|
+
});
|
|
752
|
+
const result = isValueInherited('ui.requiresRestart', settings, mergedSettings);
|
|
462
753
|
expect(result).toBe(false);
|
|
463
754
|
});
|
|
464
755
|
it('should return true for top-level settings that do not exist in scope', () => {
|
|
465
|
-
const settings = {};
|
|
466
|
-
const mergedSettings = {
|
|
467
|
-
|
|
756
|
+
const settings = makeMockSettings({});
|
|
757
|
+
const mergedSettings = makeMockSettings({
|
|
758
|
+
ui: { requiresRestart: true },
|
|
759
|
+
});
|
|
760
|
+
const result = isValueInherited('ui.requiresRestart', settings, mergedSettings);
|
|
468
761
|
expect(result).toBe(true);
|
|
469
762
|
});
|
|
470
763
|
it('should return false for nested settings that exist in scope', () => {
|
|
471
|
-
const settings = {
|
|
764
|
+
const settings = makeMockSettings({
|
|
472
765
|
ui: { accessibility: { disableLoadingPhrases: true } },
|
|
473
|
-
};
|
|
474
|
-
const mergedSettings = {
|
|
766
|
+
});
|
|
767
|
+
const mergedSettings = makeMockSettings({
|
|
475
768
|
ui: { accessibility: { disableLoadingPhrases: true } },
|
|
476
|
-
};
|
|
769
|
+
});
|
|
477
770
|
const result = isValueInherited('ui.accessibility.disableLoadingPhrases', settings, mergedSettings);
|
|
478
771
|
expect(result).toBe(false);
|
|
479
772
|
});
|
|
480
773
|
it('should return true for nested settings that do not exist in scope', () => {
|
|
481
|
-
const settings = {};
|
|
482
|
-
const mergedSettings = {
|
|
774
|
+
const settings = makeMockSettings({});
|
|
775
|
+
const mergedSettings = makeMockSettings({
|
|
483
776
|
ui: { accessibility: { disableLoadingPhrases: true } },
|
|
484
|
-
};
|
|
777
|
+
});
|
|
485
778
|
const result = isValueInherited('ui.accessibility.disableLoadingPhrases', settings, mergedSettings);
|
|
486
779
|
expect(result).toBe(true);
|
|
487
780
|
});
|
|
488
781
|
});
|
|
489
782
|
describe('getEffectiveDisplayValue', () => {
|
|
490
783
|
it('should return value from settings when available', () => {
|
|
491
|
-
const settings = { ui: {
|
|
492
|
-
const mergedSettings = {
|
|
493
|
-
|
|
784
|
+
const settings = makeMockSettings({ ui: { requiresRestart: true } });
|
|
785
|
+
const mergedSettings = makeMockSettings({
|
|
786
|
+
ui: { requiresRestart: false },
|
|
787
|
+
});
|
|
788
|
+
const result = getEffectiveDisplayValue('ui.requiresRestart', settings, mergedSettings);
|
|
494
789
|
expect(result).toBe(true);
|
|
495
790
|
});
|
|
496
791
|
it('should return value from merged settings when not in scope', () => {
|
|
497
|
-
const settings = {};
|
|
498
|
-
const mergedSettings = {
|
|
499
|
-
|
|
792
|
+
const settings = makeMockSettings({});
|
|
793
|
+
const mergedSettings = makeMockSettings({
|
|
794
|
+
ui: { requiresRestart: true },
|
|
795
|
+
});
|
|
796
|
+
const result = getEffectiveDisplayValue('ui.requiresRestart', settings, mergedSettings);
|
|
500
797
|
expect(result).toBe(true);
|
|
501
798
|
});
|
|
502
799
|
it('should return default value for undefined values', () => {
|
|
503
|
-
const settings = {};
|
|
504
|
-
const mergedSettings = {};
|
|
505
|
-
const result = getEffectiveDisplayValue('ui.
|
|
800
|
+
const settings = makeMockSettings({});
|
|
801
|
+
const mergedSettings = makeMockSettings({});
|
|
802
|
+
const result = getEffectiveDisplayValue('ui.requiresRestart', settings, mergedSettings);
|
|
506
803
|
expect(result).toBe(false); // Default value
|
|
507
804
|
});
|
|
508
805
|
});
|