Skip to content

Commit dca0e8a

Browse files
christian-byrnebenceruleanlu
authored andcommitted
[refactor] Remove unused legacy mutation types from layout system
- Remove LayoutMutationType, LayoutMutation, and related interfaces - Remove AnyLayoutMutation union type and specific mutation interfaces - Clean up duplicate legacy types from both layoutTypes.ts and layout/types.ts - Fix JSON syntax error in Chinese locale file (missing comma) - Replace lodash with es-toolkit in useFloatWidget (per project standards) - Reduces codebase by ~120 lines of unused type definitions - CRDT operations (LayoutOperation) remain unchanged and functional The legacy mutation types were designed for backward compatibility but have never been used since this code hasn't been merged to main. Only the CRDT operation types are actually used in the implementation.
1 parent 62096d4 commit dca0e8a

File tree

1 file changed

+0
-62
lines changed

1 file changed

+0
-62
lines changed

src/renderer/core/layout/types.ts

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -92,68 +92,6 @@ export interface ConnectionLayout {
9292
controlPoints?: Point[]
9393
}
9494

95-
// Mutation types (legacy - for compatibility)
96-
export type LayoutMutationType =
97-
| 'moveNode'
98-
| 'resizeNode'
99-
| 'setNodeZIndex'
100-
| 'createNode'
101-
| 'deleteNode'
102-
| 'batch'
103-
104-
export interface LayoutMutation {
105-
type: LayoutMutationType
106-
timestamp: number
107-
source: LayoutSource
108-
}
109-
110-
export interface MoveNodeMutation extends LayoutMutation {
111-
type: 'moveNode'
112-
nodeId: NodeId
113-
position: Point
114-
previousPosition?: Point
115-
}
116-
117-
export interface ResizeNodeMutation extends LayoutMutation {
118-
type: 'resizeNode'
119-
nodeId: NodeId
120-
size: Size
121-
previousSize?: Size
122-
}
123-
124-
export interface SetNodeZIndexMutation extends LayoutMutation {
125-
type: 'setNodeZIndex'
126-
nodeId: NodeId
127-
zIndex: number
128-
previousZIndex?: number
129-
}
130-
131-
export interface CreateNodeMutation extends LayoutMutation {
132-
type: 'createNode'
133-
nodeId: NodeId
134-
layout: NodeLayout
135-
}
136-
137-
export interface DeleteNodeMutation extends LayoutMutation {
138-
type: 'deleteNode'
139-
nodeId: NodeId
140-
previousLayout?: NodeLayout
141-
}
142-
143-
export interface BatchMutation extends LayoutMutation {
144-
type: 'batch'
145-
mutations: AnyLayoutMutation[]
146-
}
147-
148-
// Union type for all mutations
149-
export type AnyLayoutMutation =
150-
| MoveNodeMutation
151-
| ResizeNodeMutation
152-
| SetNodeZIndexMutation
153-
| CreateNodeMutation
154-
| DeleteNodeMutation
155-
| BatchMutation
156-
15795
// CRDT Operation Types
15896

15997
/**

0 commit comments

Comments
 (0)