Skip to content

Commit

Permalink
Merge pull request #1782 from shoshanatech/remove-only-reverted-entry
Browse files Browse the repository at this point in the history
Remove only the reverted diff entry rather than recompute the whole diff after revert (fixes #1745)
  • Loading branch information
guillep authored Jan 18, 2024
2 parents 185b912 + 968578d commit eb8661b
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions Iceberg-TipUI/IceTipDiffPanel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,29 @@ IceTipDiffPanel >> diffContentsLeft: leftString right: rightString [
rightText: rightString
]

{ #category : 'initialization' }
IceTipDiffPanel >> diffEntryRemoved: announcement [

| parent |
(parent := announcement entry parent) removeChild: announcement entry.
"Removing all changes to a class should remove the class node too,
unless the class definition has changed as well. Extension definitions
may appear as an 'addition' or 'removal', but can only exist when methods
of that class have changed. Repeat this process to check if the containing
package no longer has any changes. Cannot remove the root node as it has
no parent, but it's fine to just leave it there empty--though perhaps we should
close the browser instead in that case?"
[
parent parent notNil and: [
parent isEmpty and: [
parent value isNoModification or: [
parent value definition isExtensionDefinition ] ] ] ] whileTrue: [
parent parent removeChild: parent.
parent := parent parent ].

self basicRefresh
]

{ #category : 'accessing - ui' }
IceTipDiffPanel >> diffPanel [

Expand Down Expand Up @@ -224,10 +247,9 @@ IceTipDiffPanel >> setModelBeforeInitialization: anObject [
IceTipDiffPanel >> subscribeToAnnouncements [

self announcer
when: IceTipDiffEntryRemoved
send: #refresh
when: IceTipDiffEntryRemoved
send: #diffEntryRemoved:
to: self

]

{ #category : 'specs' }
Expand Down

0 comments on commit eb8661b

Please sign in to comment.