Skip to content

Commit

Permalink
Remove only the reverted diff entry rather than recompute the whole d…
Browse files Browse the repository at this point in the history
…iff after revert (fixes #1745)
  • Loading branch information
daniels220 committed Dec 16, 2023
1 parent 4733a87 commit 968578d
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 968578d

Please sign in to comment.