fix: drag-to-create parent group is now an empty container
When dragging B onto A, the result is now: - New Group (empty, no file) - File A - File B Previously the group inherited A's file, creating a self-referencing parent.
This commit is contained in:
@@ -1048,10 +1048,13 @@ export class WaypointView extends ItemView {
|
|||||||
const newGroup: BookmarkItem = {
|
const newGroup: BookmarkItem = {
|
||||||
id: `bm-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`,
|
id: `bm-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`,
|
||||||
type: 'group',
|
type: 'group',
|
||||||
label: target.label,
|
label: 'New Group',
|
||||||
filePath: target.filePath || '',
|
filePath: '',
|
||||||
icon: '',
|
icon: '',
|
||||||
children: [{ ...target, indent: 1 }, { ...dragged, indent: 1 }],
|
children: [
|
||||||
|
{ ...target, indent: target.indent + 1 },
|
||||||
|
{ ...dragged, indent: target.indent + 1 },
|
||||||
|
],
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
indent: target.indent,
|
indent: target.indent,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user