-
Notifications
You must be signed in to change notification settings - Fork 0
Extract chatbot and timeline to plugin packages #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
📦 Bundle Size Report
Size Limits
|
These components have been moved to separate plugin packages (plugin-chatbot and plugin-timeline), so the tests should not expect them to be registered in the core components package. Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
📦 Bundle Size Report
Size Limits
|
|
✅ All checks passed!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request extracts the Chatbot and Timeline complex UI components out of the core @object-ui/components library into separate opt‑in plugin packages, so the core stays focused on Shadcn-style primitives and consumers only pay for business components they actually use.
Changes:
- Added two new plugin packages,
@object-ui/plugin-chatbotand@object-ui/plugin-timeline, each with its own build config, TypeScript config, React components, and schema-driven renderer wired intoComponentRegistry. - Cleaned up
@object-ui/componentsby removing the Chatbot and Timeline UI exports and their complex renderers/tests sosrc/uinow contains only standard components plus documented helpers/wrappers. - Updated dependency metadata (pnpm lockfile entries, React type versions, Lucide dependency for the chatbot plugin) and added README usage docs for both plugins, including schema-driven examples.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
pnpm-lock.yaml |
Adds importers and resolution entries for packages/plugin-chatbot and packages/plugin-timeline, including their React, React DOM, and Lucide (for chatbot) dependencies. |
packages/plugin-chatbot/package.json |
Defines the new @object-ui/plugin-chatbot package, including workspace deps on core/components/react/types, React peer dependencies, dev tooling, and a dedicated lucide-react dependency. |
packages/plugin-chatbot/vite.config.ts |
Sets up the Vite library build (ESM + UMD) for the chatbot plugin with React and vite-plugin-dts, and marks React/core/component packages and Lucide as externals. |
packages/plugin-chatbot/tsconfig.json |
Configures TS compilation for the chatbot plugin (outDir, JSX, baseUrl/paths, declarations, composite) extending the root config. |
packages/plugin-chatbot/src/index.tsx |
Hosts the Chatbot UI component, message/typing indicator primitives, and exports them along with a re-export of the renderer for consumers of the plugin entrypoint. |
packages/plugin-chatbot/src/renderer.tsx |
Registers the chatbot schema renderer with ComponentRegistry, wires stateful behavior on top of the stateless Chatbot UI, and switches ID generation to a crypto?.randomUUID?.()-based implementation with a safe fallback. |
packages/plugin-chatbot/README.md |
Documents installation, direct React usage, and schema-driven usage for the chatbot plugin, showing how to import the package and define a chatbot component in schemas. |
packages/plugin-timeline/package.json |
Defines the new @object-ui/plugin-timeline package with workspace deps and React peer dependencies, mirroring the plugin packaging pattern used by plugin-kanban and plugin-charts (minus additional external libs). |
packages/plugin-timeline/vite.config.ts |
Configures the Vite library build for the timeline plugin, treating React and @object-ui/* packages as externals and generating type declarations. |
packages/plugin-timeline/tsconfig.json |
Sets TS compiler options for the timeline plugin (output dir, JSX, path alias, declaration emit) extending the workspace baseline. |
packages/plugin-timeline/src/index.tsx |
Contains the Timeline UI primitives (vertical, horizontal, and Gantt-style parts) and re-exports the renderer so importing the plugin entrypoint both gives components and triggers registry registration. |
packages/plugin-timeline/src/renderer.tsx |
Implements and registers a timeline schema renderer that supports vertical, horizontal, and Gantt variants, including date range calculations and positioning logic, now consuming renderChildren from @object-ui/components. |
packages/plugin-timeline/README.md |
Provides installation instructions, basic vertical and Gantt usage examples, and a schema-driven usage snippet for the timeline plugin. |
packages/components/src/ui/index.ts |
Removes chatbot and timeline from the UI export barrel so @object-ui/components no longer exposes these complex business components directly. |
packages/components/src/renderers/complex/index.ts |
Stops importing the chatbot and timeline complex renderers from the core components package, delegating those schema types to the new plugins instead. |
packages/components/src/renderers/complex/chatbot.test.ts |
Deletes the chatbot renderer tests from the core components package now that the renderer lives in the plugin, preventing stale tests against removed code. |
packages/components/src/new-components.test.ts |
Drops the timeline registration test from the core components “new components” test suite to match the removal of the timeline renderer from @object-ui/components. |
packages/components/src/__tests__/complex-disclosure-renderers.test.tsx |
Removes chatbot and timeline display/registration tests from the complex renderers suite, aligning test expectations with the plugin-based ownership of those components. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (6)
packages/plugin-timeline/src/renderer.tsx:33
- Importing all Timeline components from
./indexintroduces a circular dependency becauseindex.tsxalso re-exports from./renderer. This can result in partially initialized exports and undefined components at the timeComponentRegistry.register('timeline', ...)is executed. A safer pattern is to put the Timeline UI primitives in a separate module (e.g../TimelineUI) that bothindex.tsxand this renderer import from, withindex.tsxonly importing the renderer for side effects rather than re-exporting it.
packages/plugin-chatbot/src/renderer.tsx:65 - This renderer relies on schema properties like
onSend,autoResponse,autoResponseText,autoResponseDelay, andshowTimestamp, but the exportedChatbotSchemain@object-ui/typesonly defines fields such asonSendMessage,loading,showAvatars,userAvatar,assistantAvatar,markdown, andheight. That means a schema using the typedonSendMessagecallback will be ignored here, while the features actually used by this implementation are not represented in the public schema types or Zod validators, breaking the type-safety guarantees of the component API. Consider reconciling the implementation and types by updatingChatbotSchema/its Zod schema to include the fields this renderer consumes (and deprecating unused ones), or adjusting the renderer and its metadata to match the existing schema contract.
packages/plugin-chatbot/src/renderer.tsx:11 - Importing
Chatbotfrom./indexcreates a circular dependency becauseindex.tsxalso re-exports everything from./renderer. Depending on bundler/module resolution order this can leaveChatbotundefined whenComponentRegistry.register('chatbot', ...)runs, breaking schema-driven usage. To avoid this, move the Chatbot UI into its own module (e.g../Chatbot) and import that here, while havingindex.tsxexport the UI and import the renderer only for side effects instead of re-exporting it.
packages/plugin-timeline/src/renderer.tsx:29 - Importing all Timeline components from
./indexintroduces a circular dependency becauseindex.tsxalso re-exports from./renderer. This can result in partially initialized exports and undefined components at the timeComponentRegistry.register('timeline', ...)is executed. A safer pattern is to put the Timeline UI primitives in a separate module (e.g../TimelineUI) that bothindex.tsxand this renderer import from, withindex.tsxonly importing the renderer for side effects rather than re-exporting it.
packages/plugin-chatbot/src/renderer.tsx:14 - The new Chatbot plugin currently has no tests even though it registers a complex schema-driven component here, and the previous chatbot renderer tests in
packages/components/src/renderers/complex/chatbot.test.tswere removed. To maintain the existing level of coverage, consider adding Vitest tests under this package (e.g.src/index.test.ts) similar topackages/plugin-kanban/src/index.test.tsto verify ComponentRegistry registration, config metadata, and default props for thechatbottype.
packages/plugin-timeline/src/renderer.tsx:33 - The Timeline plugin registers a fairly involved schema renderer (multiple variants including Gantt) but there are no plugin-level tests, and the earlier timeline tests under
packages/componentswere removed. To keep parity with other plugins likeplugin-kanban, it would be good to add Vitest tests (e.g.src/index.test.ts) that at least assert ComponentRegistry registration, basic rendering of items for each variant, and key configuration metadata for thetimelinetype.
| import '@object-ui/plugin-chatbot'; | ||
|
|
||
| const schema = { | ||
| component: 'chatbot', |
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the schema-driven usage example, the key is component: 'chatbot' but the rest of the ObjectUI schema types (e.g. ChatbotSchema in packages/types/src/complex.ts) and other docs use type: 'chatbot'. To avoid confusing users and to provide a working example, this snippet should use type: 'chatbot' instead of component.
| component: 'chatbot', | |
| type: 'chatbot', |
| import '@object-ui/plugin-timeline'; | ||
|
|
||
| const schema = { | ||
| component: 'timeline', |
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The schema example here uses component: 'timeline', but the schema protocol across the repo (e.g. TimelineSchema in packages/types/src/data-display.ts and other plugin docs) uses type: 'timeline'. Updating this to type: 'timeline' will align with the actual schema shape and ensure the example works as-is.
| component: 'timeline', | |
| type: 'timeline', |
| "@object-ui/core": "workspace:*", | ||
| "@object-ui/react": "workspace:*", | ||
| "@object-ui/types": "workspace:*", | ||
| "lucide-react": "^0.468.0" |
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This package pins lucide-react to ^0.468.0 while other packages in the monorepo (e.g. @object-ui/components, @object-ui/runner, @object-ui/views) use ^0.562.0, which will cause pnpm to install multiple lucide-react versions. For consistency and to avoid duplicate copies of the icon library in consumer bundles, consider aligning this dependency version with the one used elsewhere in the workspace unless there is a specific need for the older release.
| "lucide-react": "^0.468.0" | |
| "lucide-react": "^0.562.0" |
Moved
chatbotandtimelinefrompackages/components/src/ui/to dedicated plugin packages. These are complex business components, not Shadcn UI primitives.Changes
New Packages
@object-ui/plugin-chatbot- Chat interface with message roles, auto-scroll, typing indicator@object-ui/plugin-timeline- Timeline variants (vertical, horizontal, Gantt) with date calculationsBoth follow existing plugin architecture (
plugin-kanbanpattern):src/index.tsxsrc/renderer.tsxwith ComponentRegistry auto-registration@object-ui/components) instead of relative pathsComponents Package Cleanup
src/ui/chatbot.tsx,src/ui/timeline.tsxsrc/renderers/complex/src/ui/index.tsFixes
^18.3.12→^19.0.6(consistency with monorepo)crypto?.randomUUID?.()fallback for older browsersUsage
Standalone React:
Schema-driven (auto-registered):
Impact
packages/componentsnow contains 60 components (48 Shadcn + 12 custom wrappers/helpers)Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
fonts.googleapis.com/usr/local/bin/node node /home/REDACTED/work/objectui/objectui/apps/site/node_modules/.bin/../next/dist/bin/next build git ules�� unset --global ry user.email(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.