Skip to content

Commit fb1192c

Browse files
committed
refactor(ui)!: retire plugin-designer's dead collaboration code, VersionHistory and the useConfirmDialog entry line
The CollaborationProvider left the package entry in the previous batch and nothing mounts it, so useCollaboration() is always null: delete the module and the four designers' broadcast branches and status chips. VersionHistory has no reader in the package or outside it: delete the module, its test and its sub-barrel lines. useConfirmDialog stays module-local (seven designers use it); only the entry and README stop publishing it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jR9JS6qCZyzC5esvUr
1 parent 128681f commit fb1192c

14 files changed

Lines changed: 52 additions & 573 deletions
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@object-ui/plugin-designer': patch
3+
---
4+
5+
refactor(plugin-designer)!: retire `useConfirmDialog` and `VersionHistory` from the entry, and delete the designers' dead collaboration code
6+
7+
Clause-②: yes
8+
Metadata-protocol: none
9+
10+
<!-- 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 -->
11+
12+
**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.
13+
14+
- 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.
15+
- `useConfirmDialog` stays inside the package, because the designers use it for their delete prompts. Only the entry stops publishing it.
16+
- 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.
17+
18+
What leaves, and what to write instead (neither has a replacement export):
19+
20+
- FROM `useConfirmDialog` TO no replacement: render your own confirm prompt with `ConfirmDialog` (still exported) and local `useState`.
21+
- FROM `VersionHistory` TO no replacement: render the version list in your own component. The designers never showed one.

‎ui/packages/plugin-designer/README.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,17 @@ declare const sections: ReportDesignerSection[];
125125
### Shared Hooks
126126

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

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

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

136135
### Shared Components
137136

138137
```tsx
139-
import { ConfirmDialog, Minimap, VersionHistory } from '@object-ui/plugin-designer';
138+
import { ConfirmDialog, Minimap } from '@object-ui/plugin-designer';
140139
```
141140

142141
## Links

‎ui/packages/plugin-designer/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "18.2.0",
44
"type": "module",
55
"license": "MIT",
6-
"description": "Visual designer plugin for ObjectUI with page, data model, process, and report designers plus collaborative editing.",
6+
"description": "Visual designer plugin for ObjectUI with page, data model, process, and report designers.",
77
"main": "dist/index.umd.cjs",
88
"module": "dist/index.js",
99
"types": "dist/index.d.ts",

‎ui/packages/plugin-designer/src/CollaborationProvider.tsx‎

Lines changed: 0 additions & 252 deletions
This file was deleted.

‎ui/packages/plugin-designer/src/DataModelDesigner.tsx‎

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

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

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

303-
// --- Collaboration ---
304-
const collaboration = useCollaboration();
305-
306302
// --- Collapsible panels ---
307303
const [showProperties, setShowProperties] = useState(true);
308304
const [showMinimap, setShowMinimap] = useState(true);
@@ -343,8 +339,7 @@ export function DataModelDesigner({
343339
};
344340
pushState(next);
345341
multiSelect.selectOne(newEntity.id);
346-
collaboration?.sendOperation({ type: 'insert', userId: collaboration?.currentUserId ?? '', elementId: newEntity.id, data: { name: newEntity.name, label: newEntity.label } });
347-
}, [readOnly, undoRedo, pushState, multiSelect, collaboration]);
342+
}, [readOnly, undoRedo, pushState, multiSelect]);
348343

349344
const handleDeleteEntity = useCallback(
350345
async (id: string) => {
@@ -367,9 +362,8 @@ export function DataModelDesigner({
367362
if (multiSelect.isSelected(id)) {
368363
multiSelect.clearSelection();
369364
}
370-
collaboration?.sendOperation({ type: 'delete', userId: collaboration?.currentUserId ?? '', elementId: id, data: {} });
371365
},
372-
[readOnly, entities, confirmDialog, undoRedo, pushState, multiSelect, collaboration],
366+
[readOnly, entities, confirmDialog, undoRedo, pushState, multiSelect],
373367
);
374368

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

789783
<div className="flex-1" />
790784

791-
{/* Collaboration status */}
792-
{collaboration?.isConnected && (
793-
<div className="flex items-center gap-1 text-xs text-muted-foreground" role="status" aria-label="Collaboration active">
794-
<Users className="h-3 w-3" />
795-
<span>{collaboration.users.length} user{collaboration.users.length !== 1 ? 's' : ''}</span>
796-
</div>
797-
)}
798-
799785
{/* Multi-select count */}
800786
{multiSelect.count > 1 && (
801787
<span className="text-xs text-muted-foreground">{multiSelect.count} selected</span>

0 commit comments

Comments
 (0)