Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'@object-ui/plugin-designer': patch
---

refactor(plugin-designer)!: retire `useConfirmDialog` and `VersionHistory` from the entry, and delete the designers' dead collaboration code

Clause-②: no (narrowing)
Metadata-protocol: none

<!-- adr-0087: not-required (runtime-export-retired @object-ui/plugin-designer#useConfirmDialog, @object-ui/plugin-designer#VersionHistory) the retired operands are a React hook and a React component in a published ui package's entry that nothing in the workspace or in hotcrm imported; no packages/spec schema, registered node type, ADR-0087 conversion surface or stored shape names them, so there is nothing for `objectstack migrate meta` to rewrite -->

**BREAKING** for a host that imports `useConfirmDialog` or `VersionHistory` from `@object-ui/plugin-designer`. Neither had an importer anywhere in the workspace or in hotcrm, so the Console and every `@object-ui/*` package are unaffected.

- The `VersionHistory` timeline module is deleted: nothing in the package rendered it. The `designer.versionHistory` translation key stays in the locale packs for now, with no reader.
- `useConfirmDialog` stays inside the package, because the designers use it for their delete prompts. Only the entry stops publishing it.
- The collaboration code that became unreachable once the previous release stopped exporting `CollaborationProvider` is deleted. That covers the provider module, the always-null `useCollaboration()` branches in the page, data model, process and report designers, and their "N users" / "Connected" toolbar chips. Nothing outside the package could mount the provider, so no designer behaves differently.

What leaves, and what to write instead (neither has a replacement export):

- FROM `useConfirmDialog` TO no replacement: render your own confirm prompt with `ConfirmDialog` (still exported) and local `useState`.
- FROM `VersionHistory` TO no replacement: render the version list in your own component. The designers never showed one.
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ const BACKLOG: Declared[] = (
'packages/plugin-designer/src/DataModelDesigner.tsx',
[
'Designer toolbar', 'Undo', 'Redo', 'Zoom Out', 'Zoom In', 'Reset Zoom', 'Copy', 'Paste', 'Auto Layout',
'Collaboration active', 'Add Entity', 'Add Relationship', 'Canvas',
'Add Entity', 'Add Relationship', 'Canvas',
],
],
['packages/plugin-designer/src/EditorModeToggle.tsx', ['Editor mode']],
Expand All @@ -267,7 +267,7 @@ const BACKLOG: Declared[] = (
[
'packages/plugin-designer/src/ProcessDesigner.tsx',
[
'Process toolbar', 'Process name', 'Process version', 'Collaboration active', 'Undo', 'Redo', 'Copy',
'Process toolbar', 'Process name', 'Process version', 'Undo', 'Redo', 'Copy',
'Paste', 'Connect nodes', 'Auto layout', 'Zoom in', 'Zoom level', 'Zoom out', 'Reset zoom',
'Add Start Event', 'Add User Task', 'Add Gateway', 'Add End Event', 'Process canvas', 'Delete node',
'Property panel',
Expand Down
5 changes: 2 additions & 3 deletions ui/packages/plugin-designer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,17 @@ declare const sections: ReportDesignerSection[];
### Shared Hooks

```tsx
import { useUndoRedo, useConfirmDialog } from '@object-ui/plugin-designer';
import { useUndoRedo } from '@object-ui/plugin-designer';

import type { DesignerComponent } from '@object-ui/types';

const { undo, redo, canUndo, canRedo } = useUndoRedo<DesignerComponent[]>([]);
const { confirm, isOpen } = useConfirmDialog();
```

### Shared Components

```tsx
import { ConfirmDialog, Minimap, VersionHistory } from '@object-ui/plugin-designer';
import { ConfirmDialog, Minimap } from '@object-ui/plugin-designer';
```

## Links
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/plugin-designer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "18.2.0",
"type": "module",
"license": "MIT",
"description": "Visual designer plugin for ObjectUI with page, data model, process, and report designers plus collaborative editing.",
"description": "Visual designer plugin for ObjectUI with page, data model, process, and report designers.",
"main": "dist/index.umd.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
252 changes: 0 additions & 252 deletions ui/packages/plugin-designer/src/CollaborationProvider.tsx

This file was deleted.

22 changes: 4 additions & 18 deletions ui/packages/plugin-designer/src/DataModelDesigner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import React, { useState, useCallback, useEffect, useRef } from 'react';
import type { DataModelEntity, DataModelField, DataModelRelationship, DesignerCanvasConfig } from '@object-ui/types';
import { Database, Plus, Trash2, Link2, Undo2, Redo2, Grid3X3, ZoomIn, ZoomOut, RotateCcw, ChevronDown, ChevronRight, Copy, Clipboard, Users } from 'lucide-react';
import { Database, Plus, Trash2, Link2, Undo2, Redo2, Grid3X3, ZoomIn, ZoomOut, RotateCcw, ChevronDown, ChevronRight, Copy, Clipboard } from 'lucide-react';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@object-ui/components';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
Expand All @@ -20,7 +20,6 @@ import { useCanvasPanZoom } from './hooks/useCanvasPanZoom';
import { ConfirmDialog } from './components/ConfirmDialog';
import { PropertyEditor, type PropertyField } from './components/PropertyEditor';
import { Minimap } from './components/Minimap';
import { useCollaboration } from './CollaborationProvider';
import { CANVAS_BACKGROUND_CLASS, canvasBackgroundStyle } from './canvasBackground';

function cn(...inputs: (string | undefined | false)[]) {
Expand Down Expand Up @@ -253,7 +252,7 @@ export interface DataModelDesignerProps {
* rows of its `sourceField` and `targetField`, with its `deleteBehavior` beside
* the label (objectui#11434).
* Supports undo/redo, multi-select, copy/paste, pan/zoom, drag-to-reposition,
* inline field editing, property editor, minimap, auto-layout, and collaboration.
* inline field editing, property editor, minimap and auto-layout.
*/
export function DataModelDesigner({
entities: initialEntities = [],
Expand Down Expand Up @@ -300,9 +299,6 @@ export function DataModelDesigner({
// --- Pan/Zoom ---
const panZoom = useCanvasPanZoom({ minZoom: 0.25, maxZoom: 3, zoomStep: 0.1 });

// --- Collaboration ---
const collaboration = useCollaboration();

// --- Collapsible panels ---
const [showProperties, setShowProperties] = useState(true);
const [showMinimap, setShowMinimap] = useState(true);
Expand Down Expand Up @@ -343,8 +339,7 @@ export function DataModelDesigner({
};
pushState(next);
multiSelect.selectOne(newEntity.id);
collaboration?.sendOperation({ type: 'insert', userId: collaboration?.currentUserId ?? '', elementId: newEntity.id, data: { name: newEntity.name, label: newEntity.label } });
}, [readOnly, undoRedo, pushState, multiSelect, collaboration]);
}, [readOnly, undoRedo, pushState, multiSelect]);

const handleDeleteEntity = useCallback(
async (id: string) => {
Expand All @@ -367,9 +362,8 @@ export function DataModelDesigner({
if (multiSelect.isSelected(id)) {
multiSelect.clearSelection();
}
collaboration?.sendOperation({ type: 'delete', userId: collaboration?.currentUserId ?? '', elementId: id, data: {} });
},
[readOnly, entities, confirmDialog, undoRedo, pushState, multiSelect, collaboration],
[readOnly, entities, confirmDialog, undoRedo, pushState, multiSelect],
);

const handleDeleteSelected = useCallback(async () => {
Expand Down Expand Up @@ -788,14 +782,6 @@ export function DataModelDesigner({

<div className="flex-1" />

{/* Collaboration status */}
{collaboration?.isConnected && (
<div className="flex items-center gap-1 text-xs text-muted-foreground" role="status" aria-label="Collaboration active">
<Users className="h-3 w-3" />
<span>{collaboration.users.length} user{collaboration.users.length !== 1 ? 's' : ''}</span>
</div>
)}

{/* Multi-select count */}
{multiSelect.count > 1 && (
<span className="text-xs text-muted-foreground">{multiSelect.count} selected</span>
Expand Down
Loading
Loading