Skip to content

Commit

Permalink
Resolve further rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeAtHPI committed Feb 14, 2025
1 parent 2efe850 commit be57ac4
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 76 deletions.
2 changes: 1 addition & 1 deletion packages/Sandblocks-Babylonian/SBCluster.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ SBCluster >> newTopRowFrom: aCollectionOfMorphs [
cellPositioning: #topCenter;
hResizing: #spaceFill;
addAllMorphsBack: (aCollectionOfMorphs collect: [:aMorph |
self morphResizer applyOn: aMorph])
self newContainerMorph addMorphBack: (self morphResizer applyOn: aMorph)])
]

{ #category : #visualisation }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ SBCorrelationCluster >> newTopRowFrom: aCollectionOfPermutationLabels [
cellPositioning: #bottomCenter;
hResizing: #spaceFill;
addAllMorphsBack: (aCollectionOfPermutationLabels collect: [:aLabel |
self morphResizer applyOn: aLabel])
self newContainerMorph addMorphBack: (self morphResizer applyOn: aLabel)])
]

{ #category : #helper }
Expand Down
2 changes: 1 addition & 1 deletion packages/Sandblocks-Babylonian/SBCorrelationView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ SBCorrelationView >> buildForExample: anExample watching: aWatch [
listDirection: #topToBottom;
cellPositioning: #rightCenter;
cellInset: 0@10;
addAllMorphsBack: ((self buildGridsFor: anExample watching: aWatch) flatten)}})
addAllMorphsBack: ((self buildGridsFor: anExample watching: aWatch) flatten)})
]

{ #category : #building }
Expand Down
13 changes: 0 additions & 13 deletions packages/Sandblocks-Babylonian/SBExampleCluster.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,6 @@ SBExampleCluster >> extractedTopHeadingsFrom: aCollectionOfSBUniverses [
tag: (SBTag newFromPermutation: aUniverse activePermutation)]
]

{ #category : #visualisation }
SBExampleCluster >> newTopRowFrom: aCollectionOfPermutationLabels [

"Width should be set, but height can vary"
^ self newContainerMorph
listDirection: #leftToRight;
listCentering: #bottomRight;
cellPositioning: #topCenter;
hResizing: #spaceFill;
addAllMorphsBack: (aCollectionOfPermutationLabels collect: [:aLabel |
self morphResizer applyOn: aLabel])
]

{ #category : #accessing }
SBExampleCluster >> universes [

Expand Down
11 changes: 6 additions & 5 deletions packages/Sandblocks-Babylonian/SBExploriants.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ SBExploriants >> generationTimeout [
{ #category : #accessing }
SBExploriants >> historyView [

^ self namedBlocks detect: #isHistoryView
^ self namedBlocks
detect: #isHistoryView
ifFound: [:theHistory | theHistory]
ifNone: [nil]
]

{ #category : #accessing }
Expand Down Expand Up @@ -179,12 +182,10 @@ SBExploriants >> isArtefact [

{ #category : #initialization }
SBExploriants >> methodChanged: anEvent [

self flag: #todo. "change with historyview api"

anEvent isModified
ifTrue: [
namedBlocks detect: #isHistory
ifFound: [:history | history addCodeSnapshot: anEvent]]
self historyView ifNotNil: [:history | history addCodeSnapshot: anEvent]]
]

{ #category : #accessing }
Expand Down
6 changes: 0 additions & 6 deletions packages/Sandblocks-Babylonian/SBExploriantsView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,6 @@ SBExploriantsView >> initialize [
self block: self buildBlock.
]

{ #category : #accessing }
SBExploriantsView >> isHistory [
self flag: #todo. "redundant to isHistoryView"
^ false
]

{ #category : #accessing }
SBExploriantsView >> isHistoryView [

Expand Down
63 changes: 63 additions & 0 deletions packages/Sandblocks-Babylonian/SBHistoryCodeEpoche.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Class {
#name : #SBHistoryCodeEpoche,
#superclass : #SBHistoryEpoche,
#instVars : [
'diff'
],
#category : #'Sandblocks-Babylonian'
}

{ #category : #'initialize-release' }
SBHistoryCodeEpoche class >> buildFromChange: aChange [

^ self new
change: aChange;
yourself
]

{ #category : #building }
SBHistoryCodeEpoche >> change: aChange [

| lastVersion |

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].

self addAllMorphsBack: {
self buildMetaUsage.
diff := (lastVersion ifNotNil: [
TextDiffBuilder
buildDisplayPatchFrom: lastVersion text
to: aChange item getSource
inClass: aChange item methodClass
prettyDiffs: false]
ifNil: [aChange item getSource]) asMorph}
]

{ #category : #accessing }
SBHistoryCodeEpoche >> diff [

^ diff
]

{ #category : #'*Sandblocks-Babylonian' }
SBHistoryCodeEpoche >> privateSnapshotSatisfying: aCollectionOfSBTags from: originalEpoche [

self removeAllMorphs.
self addAllMorphsBack: {
self snapshotMetaUsageTimeStamp: originalEpoche timestamp notes: originalEpoche notes.
diff := originalEpoche diff snapshotSatisfying: aCollectionOfSBTags}
]

{ #category : #accessing }
SBHistoryCodeEpoche >> setIndexTo: aNewIndex [

"Do nothing"
]

{ #category : #building }
SBHistoryCodeEpoche >> visualize [

"Do nothing, only visualize by calling #change:"
]
10 changes: 10 additions & 0 deletions packages/Sandblocks-Babylonian/SBHistoryCodeEpoche.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Extension { #name : #SBHistoryCodeEpoche }

{ #category : #'*Sandblocks-Babylonian' }
SBHistoryCodeEpoche >> privateSnapshotSatisfying: aCollectionOfSBTags from: originalEpoche [

self removeAllMorphs.
self addAllMorphsBack: {
self snapshotMetaUsageTimeStamp: originalEpoche timestamp notes: originalEpoche notes.
diff := originalEpoche diff snapshotSatisfying: aCollectionOfSBTags}
]
21 changes: 16 additions & 5 deletions packages/Sandblocks-Babylonian/SBHistoryEpoche.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ SBHistoryEpoche >> initialize [
cellInset: 2;
borderWidth: 0.

self addAllMorphsBack: {
self buildMetaUsage.
tabview := self buildSnapshotTabView}
self visualize
]

{ #category : #accessing }
Expand All @@ -96,7 +94,7 @@ SBHistoryEpoche >> privateSnapshotSatisfying: aCollectionOfSBTags from: original
self removeAllMorphs.
self addAllMorphsBack: {
self snapshotMetaUsageTimeStamp: originalEpoche timestamp notes: originalEpoche notes.
tabview snapshotSatisfying: aCollectionOfSBTags}
tabview := originalEpoche tabview snapshotSatisfying: aCollectionOfSBTags}
]

{ #category : #accessing }
Expand All @@ -119,7 +117,6 @@ SBHistoryEpoche >> snapshotMetaUsageTimeStamp: oldStamp notes: oldNotes [
SBHistoryEpoche >> snapshotSatisfying: aCollectionOfSBTags [

^ self class new
setIndexTo: tabview activeIndex;
privateSnapshotSatisfying: aCollectionOfSBTags from: self
]

Expand All @@ -129,8 +126,22 @@ SBHistoryEpoche >> tabsToSnapshot [
^ (SBExploriants uniqueInstance namedBlocks detect: #isOverview) views
]

{ #category : #accessing }
SBHistoryEpoche >> tabview [

^ tabview
]

{ #category : #accessing }
SBHistoryEpoche >> timestamp [

^ timestamp
]

{ #category : #building }
SBHistoryEpoche >> visualize [

self addAllMorphsBack: {
self buildMetaUsage.
tabview := self buildSnapshotTabView}
]
3 changes: 1 addition & 2 deletions packages/Sandblocks-Babylonian/SBHistoryEpoche.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SBHistoryEpoche >> privateSnapshotSatisfying: aCollectionOfSBTags from: original
self removeAllMorphs.
self addAllMorphsBack: {
self snapshotMetaUsageTimeStamp: originalEpoche timestamp notes: originalEpoche notes.
tabview snapshotSatisfying: aCollectionOfSBTags}
tabview := originalEpoche tabview snapshotSatisfying: aCollectionOfSBTags}
]

{ #category : #'*Sandblocks-Babylonian' }
Expand All @@ -23,6 +23,5 @@ SBHistoryEpoche >> snapshotMetaUsageTimeStamp: oldStamp notes: oldNotes [
SBHistoryEpoche >> snapshotSatisfying: aCollectionOfSBTags [

^ self class new
setIndexTo: tabview activeIndex;
privateSnapshotSatisfying: aCollectionOfSBTags from: self
]
53 changes: 12 additions & 41 deletions packages/Sandblocks-Babylonian/SBHistoryView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ SBHistoryView >> addCodeSnapshot: aChange [

self ensureStackSize.

self scroller addMorphFront: (self buildCodeSnapshot: aChange)
self scroller addMorphFront: (SBHistoryCodeEpoche new change: aChange)
]

{ #category : #building }
SBHistoryView >> addEpoche [

self ensureStackSize.

self scroller addMorphFront: self buildEpoche
self scroller addMorphFront: SBHistoryEpoche new
]

{ #category : #accessing }
Expand All @@ -41,33 +41,6 @@ SBHistoryView >> backtrackForWatch: aSBWatch [
^ self copySatisfying: {SBTag newFromWatch: aSBWatch}
]

{ #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 [
^ SBHistoryEpoche new
]

{ #category : #building }
SBHistoryView >> buildScrollPane [

Expand Down Expand Up @@ -125,11 +98,16 @@ SBHistoryView >> clearButton [
{ #category : #accessing }
SBHistoryView >> copySatisfying: aCollectionOfSBTags [

^ self buildBlock
addAllMorphsBack: (
self epoches
collect: [:anEpoche | anEpoche snapshotSatisfying: aCollectionOfSBTags]);
yourself
| newScrollPane block |
newScrollPane := self buildScrollPane.
block := self buildBlock.
block addMorphBack: newScrollPane.
newScrollPane
hResizing: #shrinkWrap;
width: scrollPane width.
newScrollPane scroller addAllMorphsBack: (self epoches
collect: [:anEpoche | anEpoche snapshotSatisfying: aCollectionOfSBTags]).
^ block
]

{ #category : #building }
Expand All @@ -155,12 +133,6 @@ SBHistoryView >> initialize [
self block addMorphBack: scrollPane.
]

{ #category : #accessing }
SBHistoryView >> isHistory [

^ true
]

{ #category : #accessing }
SBHistoryView >> isHistoryView [

Expand All @@ -181,7 +153,6 @@ SBHistoryView >> offerChangeTabMenu [
index := UIManager default chooseFrom: options.
index = 0 ifTrue: [^ self].

self flag: #todo. "epoches for code snapshots should respond to same api and do nothing"
self epoches do: [:anEpoche | anEpoche setIndexTo: index].
]

Expand Down
16 changes: 15 additions & 1 deletion packages/Sandblocks-Babylonian/SBPermutationCluster.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,24 @@ SBPermutationCluster >> extractedLeftHeadingsFrom: aCollectionOfSBExampleWatches
SBPermutationCluster >> extractedTopHeadingsFrom: aCollectionOfSBExampleWatches [

^ (aCollectionOfSBExampleWatches first exampleToDisplay values collect: [:aDisplay |
aDisplay labelMorph copy
(TextMorph new contents: aDisplay label)
wrapFlag: true;
tag: (SBTag new exampleLabel: aDisplay labelMorph contents)])
]

{ #category : #visualisation }
SBPermutationCluster >> newTopRowFrom: aCollectionOfMorphs [

"Width should be set, but height can vary"
^ self newContainerMorph
listDirection: #rightToLeft;
listCentering: #bottomLeft;
cellPositioning: #topCenter;
hResizing: #spaceFill;
addAllMorphsBack: (aCollectionOfMorphs collect: [:aMorph |
self newContainerMorph addMorphBack: (self morphResizer applyOn: aMorph)])
]

{ #category : #accessing }
SBPermutationCluster >> watches [

Expand Down

0 comments on commit be57ac4

Please sign in to comment.