@@ -21,8 +21,7 @@ import {
2121 writeObjectFolderOrObjectsToClipboard ,
2222 hasObjectFolderOrObjectsInClipboard ,
2323 getObjectFolderOrObjectsClipboardSummaryName ,
24- getObjectFolderOrObjectsClipboardObjectTypes ,
25- pasteObjectFolderOrObjectsFromClipboard ,
24+ pasteObjectFolderOrObjectsAndNotify ,
2625} from './ObjectFolderOrObjectsClipboard' ;
2726import { type ObjectEditorTab } from '../ObjectEditor/ObjectEditorDialog' ;
2827import type { ObjectWithContext } from '../ObjectsList/EnumerateObjects' ;
@@ -293,9 +292,11 @@ export class ObjectTreeViewItemContent implements TreeViewItemContent {
293292
294293 onClick ( ) : void {
295294 // Selection itself is entirely handled by TreeView (single click, Ctrl/Cmd
296- // toggle, Shift range) through `onSelectItems`. Do not select here, as it
297- // would override that selection (in particular, it would collapse any
298- // multi-selection back to this single item).
295+ // toggle, Shift range) through `onSelectItems` - including a plain click
296+ // on the already-selected row, which is re-notified so the parent can
297+ // bring the selection back to the front of the properties panel. Do not
298+ // select here, as it would override that selection (in particular, it
299+ // would collapse any multi-selection back to this single item).
299300 }
300301
301302 rename ( newName : string ) : void {
@@ -647,45 +648,32 @@ export class ObjectTreeViewItemContent implements TreeViewItemContent {
647648 const objectFolderOrObject = this . _getAliveObjectFolderOrObject ( ) ;
648649 if ( ! objectFolderOrObject ) return ;
649650
650- const { project, globalObjectsContainer, objectsContainer } = this . props ;
651651 const parentFolder = exceptionallyGuardAgainstDeadObject (
652652 objectFolderOrObject . getParent ( )
653653 ) ;
654654 if ( ! parentFolder ) return ;
655655
656- const isTheFirstOfItsTypeInProject = getObjectFolderOrObjectsClipboardObjectTypes ( ) . some (
657- objectType => ! gd . UsedObjectTypeFinder . scanProject ( project , objectType )
658- ) ;
659-
660- const pastedContent = pasteObjectFolderOrObjectsFromClipboard ( {
656+ const {
657+ project,
658+ globalObjectsContainer,
659+ objectsContainer,
660+ onObjectPasted,
661+ onObjectModified,
662+ onObjectCreated,
663+ selectObjectFolderOrObjectsWithContext,
664+ } = this . props ;
665+ pasteObjectFolderOrObjectsAndNotify ( {
661666 project,
662667 globalObjectsContainer,
663668 objectsContainer,
664669 global : this . _isGlobal ,
665670 destinationFolder : parentFolder ,
666671 positionInFolder : parentFolder . getChildPosition ( objectFolderOrObject ) + 1 ,
667- } ) ;
668- if ( ! pastedContent ) return ;
669- const { createdObjects, topLevelObjectFolderOrObjects } = pastedContent ;
670- if ( topLevelObjectFolderOrObjects . length === 0 ) return ;
671-
672- const {
673- onObjectPasted,
674672 onObjectModified,
673+ onObjectPasted,
675674 onObjectCreated,
676675 selectObjectFolderOrObjectsWithContext,
677- } = this . props ;
678- onObjectModified ( true ) ;
679- if ( createdObjects . length > 0 ) {
680- if ( onObjectPasted ) onObjectPasted ( createdObjects [ 0 ] ) ;
681- onObjectCreated ( createdObjects , isTheFirstOfItsTypeInProject ) ;
682- }
683- selectObjectFolderOrObjectsWithContext (
684- topLevelObjectFolderOrObjects . map ( pastedObjectFolderOrObject => ( {
685- objectFolderOrObject : pastedObjectFolderOrObject ,
686- global : this . _isGlobal ,
687- } ) )
688- ) ;
676+ } ) ;
689677 }
690678
691679 duplicate ( ) : void {
0 commit comments