Repository navigation
refactor(repaint): AI Repaint is the second feature module, with a Settings tab and an MCP tool - #258
Merged
Merged
Conversation
…ttings tab and an MCP tool The repaint panel, its Settings tab and the provider registry move from src/ into features/repaint/renderer/, and the repaint job, its history, the style library, the reference picker and the repaint_asset MCP tool move from electron/ into features/repaint/electron/. The host reads what the feature contributes from features/repaint/manifest.mjs. No behaviour changes. What stays in the host, and why: the AI providers' credentials, preferences and model listing (electron/ipc/ai.js) also serve the editor's text tool (HandwritingModal reads getAiPreferences / getAiProviderToken), so ipc/ai.js keeps them and the text-image channels; dedupeModels, used by both, becomes src/utils/aiModels.js. The picker memory (pickerStart / rememberPicker) moves into createDialogs so host.dialogs serves every module; the repaint picker registers from the feature. New manifest fields: settingsTab (SettingsOverlay places it by TAB_ORDER, features/index.js exports settingsTabs), mcpTools (electron/features.js loadMcpToolGroups, appended to mcp/tools/index.js GROUPS; toolSchemas.test scans them), editorTool.mount: "always" (honoured by EditorOverlay by hand). IPC_METHODS keeps 183 methods, tools/list keeps 37 tools. Tests: features/repaint/electron/repaint.test.js (5, incl. channels == manifest), features.test.js covers loadMcpToolGroups, dialogs.test.js keeps the handwriting picker memory. Verified: lint, electron 290/290, renderer 432/432, build, full e2e 434 passed / 14 skipped. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 2 of docs/feature-modules-plan.md §7, after PR 1 (#257). Zero behaviour change: AI Repaint moves into
features/repaint/, and the manifest grows two fields the LUT did not need — a Settings tab and an MCP tool.Moved (
git mv)src/components/editor/AiRepaintPanel.jsx,settings/RepaintSettings.jsx,ai/providers.jsxfeatures/repaint/renderer/electron/ipc/ai.js(status, start, history, styles) andpick-repaint-refsfromipc/dialogs.jsfeatures/repaint/electron/repaint.jsrepaint_assetfrommcp/tools/assets.jsfeatures/repaint/electron/mcpTools.jsshared/ipcChannels.mjsfeatures/repaint/manifest.mjscontributes.ipcWhat stays in the host, and why
electron/ipc/ai.jswith the text-image channels: the text tool'sHandwritingModalreadsgetAiPreferences/getAiProviderTokendirectly, so they are a host service two features share. The file keeps its name; its header now says "AI providers + text image".dedupeModels(used byHandwritingModalandRepaintSettings) becomessrc/utils/aiModels.js. The rest ofproviders.jsx(PROVIDER_TYPES,ProviderModal,getProviderType) goes with repaint.pickerStart/rememberPickermove fromdialogs.js's register intocreateDialogs(...)(which now takesreadAppSettings/updateAppSettings), sohost.dialogsserves the feature's picker too.tasks.js'sstartAiRepaintTask/activeRepaintProvider,api/browser/ai.js, the sidecar's provider if-chain: untouched (registry merge is a later PR, as planned).New manifest fields
settingsTab: { id: "repaint", key: "repaint" }→features/index.jssettingsTabs;SettingsOverlay.jsxisCORE_TABS+ feature tabs placed byTAB_ORDER, pane rendered from the table.mcpTools: "./electron/mcpTools.js"→electron/features.jsloadMcpToolGroups(), spread at the end ofmcp/tools/index.jsGROUPS;toolSchemas.test.jsscans the feature files from the manifests. Still 37 tools;08-mcp-httpunchanged.editorTool.mount: "always": the panel is a plain import (no lazy chunk) because the editor keeps it mounted; EditorOverlay still does that by hand.Tests
features/repaint/electron/repaint.test.js(5: channels match the manifest, start/history forwarding, styles file, picker, picker memory);features.test.jscoversloadMcpToolGroups;dialogs.test.jskeeps the handwriting picker memory.IPC_METHODSis still 183 rows.Verified
npm run lint, electron 290/290, renderer 432/432,npm run build, fullnpm run e2e: 434 passed, 14 skipped, 0 failed (13.8 min). Not done:e2e:coverage.Docs: plan status line + §7 as-built record,
docs/README.md,features/README.md.🤖 Generated with Claude Code