diff --git a/packages/Sandblocks-Babylonian/SBExploriants.class.st b/packages/Sandblocks-Babylonian/SBExploriants.class.st index 34e0a475..4a9607f0 100644 --- a/packages/Sandblocks-Babylonian/SBExploriants.class.st +++ b/packages/Sandblocks-Babylonian/SBExploriants.class.st @@ -120,7 +120,7 @@ SBExploriants >> evaluationReceiver [ { #category : #accessing } SBExploriants >> ignoreUpdate [ - ^ ignoreUpdate + ^ ignoreUpdate ifNil: [false] ] { #category : #accessing } @@ -143,18 +143,40 @@ SBExploriants >> initialize [ vResizing: #shrinkWrap ] +{ #category : #initialization } +SBExploriants >> intoWorld: aWorld [ + + super intoWorld: aWorld. + SystemChangeNotifier uniqueInstance + noMoreNotificationsFor: self; + notify: self ofSystemChangesOfItem: #method using: #methodChanged: +] + { #category : #testing } SBExploriants >> isArtefact [ ^ true ] +{ #category : #initialization } +SBExploriants >> methodChanged: anEvent [ + + anEvent isModified ifTrue: [namedBlocks last addCodeSnapshot: anEvent] +] + { #category : #accessing } SBExploriants >> objectToPermutation [ ^ objectToPermutation ] +{ #category : #initialization } +SBExploriants >> outOfWorld: aWorld [ + + SystemChangeNotifier uniqueInstance noMoreNotificationsFor: self. + super outOfWorld: aWorld +] + { #category : #'artefact protocol' } SBExploriants >> saveTryFixing: aFixBoolean quick: aQuickBoolean [ diff --git a/packages/Sandblocks-Babylonian/SBHistoryView.class.st b/packages/Sandblocks-Babylonian/SBHistoryView.class.st index 3bc0216b..67d8a8b6 100644 --- a/packages/Sandblocks-Babylonian/SBHistoryView.class.st +++ b/packages/Sandblocks-Babylonian/SBHistoryView.class.st @@ -4,6 +4,14 @@ Class { #category : #'Sandblocks-Babylonian' } +{ #category : #building } +SBHistoryView >> addCodeSnapshot: aChange [ + + self submorphs size - 1 "buttonRow" > self maxEpoches ifTrue: [self lastSubmorph delete]. + + self block addMorph: (self buildCodeSnapshot: aChange) atIndex: 2 +] + { #category : #building } SBHistoryView >> addEpoche [ @@ -12,6 +20,28 @@ SBHistoryView >> addEpoche [ self block addMorph: self buildEpoche atIndex: 2 ] +{ #category : #building } +SBHistoryView >> buildCodeSnapshot: aChange [ + + | row lastVersion | + row := self containerRow. + + lastVersion := (VersionsBrowser new + scanVersionsOf: aChange item class: aChange item methodClass meta: false + category: aChange item methodReference category selector: aChange item selector) changeList at: 2 ifAbsent: [nil]. + + ^ row + cellGap: 0@10; + listDirection: #topToBottom; + addAllMorphsBack: { + self buildMetaUsageIn: row. + (lastVersion ifNotNil: [ + (TextDiffBuilder buildDisplayPatchFrom: lastVersion text to: aChange item getSource inClass: aChange item methodClass prettyDiffs: false)] ifNil: [aChange item getSource]) asMorph + } + + +] + { #category : #building } SBHistoryView >> buildEpoche [