[squeak-dev] The Inbox: Morphic-ct.1781.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Sep 20 18:33:54 UTC 2021


A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1781.mcz

==================== Summary ====================

Name: Morphic-ct.1781
Author: ct
Time: 20 September 2021, 8:33:47.810659 pm
UUID: aaa4f710-2270-7b48-8238-17f7634138d1
Ancestors: Morphic-ul.1780

Proposal: Rearrange items in the new changes menu of the docking bar so that static items will always appears at the top. Run construction of dynamic items asynchronously to keep the UI responsive.

On my machine with slow file-system access, this increases the responsiveness of the docking bar *significantly*. You have no idea how often I have been moaning about this particular menu when I was just hitting Ctrl + 9 by accident and had to take a mandatory break ... :-)

This resolves all the issues I have raised in http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-April/215029.html and http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-May/215314.html. :-)

=============== Diff against Morphic-ul.1780 ===============

Item was changed:
  ----- Method: TheWorldMainDockingBar>>listChangesOn: (in category 'submenu - changes') -----
  listChangesOn: menu
  
+ 	menu defaultTarget: self.
+ 	menu addTranslatedList: #(
+ 		('Simple Change Sorter'				browseChanges)
+ 		('Dual Change Sorter'					browseChangesDual)
+ 		('Browse changed methods'		browseChangedMethods)).
+ 	
+ 	self flag: #hack. "To avoid relayout of static items when dynamic items with icons from below will added, add blank icons right now."
+ 	menu addBlankIconsIfNecessary: (MenuIcons blankIconOfWidth: RealEstateAgent defaultIconExtent x).
+ 	
+ 	[| latestMethodChanges latestClassChanges|
- 	| latestMethodChanges latestClassChanges|
  	latestMethodChanges := (Array streamContents: [:s |
  		ChangeSet current changedMethodsDo: [:method :changeType :dateAndTime :category |
  			s nextPut: { dateAndTime. method. changeType. category }]])
  			sorted: [:a :b | a first >= b first].
- 
- 	1 to: (10 min: latestMethodChanges size) do: [:index | | spec method |
- 		spec := latestMethodChanges at: index.
- 		method := spec second.
- 		menu addItem: [:item |
- 			item
- 				contents: ('{1} {2} \{{3}\} \{{4}\}' format: {method methodClass. method selector. spec fourth. method methodClass category}) ;
- 				target: ToolSet;
- 				balloonText: spec third asString;
- 				icon: ((#(remove addedThenRemoved) includes: spec third) ifTrue: [MenuIcons smallDeleteIcon] ifFalse: [
- 					spec third = #add ifTrue: [MenuIcons smallNewIcon] ifFalse: [MenuIcons blankIcon]]);
- 				selector: (method isInstalled ifTrue: [#browseMethod:] ifFalse: [#browseMethodVersion:]);
- 				arguments: {method}]].
- 				
- 	latestClassChanges := (Array streamContents: [:s |
- 		ChangeSet current changedClassesDo: [:class :changeTypes :dateAndTime :category |
- 			"We are not interested in classes whose method's did only change."
- 			changeTypes ifNotEmpty: [s nextPut: { dateAndTime. class. changeTypes. category }]]])
- 			sorted: [:a :b | a first >= b first].
- 
- 	latestClassChanges ifNotEmpty: [menu addLine].
- 	1 to: (10 min: latestClassChanges size) do: [:index | | spec class |
- 		spec := latestClassChanges at: index.
- 		class := spec second.
- 		menu addItem: [:item |
- 			item
- 				contents: ('{1} \{{2}\}' format: {class name. spec fourth }) ;
- 				target: ToolSet;
- 				balloonText: (spec third sorted joinSeparatedBy: Character space);
- 				icon: ((spec third includesAnyOf: #(remove addedThenRemoved))
- 					ifTrue: [MenuIcons smallDeleteIcon]
- 					ifFalse: [
- 						(spec third includes: #add)
- 							ifTrue: [MenuIcons smallNewIcon]
- 							ifFalse: [MenuIcons blankIcon]]);
- 				selector: ((spec third includes: #remove) ifTrue: [#inspect:] ifFalse: [#browseClass:]);
- 				arguments: {class}]].
  	
+ 	Project current addDeferredUIMessage: [
+ 		menu addLine.
+ 		
+ 		1 to: (10 min: latestMethodChanges size) do: [:index | | spec method |
+ 			spec := latestMethodChanges at: index.
+ 			method := spec second.
+ 			menu addItem: [:item |
+ 				item
+ 					contents: ('{1} {2} \{{3}\} \{{4}\}' format: {method methodClass. method selector. spec fourth. method methodClass category}) ;
+ 					target: ToolSet;
+ 					balloonText: spec third asString;
+ 					icon: ((#(remove addedThenRemoved) includes: spec third) ifTrue: [MenuIcons smallDeleteIcon] ifFalse: [
+ 						spec third = #add ifTrue: [MenuIcons smallNewIcon] ifFalse: [MenuIcons blankIcon]]);
+ 					selector: (method isInstalled ifTrue: [#browseMethod:] ifFalse: [#browseMethodVersion:]);
+ 					arguments: {method}]].
+ 					
+ 		latestClassChanges := (Array streamContents: [:s |
+ 			ChangeSet current changedClassesDo: [:class :changeTypes :dateAndTime :category |
+ 				"We are not interested in classes whose method's did only change."
+ 				changeTypes ifNotEmpty: [s nextPut: { dateAndTime. class. changeTypes. category }]]])
+ 				sorted: [:a :b | a first >= b first].
- 	menu defaultTarget: self.
- 	menu addTranslatedList: #(
- 		-
- 		('Browse current change set'		browseChangeSet)
- 		('Browse changed methods'		browseChangedMethods)
- 		-
- 		('Simple Change Sorter'				browseChanges)
- 		('Dual Change Sorter'					browseChangesDual)).
  
+ 		latestClassChanges ifNotEmpty: [menu addLine].
+ 		1 to: (10 min: latestClassChanges size) do: [:index | | spec class |
+ 			spec := latestClassChanges at: index.
+ 			class := spec second.
+ 			menu addItem: [:item |
+ 				item
+ 					contents: ('{1} \{{2}\}' format: {class name. spec fourth }) ;
+ 					target: ToolSet;
+ 					balloonText: (spec third sorted joinSeparatedBy: Character space);
+ 					icon: ((spec third includesAnyOf: #(remove addedThenRemoved))
+ 						ifTrue: [MenuIcons smallDeleteIcon]
+ 						ifFalse: [
+ 							(spec third includes: #add)
+ 								ifTrue: [MenuIcons smallNewIcon]
+ 								ifFalse: [MenuIcons blankIcon]]);
+ 					selector: ((spec third includes: #remove) ifTrue: [#inspect:] ifFalse: [#browseClass:]);
+ 					arguments: {class}]]]] forkAt: Processor userBackgroundPriority.!
- 
- !



More information about the Squeak-dev mailing list