Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

Moved chatbot and timeline from packages/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 calculations

Both follow existing plugin architecture (plugin-kanban pattern):

  • UI components in src/index.tsx
  • Schema renderer in src/renderer.tsx with ComponentRegistry auto-registration
  • Package imports (@object-ui/components) instead of relative paths

Components Package Cleanup

  • Removed src/ui/chatbot.tsx, src/ui/timeline.tsx
  • Removed renderers from src/renderers/complex/
  • Updated exports in src/ui/index.ts

Fixes

  • React types: ^18.3.12^19.0.6 (consistency with monorepo)
  • Added crypto?.randomUUID?.() fallback for older browsers

Usage

Standalone React:

import { Chatbot } from '@object-ui/plugin-chatbot';
import { Timeline } from '@object-ui/plugin-timeline';

Schema-driven (auto-registered):

import '@object-ui/plugin-chatbot';

const schema = {
  component: 'chatbot',
  messages: [{ id: '1', role: 'assistant', content: 'Hello!' }]
};

Impact

  • packages/components now contains 60 components (48 Shadcn + 12 custom wrappers/helpers)
  • Users opt-in to chatbot/timeline via plugin installation
  • Bundle size reduction for apps not using these components

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
    • Triggering command: /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

Role

Expert Frontend Architect & Refactoring Agent

Context

We are cleaning up the packages/components library in the objectstack-ai/objectui repository.
Our goal is to ensure packages/components/src/ui contains ONLY standard Shadcn UI primitives (as defined in packages/components/shadcn-components.json).
Any "Business Component" or "Complex UI" currently mixed in that folder needs to be extracted into its own plugin package.

Task 1: Audit & Discovery

  1. Read packages/components/shadcn-components.json to get the list of "Standard Components".
  2. List all .tsx files in packages/components/src/ui/.
  3. Compare the two lists. Identify all files that exist in the folder but are NOT in the JSON.
  4. Output this list of "Non-Standard Components".

Task 2: Strategy & Execution Plan

For each "Non-Standard Component" identified, categorize them:

  • Category A (Complex Business UI): e.g., chatbot.tsx, timeline.tsx, calendar-view.tsx. -> Action: Move to new package packages/plugin-[name].
  • Category B (Custom Wrappers): e.g., field.tsx, input-group.tsx. -> Action: Mark for deprecation or keep for now (do not move yet).
  • Category C (Helpers): e.g., empty.tsx, spinner.tsx. -> Action: Keep in core.

Task 3: Refactoring (The Modification)

Please perform the actual refactoring for Category A (Complex Business UI) components found (specifically chatbot and timeline to start with):

  1. Create New Packages:

    • Create folders: packages/plugin-chatbot and packages/plugin-timeline.
    • Initialize package.json for them (copy structure from packages/plugin-kanban, ensuring correct name and dependencies).
    • Ensure they depend on @object-ui/components.
  2. Move Files:

    • Move packages/components/src/ui/chatbot.tsx -> packages/plugin-chatbot/src/index.tsx.
    • Move packages/components/src/ui/timeline.tsx -> packages/plugin-timeline/src/index.tsx.
  3. Fix Imports:

    • In the moved files, update imports from relative path (e.g. ../ui/button) to package import (e.g. @object-ui/components).
  4. Clean Up:

    • Delete the original files from packages/components/src/ui/.
    • Remove their exports from packages/components/src/ui/index.ts.

Output

Please provide the shell commands to create the directories and move files, and the code content for the new package.json files and updated source files.


💡 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.

@vercel
Copy link

vercel bot commented Jan 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
objectui-site Ready Ready Preview, Comment Jan 26, 2026 6:21am

Request Review

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>
Copilot AI changed the title [WIP] Audit non-standard components in packages/components Extract chatbot and timeline to plugin packages Jan 26, 2026
Copilot AI requested a review from hotlong January 26, 2026 04:53
@github-actions
Copy link

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1564.28KB 368.12KB
core (index.js) 0.53KB 0.28KB
plugin-aggrid (AgGridImpl-DKkq6v1B.js) 5.09KB 1.84KB
plugin-aggrid (index-B6NPAFZx.js) 15.66KB 4.51KB
plugin-aggrid (index.js) 0.18KB 0.15KB
plugin-charts (AdvancedChartImpl-DazADGz5.js) 74.89KB 15.82KB
plugin-charts (BarChart-CRc8MAtI.js) 551.60KB 127.51KB
plugin-charts (ChartImpl-DVw_7KEd.js) 3.17KB 1.10KB
plugin-charts (index-CdgY2AuM.js) 12.39KB 3.83KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-chatbot (index.js) 18.36KB 5.21KB
plugin-editor (MonacoImpl-B7ZgZJJG.js) 18.15KB 5.59KB
plugin-editor (index-Dl3HAAqu.js) 10.07KB 3.31KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-kanban (KanbanImpl-CUWM-JC-.js) 76.50KB 20.46KB
plugin-kanban (index-BV3FWhCb.js) 11.86KB 3.67KB
plugin-kanban (index.js) 0.18KB 0.15KB
plugin-markdown (MarkdownImpl-BRkYjVWf.js) 256.79KB 64.50KB
plugin-markdown (index-D_CdfEXQ.js) 9.59KB 3.16KB
plugin-markdown (index.js) 0.19KB 0.15KB
plugin-timeline (index.js) 23.90KB 5.95KB
react (SchemaRenderer.js) 1.44KB 0.73KB
react (index.js) 0.36KB 0.23KB
react (index.test.js) 0.34KB 0.26KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 0.20KB 0.18KB
types (base.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data.js) 0.20KB 0.18KB
types (disclosure.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (index.js) 0.34KB 0.25KB
types (layout.js) 0.20KB 0.18KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (registry.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Copilot AI and others added 3 commits January 26, 2026 05:39
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>
@github-actions
Copy link

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1564.28KB 368.12KB
core (index.js) 0.53KB 0.28KB
plugin-aggrid (AgGridImpl-DKkq6v1B.js) 5.09KB 1.84KB
plugin-aggrid (index-B6NPAFZx.js) 15.66KB 4.51KB
plugin-aggrid (index.js) 0.18KB 0.15KB
plugin-charts (AdvancedChartImpl-DazADGz5.js) 74.89KB 15.82KB
plugin-charts (BarChart-CRc8MAtI.js) 551.60KB 127.51KB
plugin-charts (ChartImpl-DVw_7KEd.js) 3.17KB 1.10KB
plugin-charts (index-CdgY2AuM.js) 12.39KB 3.83KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-chatbot (index.js) 18.36KB 5.21KB
plugin-editor (MonacoImpl-B7ZgZJJG.js) 18.15KB 5.59KB
plugin-editor (index-Dl3HAAqu.js) 10.07KB 3.31KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-kanban (KanbanImpl-CUWM-JC-.js) 76.50KB 20.46KB
plugin-kanban (index-BV3FWhCb.js) 11.86KB 3.67KB
plugin-kanban (index.js) 0.18KB 0.15KB
plugin-markdown (MarkdownImpl-BRkYjVWf.js) 256.79KB 64.50KB
plugin-markdown (index-D_CdfEXQ.js) 9.59KB 3.16KB
plugin-markdown (index.js) 0.19KB 0.15KB
plugin-timeline (index.js) 23.90KB 5.95KB
react (SchemaRenderer.js) 1.44KB 0.73KB
react (index.js) 0.36KB 0.23KB
react (index.test.js) 0.34KB 0.26KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 0.20KB 0.18KB
types (base.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data.js) 0.20KB 0.18KB
types (disclosure.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (index.js) 0.34KB 0.25KB
types (layout.js) 0.20KB 0.18KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (registry.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@github-actions
Copy link

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@hotlong hotlong marked this pull request as ready for review January 26, 2026 06:28
Copilot AI review requested due to automatic review settings January 26, 2026 06:28
@hotlong hotlong merged commit 9db4425 into main Jan 26, 2026
16 checks passed
Copy link
Contributor

Copilot AI left a 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-chatbot and @object-ui/plugin-timeline, each with its own build config, TypeScript config, React components, and schema-driven renderer wired into ComponentRegistry.
  • Cleaned up @object-ui/components by removing the Chatbot and Timeline UI exports and their complex renderers/tests so src/ui now 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 ./index introduces a circular dependency because index.tsx also re-exports from ./renderer. This can result in partially initialized exports and undefined components at the time ComponentRegistry.register('timeline', ...) is executed. A safer pattern is to put the Timeline UI primitives in a separate module (e.g. ./TimelineUI) that both index.tsx and this renderer import from, with index.tsx only 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, and showTimestamp, but the exported ChatbotSchema in @object-ui/types only defines fields such as onSendMessage, loading, showAvatars, userAvatar, assistantAvatar, markdown, and height. That means a schema using the typed onSendMessage callback 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 updating ChatbotSchema/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 Chatbot from ./index creates a circular dependency because index.tsx also re-exports everything from ./renderer. Depending on bundler/module resolution order this can leave Chatbot undefined when ComponentRegistry.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 having index.tsx export 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 ./index introduces a circular dependency because index.tsx also re-exports from ./renderer. This can result in partially initialized exports and undefined components at the time ComponentRegistry.register('timeline', ...) is executed. A safer pattern is to put the Timeline UI primitives in a separate module (e.g. ./TimelineUI) that both index.tsx and this renderer import from, with index.tsx only 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.ts were removed. To maintain the existing level of coverage, consider adding Vitest tests under this package (e.g. src/index.test.ts) similar to packages/plugin-kanban/src/index.test.ts to verify ComponentRegistry registration, config metadata, and default props for the chatbot type.
    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/components were removed. To keep parity with other plugins like plugin-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 the timeline type.

import '@object-ui/plugin-chatbot';

const schema = {
component: 'chatbot',
Copy link

Copilot AI Jan 26, 2026

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.

Suggested change
component: 'chatbot',
type: 'chatbot',

Copilot uses AI. Check for mistakes.
import '@object-ui/plugin-timeline';

const schema = {
component: 'timeline',
Copy link

Copilot AI Jan 26, 2026

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.

Suggested change
component: 'timeline',
type: 'timeline',

Copilot uses AI. Check for mistakes.
"@object-ui/core": "workspace:*",
"@object-ui/react": "workspace:*",
"@object-ui/types": "workspace:*",
"lucide-react": "^0.468.0"
Copy link

Copilot AI Jan 26, 2026

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.

Suggested change
"lucide-react": "^0.468.0"
"lucide-react": "^0.562.0"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants