Skip to content

chore: external @opentiny/vue and @opentiny/tiny-robot-svgs#191

Merged
hexqi merged 3 commits intoopentiny:developfrom
gene9831:chore/external-deps
Aug 14, 2025
Merged

chore: external @opentiny/vue and @opentiny/tiny-robot-svgs#191
hexqi merged 3 commits intoopentiny:developfrom
gene9831:chore/external-deps

Conversation

@gene9831
Copy link
Copy Markdown
Collaborator

@gene9831 gene9831 commented Aug 13, 2025

Summary by CodeRabbit

  • Refactor

    • Removed the Suggestion and Question UI features (components, related subcomponents, hooks, typings, and styles).
    • Consolidated many Tiny UI imports into a single central package export.
  • Chores

    • Reduced package dependencies and tightened Vue package version constraints.
    • Marked core UI/icon libs as externals in the build and removed an unused build plugin.

Note: Projects using the removed features will need updates or replacements.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 13, 2025

Walkthrough

Consolidates many @opentiny/vue-* imports into the central @opentiny/vue, removes several subpackage dependencies and one devDependency, adds two externals in Vite Rollup config, and deletes the entire Question and Suggestion feature suites (components, composables, types, styles, and plugin wrappers).

Changes

Cohort / File(s) Summary
Dependency & build config
packages/components/package.json, packages/components/vite.config.ts, docs/package.json
Removed many @opentiny/vue-* deps and @opentiny/vue-vite-import devDep; downgraded @opentiny/vue version in packages/docs; added @opentiny/vue and @opentiny/tiny-robot-svgs to Rollup externals and removed the Vite import plugin usage.
Import consolidation (components)
packages/components/src/action-group/ActionGroup.vue, packages/components/src/attachments/components/FileCard.vue, packages/components/src/feedback/index.vue, packages/components/src/history/index.vue, packages/components/src/mcp-server-picker/components/FormEditor.vue, packages/components/src/mcp-server-picker/components/PluginCard.vue, packages/components/src/mcp-server-picker/components/PluginModal.vue, packages/components/src/mcp-server-picker/index.vue, packages/components/src/sender/components/ActionButtons.vue, packages/components/src/sender/index.vue
Replaced default imports from individual @opentiny/vue-* subpackages with named/grouped imports from @opentiny/vue (e.g., TinyTooltip, TinyButton, TinyInput, TinyRadioGroup, TinySwitch, TinyPopconfirm, TinyTabs, TinyTabItem, TinySelect, TinyOption). No other logic changes.
Question feature removal
packages/components/src/question/index.vue, .../index.ts, .../index.type.ts, .../composables/useQuestions.ts, .../components/CommonQuestions.vue, .../components/HotQuestions.vue, .../index.less, .../vars.less
Entire Question plugin/component suite removed: components, composable, types, styles, and plugin exporter.
Suggestion feature removal
packages/components/src/suggestion/index.vue, .../index.ts, .../index.type.ts, .../index.less, .../vars.less, .../components/CategoryNav.vue, .../components/SuggestionCapsule.vue, .../components/SuggestionPanel.vue, .../composables/useKeyboardNavigation.ts, .../composables/useSuggestionFilter.ts, .../composables/useTriggerDetection.ts, .../utils/dom.ts
Entire Suggestion plugin/component suite removed: components, composables, utils, types, styles, and plugin exporter.

Sequence Diagram(s)

(no sequence diagram provided — changes are import consolidations and deletions without new runtime control-flow)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • Release/v0.2.x #132 — overlapping changes touching packages/components/package.json and packages/components/vite.config.ts.

Suggested reviewers

  • hexqi

Poem

I tidied my warren, swept old deps away,
Folded questions and suggestions for another day.
One cozy import, neat and light—hop!
Externals set free, my burrow's just right.
I twitch my nose and bound into play. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b5456a and 151d294.

📒 Files selected for processing (5)
  • packages/components/src/mcp-server-picker/components/FormEditor.vue (1 hunks)
  • packages/components/src/mcp-server-picker/components/PluginCard.vue (1 hunks)
  • packages/components/src/mcp-server-picker/components/PluginModal.vue (1 hunks)
  • packages/components/src/mcp-server-picker/index.vue (1 hunks)
  • packages/components/src/sender/index.vue (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • packages/components/src/mcp-server-picker/components/FormEditor.vue
  • packages/components/src/sender/index.vue
  • packages/components/src/mcp-server-picker/index.vue
  • packages/components/src/mcp-server-picker/components/PluginModal.vue
  • packages/components/src/mcp-server-picker/components/PluginCard.vue
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@gene9831 gene9831 changed the title chore: externel @opentiny/vue and @opentiny/tiny-robot-svgs chore: external @opentiny/vue and @opentiny/tiny-robot-svgs Aug 13, 2025
@gene9831 gene9831 marked this pull request as ready for review August 14, 2025 01:38
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
packages/components/src/mcp-server-picker/components/PluginCard.vue (1)

49-61: Avoid mutating props’ nested state inside the child component

Directly setting tool.enabled = enabled mutates data owned by the parent and risks state inconsistencies. Emitting events is sufficient—let the parent update the source of truth. This keeps a clean one-way data flow without breaking current behavior since you already emit per-tool updates.

Apply this diff:

   if (expandable.value) {
     props.plugin.tools.forEach((tool) => {
       if (tool.enabled !== enabled) {
-        tool.enabled = enabled
         // 通知父组件工具状态已改变
         emit('toggle-tool', tool.id, enabled)
       }
     })
   }

If you want to keep instant visual feedback, consider managing a local, non-prop, reactive mirror for tools’ enabled states and syncing via emits—happy to sketch that if useful.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee3f007 and b4c6df1.

📒 Files selected for processing (32)
  • packages/components/package.json (0 hunks)
  • packages/components/src/action-group/ActionGroup.vue (1 hunks)
  • packages/components/src/attachments/components/FileCard.vue (1 hunks)
  • packages/components/src/feedback/index.vue (1 hunks)
  • packages/components/src/history/index.vue (1 hunks)
  • packages/components/src/mcp-server-picker/components/FormEditor.vue (1 hunks)
  • packages/components/src/mcp-server-picker/components/PluginCard.vue (1 hunks)
  • packages/components/src/mcp-server-picker/components/PluginModal.vue (1 hunks)
  • packages/components/src/mcp-server-picker/index.vue (1 hunks)
  • packages/components/src/question/components/CommonQuestions.vue (0 hunks)
  • packages/components/src/question/components/HotQuestions.vue (0 hunks)
  • packages/components/src/question/composables/useQuestions.ts (0 hunks)
  • packages/components/src/question/index.less (0 hunks)
  • packages/components/src/question/index.ts (0 hunks)
  • packages/components/src/question/index.type.ts (0 hunks)
  • packages/components/src/question/index.vue (0 hunks)
  • packages/components/src/question/vars.less (0 hunks)
  • packages/components/src/sender/components/ActionButtons.vue (1 hunks)
  • packages/components/src/sender/index.vue (1 hunks)
  • packages/components/src/suggestion/components/CategoryNav.vue (0 hunks)
  • packages/components/src/suggestion/components/SuggestionCapsule.vue (0 hunks)
  • packages/components/src/suggestion/components/SuggestionPanel.vue (0 hunks)
  • packages/components/src/suggestion/composables/useKeyboardNavigation.ts (0 hunks)
  • packages/components/src/suggestion/composables/useSuggestionFilter.ts (0 hunks)
  • packages/components/src/suggestion/composables/useTriggerDetection.ts (0 hunks)
  • packages/components/src/suggestion/index.less (0 hunks)
  • packages/components/src/suggestion/index.ts (0 hunks)
  • packages/components/src/suggestion/index.type.ts (0 hunks)
  • packages/components/src/suggestion/index.vue (0 hunks)
  • packages/components/src/suggestion/utils/dom.ts (0 hunks)
  • packages/components/src/suggestion/vars.less (0 hunks)
  • packages/components/vite.config.ts (1 hunks)
💤 Files with no reviewable changes (21)
  • packages/components/src/suggestion/vars.less
  • packages/components/src/suggestion/components/SuggestionPanel.vue
  • packages/components/src/question/composables/useQuestions.ts
  • packages/components/src/suggestion/components/SuggestionCapsule.vue
  • packages/components/src/suggestion/components/CategoryNav.vue
  • packages/components/src/suggestion/composables/useKeyboardNavigation.ts
  • packages/components/src/question/index.type.ts
  • packages/components/src/suggestion/index.type.ts
  • packages/components/src/question/index.ts
  • packages/components/src/suggestion/composables/useSuggestionFilter.ts
  • packages/components/src/question/components/HotQuestions.vue
  • packages/components/src/question/components/CommonQuestions.vue
  • packages/components/package.json
  • packages/components/src/suggestion/utils/dom.ts
  • packages/components/src/suggestion/index.vue
  • packages/components/src/suggestion/index.less
  • packages/components/src/suggestion/index.ts
  • packages/components/src/question/index.less
  • packages/components/src/suggestion/composables/useTriggerDetection.ts
  • packages/components/src/question/index.vue
  • packages/components/src/question/vars.less
🔇 Additional comments (11)
packages/components/src/sender/components/ActionButtons.vue (1)

3-3: Barrel import for TinyTooltip looks good

Using a named import from @opentiny/vue aligns with the consolidation effort and will continue to work with the tag via <script setup> auto-registration.

packages/components/src/mcp-server-picker/components/PluginModal.vue (1)

3-3: Radio group migration is correct

Switching to a named import from @opentiny/vue for TinyRadioGroup matches the new externalization strategy. Template usage with remains compatible.

packages/components/src/attachments/components/FileCard.vue (1)

3-3: Tooltip import consolidation LGTM

Importing TinyTooltip from the @opentiny/vue barrel is consistent with the PR’s goal. Template usage with remains compatible with <script setup>.

packages/components/src/action-group/ActionGroup.vue (1)

3-3: TinyTooltip import migrated to @opentiny/vue — good change.

Template usage stays the same (). This keeps imports consistent with the new externalization strategy.

packages/components/src/mcp-server-picker/index.vue (1)

2-2: Grouped imports from @opentiny/vue are consistent and correct.

Consolidation of TinyTabs, TinyTabItem, TinyInput, TinySelect, TinyOption matches the repo-wide pattern; template bindings remain unchanged.

packages/components/src/mcp-server-picker/components/FormEditor.vue (1)

2-2: TinyRadioGroup import migration looks correct.

Template continues to use , which is compatible with the named export in script setup.

packages/components/src/history/index.vue (1)

3-3: TinyInput and TinyTooltip migrated to @opentiny/vue — LGTM.

No behavioral changes; template tags map correctly under script-setup.

packages/components/src/mcp-server-picker/components/PluginCard.vue (4)

2-2: Consolidated imports from @opentiny/vue look good

Switching TinySwitch and TinyPopconfirm to named exports from the aggregator is aligned with the PR objective and keeps usage unchanged in the template.


156-159: Remove TypeScript type annotation in template event handler

Type annotations inside template expressions are not supported by Vue’s template compiler and can break builds. Use a plain parameter or move typing to script logic.

Apply this diff:

-                @update:model-value="(enabled: boolean) => handleToolToggle(tool.id, enabled)"
+                @update:model-value="enabled => handleToolToggle(tool.id, enabled)"

2-2: Verify @opentiny/vue exports and purge subpackage imports

Quick summary: the sandbox search returned no matches — please confirm locally that @opentiny/vue actually exports TinySwitch/TinyPopconfirm and remove any @opentiny/vue-switch / @opentiny/vue-popconfirm imports.

Files to check:

  • packages/components/src/mcp-server-picker/components/PluginCard.vue — currently:
import { TinySwitch, TinyPopconfirm } from '@opentiny/vue'

If the aggregator exports Switch/Popconfirm instead, change to:

import { Switch as TinySwitch, Popconfirm as TinyPopconfirm } from '@opentiny/vue'

Run these checks locally:

  • Search for deprecated subpackage imports:
    rg -n --hidden --glob '!.git' "@opentiny/vue-(switch|popconfirm)" || true
  • Find aggregator imports referencing TinySwitch/TinyPopconfirm:
    rg -n --hidden --glob '!.git' "from ['"]@opentiny/vue['"][^\\n]*\{[^}]Tiny(Switch|Popconfirm)[^}]\}" || true
  • List all imports from the aggregator to spot uses that may need aliasing:
    rg -n --hidden --glob '!.git' "from ['"]@opentiny/vue['"]" -S || true
  • Inspect the installed package's exports/types (if node_modules present):
    jq .exports node_modules/@opentiny/vue/package.json || cat node_modules/@opentiny/vue/package.json

Please run the above and confirm whether to keep the current import, switch to aliased names, and/or remove subpackage imports.


103-121: Verify TinySwitch/TinyPopconfirm APIs in the aggregated UI package

Couldn't find TinySwitch or TinyPopconfirm component source files in this repo, so I couldn't confirm their props/events. Observed usages you should verify against the aggregator/component library:

  • packages/components/src/mcp-server-picker/components/PluginCard.vue
    • TinyPopconfirm — lines ~103–111: title="确定删除该插件吗?", type="info", trigger="click", @confirm="handleDelete"
    • TinySwitch — lines ~116–121: :model-value="pluginState.checked", :indeterminate="pluginState.indeterminate", @update:model-value="handlePluginToggle"
    • TinySwitch — lines ~156–159: :model-value="tool.enabled", @update:model-value="(enabled: boolean) => handleToolToggle(tool.id, enabled)"
  • docs/demos/drag-overlay/basic.vue — TinySwitch v-model usage (~line 73)
  • docs/demos/suggestion/pills-popper.vue — ref typed as InstanceType (~line 74)

Please confirm in the aggregator (or the upstream component package / node_modules) that:

  • TinySwitch still emits update:modelValue (template listener @update:model-value is acceptable) and supports the indeterminate prop.
  • TinyPopconfirm still accepts title, type="info", trigger="click" and emits the confirm event.

Comment thread packages/components/src/feedback/index.vue
Comment thread packages/components/src/sender/index.vue
Comment thread packages/components/vite.config.ts
Comment thread packages/components/package.json Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/components/package.json (1)

23-25: If @opentiny/vue is rollup-externalized, consider making it a peerDependency

Externalizing a package typically pairs better with declaring it as a peerDependency to avoid duplicate installs/mismatched versions in consuming apps. If that’s the intent, move it from dependencies to peerDependencies; otherwise keeping it in dependencies is acceptable if you want it installed transitively.

Proposed change (within this hunk):

-    "@opentiny/vue": "^3.20.0",
+    // "@opentiny/vue" moved to peerDependencies

And add it to peerDependencies (outside this hunk, illustrative):

{
  "peerDependencies": {
    "vue": "^3.3.11",
    "@opentiny/vue": "^3.20.0"
  }
}

Please confirm whether the Vite/Rollup config intentionally externals @opentiny/vue for consumers, in which case the peer dependency route is preferable.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b4c6df1 and 0b5456a.

📒 Files selected for processing (2)
  • docs/package.json (1 hunks)
  • packages/components/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/package.json
🔇 Additional comments (1)
packages/components/package.json (1)

24-24: Downgrade to @opentiny/vue ^3.20.0 — LGTM

This aligns with the prior review feedback and the repo-wide consolidation to the barrel. No further concerns here.

@hexqi hexqi merged commit 39bdc3a into opentiny:develop Aug 14, 2025
@gene9831 gene9831 deleted the chore/external-deps branch August 14, 2025 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants