feat: plugin system UI extensions, error modal, and test fixes#101
feat: plugin system UI extensions, error modal, and test fixes#101
Conversation
Adds a slot-based UI extension system allowing plugins to inject React components into predefined locations throughout the application. Includes PluginSlotRegistry context, SlotAnchor component with ErrorBoundary isolation, plugin API hooks (usePluginQuery, usePluginConnection, usePluginToast, usePluginSetting, usePluginTheme), dynamic module loader, and 8 slot anchors across NewRowModal, RowEditorSidebar, TableToolbar, DataGrid context menu, Sidebar footer, and Settings plugin actions. https://claude.ai/code/session_01CJqE5Hdg5nXnEJSK4SCXbt
Update spec from Draft v0.1 to Implemented v0.2 with actual types matching the implementation (SlotName, SlotContext, SlotComponentProps, PluginSlotRegistryType). Add the 8th slot (settings.plugin.actions) to spec, blog post, wiki, and plugin guide. Add UI Extensions section to wiki/plugins.md and PLUGIN_GUIDE.md. Update plugins/README.md with UI extension references. https://claude.ai/code/session_01CJqE5Hdg5nXnEJSK4SCXbt
Add a built-in JSON Viewer plugin demonstrating the slot-based UI extension system. The plugin renders collapsible, syntax-highlighted JSON trees for JSON/JSONB columns in the row editor sidebar and new row modal. - Create JsonPreview component with recursive JSON tree rendering - Register builtin plugin contributions in PluginSlotProvider - Add 12 tests for JsonPreview and fix 3 PluginSlotProvider tests - Update plugin documentation (wiki, guide) with example plugin details https://claude.ai/code/session_01CJqE5Hdg5nXnEJSK4SCXbt
export usePluginModal and PluginModalOptions; integrate provider into App and plugin API
replace tauri dialog messages in DataGrid and Editor
load_editor_preferences
Code Review SummaryStatus: 5 Issues Found (all pre-existing) | Recommendation: Address before merge Overview
SummaryThis PR introduces a comprehensive Plugin UI Extensions system (Phase 2) including:
Pre-existing Issues
Code Quality ObservationsPositive:
Notes:
Files Reviewed (33 files)Core Plugin System:
UI Components:
Layout Components:
Backend (Rust):
Other:
Fix these issues in Kilo Cloud Reviewed by kimi-k2.5-0127 · 410,279 tokens |
| title: t("general.error"), | ||
| kind: "error", | ||
| }); | ||
| setErrorModal({ isOpen: true, message: t("editor.failedCreateRow") + String(err) }); |
There was a problem hiding this comment.
WARNING: Missing space between translated message and error
The error message concatenation is missing a separator space:
| setErrorModal({ isOpen: true, message: t("editor.failedCreateRow") + String(err) }); | |
| setErrorModal({ isOpen: true, message: t("editor.failedCreateRow") + " " + String(err) }); |
| title: t("common.error"), | ||
| kind: "error", | ||
| }); | ||
| setErrorModal({ isOpen: true, message: t("editor.failedProcessInsertions") + String(err) }); |
There was a problem hiding this comment.
WARNING: Missing space between translated message and error
The error message concatenation is missing a separator space:
| setErrorModal({ isOpen: true, message: t("editor.failedProcessInsertions") + String(err) }); | |
| setErrorModal({ isOpen: true, message: t("editor.failedProcessInsertions") + " " + String(err) }); |
| title: t("common.error"), | ||
| kind: "error", | ||
| }); | ||
| setErrorModal({ isOpen: true, message: t("dataGrid.updateFailed") + String(e) }); |
There was a problem hiding this comment.
WARNING: Missing space between translated message and error
The error message concatenation is missing a separator space:
| setErrorModal({ isOpen: true, message: t("dataGrid.updateFailed") + String(e) }); | |
| setErrorModal({ isOpen: true, message: t("dataGrid.updateFailed") + " " + String(e) }); |
Summary
PluginSlotProvider,SlotAnchor, error boundaries, and IIFE module loading for external plugin bundles. Plugins can contribute UI components to predefined slots (toolbar, context menu, sidebar, row editor, settings, connection modal).PluginModalContext/PluginModalProviderfor plugin-managed modals, andusePluginApihooks (usePluginQuery,usePluginConnection,usePluginToast,usePluginModal,usePluginTheme,usePluginTranslation,usePluginSetting).manage_tablescapability: Gating for table management actions (create, rename, drop, truncate) based on driver capabilities — external plugin drivers can now opt in or out.ErrorModalcomponent: New in-app error modal replacing native Taurimessage()dialogs inDataGrid.tsxandEditor.tsxfor a consistent UX.SlotAnchor,PluginSlotProvider, andEditorProvidertests — added missingSettingsContextwrapper, removed stalebuiltinPluginContributionsimport, and handledload_editor_preferencesmock.Test plan