feat(plugins): move OCR management to Plugins Hub - #2067
Conversation
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughLight OCR is integrated into the Plugins Hub and composer with dedicated routing, shared runtime status, focus-aware polling, progressive attachment controls, localized labels, and expanded tests. ChangesLight OCR Plugins Hub and composer integration
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/renderer/stores/spotlight.test.ts (1)
8-11: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover the
agentTypeACP compatibility branch.The production condition uses
selectedAgent.agentType ?? selectedAgent.type, but the new test only exercises the fallbacktype: 'acp'path. Add a focused case with{ type: 'deepchat', agentType: 'acp' }to verify the precedence used by the compatibility route.As per coding guidelines, add the smallest regression test for user-visible behavior or a documented contract.
Also applies to: 255-295
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/renderer/stores/spotlight.test.ts` around lines 8 - 11, Extend the selected-agent test coverage with a focused case using { type: 'deepchat', agentType: 'acp' } to exercise the compatibility route’s agentType precedence. Keep the existing fallback type: 'acp' case and assert the same user-visible ACP behavior for this override scenario.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/renderer/stores/spotlight.test.ts`:
- Around line 8-11: Extend the selected-agent test coverage with a focused case
using { type: 'deepchat', agentType: 'acp' } to exercise the compatibility
route’s agentType precedence. Keep the existing fallback type: 'acp' case and
assert the same user-visible ACP behavior for this override scenario.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: d0baf395-fc9c-4a46-8385-be2ae6fc621e
📒 Files selected for processing (37)
docs/features/light-ocr-integration/spec.mddocs/features/plugins-hub/spec.mdsrc/renderer/settings/components/OcrSettings.vuesrc/renderer/src/i18n/da-DK/settings.jsonsrc/renderer/src/i18n/de-DE/settings.jsonsrc/renderer/src/i18n/en-US/settings.jsonsrc/renderer/src/i18n/es-ES/settings.jsonsrc/renderer/src/i18n/fa-IR/settings.jsonsrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/i18n/he-IL/settings.jsonsrc/renderer/src/i18n/id-ID/settings.jsonsrc/renderer/src/i18n/it-IT/settings.jsonsrc/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ko-KR/settings.jsonsrc/renderer/src/i18n/ms-MY/settings.jsonsrc/renderer/src/i18n/pl-PL/settings.jsonsrc/renderer/src/i18n/pt-BR/settings.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/tr-TR/settings.jsonsrc/renderer/src/i18n/vi-VN/settings.jsonsrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/renderer/src/pages/plugins/OcrPluginsPage.vuesrc/renderer/src/pages/plugins/PluginsCatalogPage.vuesrc/renderer/src/router/index.tssrc/renderer/src/stores/pluginCatalog.tssrc/renderer/src/stores/ui/spotlight.tssrc/shared/settingsNavigation.tssrc/types/i18n.d.tstest/main/shared/settingsNavigation.test.tstest/renderer/components/OcrSettings.test.tstest/renderer/components/PluginPageWrappers.test.tstest/renderer/components/PluginsCatalogPage.test.tstest/renderer/router/pluginsRouter.test.tstest/renderer/stores/pluginCatalogStore.test.tstest/renderer/stores/spotlight.test.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/renderer/src/components/chat/nodes/FileAttachmentView.vue`:
- Around line 231-237: Replace the stylesheet-based coarse-pointer override in
FileAttachmentView’s attachment-representation-trigger with a VueUse
media-query-driven class binding for (pointer: coarse), ensuring the trigger
remains visible on touch devices regardless of Tailwind stylesheet ordering;
remove the conflicting scoped CSS rule and preserve the existing hover behavior
for non-coarse pointers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1b86b4e9-1e67-400c-8016-6c70c87be89b
📒 Files selected for processing (16)
docs/features/light-ocr-integration/plan.mddocs/features/light-ocr-integration/spec.mddocs/features/light-ocr-integration/tasks.mddocs/features/plugins-hub/spec.mdsrc/renderer/src/components/chat/ChatInputBox.vuesrc/renderer/src/components/chat/attachmentModelPicker.tssrc/renderer/src/components/chat/nodes/FileAttachmentView.vuesrc/renderer/src/components/chat/nodes/symbols.tssrc/renderer/src/features/chat-page/ChatPage.vuesrc/renderer/src/features/chat-page/composables/useComposerSubmit.tssrc/renderer/src/pages/NewThreadPage.vuetest/renderer/components/ChatInputBox.test.tstest/renderer/components/ChatPage.test.tstest/renderer/components/FileAttachmentView.test.tstest/renderer/components/NewThreadPage.test.tstest/renderer/features/chat-page/composables/useComposerSubmit.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- docs/features/plugins-hub/spec.md
- docs/features/light-ocr-integration/spec.md
| <style scoped> | ||
| @media (pointer: coarse) { | ||
| .attachment-representation-trigger { | ||
| opacity: 1; | ||
| } | ||
| } | ||
| </style> |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Coarse-pointer override depends on stylesheet ordering.
.attachment-representation-trigger { opacity: 1 } and Tailwind's .opacity-0 (line 19) have equal specificity, so visibility on touch devices is decided by injection order. Consider driving the class binding instead (e.g. VueUse useMediaQuery('(pointer: coarse)')) so the trigger is reliably visible without hover.
As per coding guidelines, src/renderer/** should "prefer existing shadcn-vue primitives and VueUse utilities".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/renderer/src/components/chat/nodes/FileAttachmentView.vue` around lines
231 - 237, Replace the stylesheet-based coarse-pointer override in
FileAttachmentView’s attachment-representation-trigger with a VueUse
media-query-driven class binding for (pointer: coarse), ensuring the trigger
remains visible on touch devices regardless of Tailwind stylesheet ordering;
remove the conflicting scoped CSS rule and preserve the existing hover behavior
for non-coarse pointers.
Source: Coding guidelines
Summary
Move OCR management from the Settings sidebar into the Plugins Hub as a built-in capability alongside CUA.
OCR remains owned by its existing runtime and settings modules. It is not converted into a
.dcplugin.Before / After
Changes
/plugins/builtin/ocrmanagement route.OcrSettingscomponent without duplicating or extracting its UI.settings-ocrfrom the Settings sidebar while retaining the route and component.settings-ocrcompatibility route instead of navigating into the ACP-gated Plugins Hub.pluginCatalogStorewith latest-request-wins protection.0.3.4version from all locale messages.src/types/i18n.d.ts.Compatibility
The legacy
settings-ocrroute remains registered because persisted settings activity records and direct links depend on it.It continues to render the same management component as a compatibility surface, but the Plugins Hub is now the canonical entry.
Both surfaces may coexist in separate windows. Visibility and focus gating prevent inactive instances from continuing background status polling.
No OCR runtime, IPC, cache format, persisted setting, or attachment-routing behavior was changed.
Summary by CodeRabbit