Skip to content

Commit

Permalink
Add tooltips to ref directories
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDoe committed Dec 17, 2024
1 parent 9320907 commit 979f2ea
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
ref-tree
addOtherRefsRootTo: aRefTree references: aCollection
| other |
other := aRefTree ensureDirectory: '' label: 'other refs'.
other := aRefTree
ensureDirectory: ''
label: 'other refs'
tooltip: 'Everything that does not fit into the descriptions above.'.
((aCollection
select: [:each | each beginsWith: 'refs/squeak/'])
collect: [:each | (((each splitBy: '/') first: 3) joinSeparatedBy: '/'), $/])
asSet do: [:imageRef | | image |
image := other
ensureDirectory: imageRef
label: (imageRef = self refsBaseName ifTrue: ['this image'] ifFalse: ['a different image']).
asSet do: [:imageRef |
imageRef = self refsBaseName
ifFalse: [image ensureDirectory: imageRef, 'heads/' label: 'local branches']].
ifTrue: [
other
ensureDirectory: imageRef
label: 'this image'
tooltip: 'Other refs associated with this image.
There may be other images that use the same repository on disk.
Refs associated with them will not be listed here, but in their own directories.'
withoutLineEndings withBlanksCondensed]
ifFalse: [ | image |
image := other
ensureDirectory: imageRef
label: 'a different image'
tooltip: 'There is another image that uses the same repository on disk.
The refs listed here are associated with that image.'
withoutLineEndings withBlanksCondensed.
image
ensureDirectory: imageRef, 'heads/'
label: 'local branches'
tooltip: 'Local branches of the other image.']].
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
ref-tree
addRefTreeRootsTo: aRefTree references: aCollection
aRefTree ensureDirectory: self branchesBaseName label: 'local branches'.
aRefTree
ensureDirectory: self branchesBaseName
label: 'local branches'
tooltip: 'Local branches are those that exist in this image.
They are not visible from your system''s git unless you make them available
as a separate external branch via the context menu.'
withoutLineEndings withBlanksCondensed.
self remoteNames do: [:each |
aRefTree
ensureDirectory: self remoteRefBaseName, each, $/
label: ('remote branches on {1}' format: {each printString})].
label: ('remote branches on {1}' format: {each printString})
tooltip: 'These branches exist on the remote.
You cannot directly change these branches,
but you can create local branches from them via the context menu
and then push your new commits to the remote.'
withoutLineEndings withBlanksCondensed].
aRefTree
ensureDirectory: self gitBranchesBaseName label: 'external branches';
ensureDirectory: 'refs/tags/' label: 'tags'.
ensureDirectory: self gitBranchesBaseName
label: 'external branches'
tooltip: 'External branches are those available via your system''s git.
You can create local branches from these to edit in the image
or merge these into your local branches.'
withoutLineEndings withBlanksCondensed;
ensureDirectory: 'refs/tags/'
label: 'tags'
tooltip: 'Tags are immovable references to commits.'.
self addOtherRefsRootTo: aRefTree references: aCollection.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"withoutGitSuffix:" : "mad 11/13/2023 12:03" },
"instance" : {
"actionAddRemote" : "mad 10/9/2024 16:01",
"addOtherRefsRootTo:references:" : "mad 12/17/2024 00:09",
"addRefTreeRootsTo:references:" : "mad 12/16/2024 23:54",
"addOtherRefsRootTo:references:" : "mad 12/17/2024 19:35",
"addRefTreeRootsTo:references:" : "mad 12/17/2024 19:41",
"allReferences" : "mad 11/30/2023 21:44",
"basicHeadRef" : "mad 11/30/2023 13:15",
"branchName:" : "mad 6/4/2023 16:09",
Expand Down
3 changes: 3 additions & 0 deletions src/GitS-Core.package/GSRefTree.class/instance/balloonText.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
balloonText
^ self tooltip ifNil: [super balloonText]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
adding
ensureDirectory: refString label: labelString tooltip: tooltipString
^ (self ensureTree: refString)
compressible: false;
label: labelString;
tooltip: tooltipString;
yourself
3 changes: 3 additions & 0 deletions src/GitS-Core.package/GSRefTree.class/instance/tooltip..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
tooltip: aString
tooltip := aString
3 changes: 3 additions & 0 deletions src/GitS-Core.package/GSRefTree.class/instance/tooltip.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
tooltip
^ tooltip
7 changes: 5 additions & 2 deletions src/GitS-Core.package/GSRefTree.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"instance" : {
"addRef:" : "mad 12/16/2024 22:18",
"addTree:" : "mad 10/10/2024 00:05",
"balloonText" : "mad 12/17/2024 19:27",
"catchAllOr:" : "mad 12/16/2024 23:53",
"children" : "mad 10/9/2024 23:30",
"children:" : "mad 12/17/2024 00:27",
Expand All @@ -15,10 +16,12 @@
"createRef:" : "mad 12/16/2024 23:20",
"createTree:" : "mad 12/17/2024 00:01",
"ensure:" : "mad 12/16/2024 23:53",
"ensureDirectory:label:" : "mad 12/16/2024 23:54",
"ensureDirectory:label:tooltip:" : "mad 12/17/2024 19:28",
"ensureRef:" : "mad 12/16/2024 22:34",
"ensureTree:" : "mad 12/16/2024 23:42",
"findTree:ifFound:ifNone:" : "mad 12/16/2024 23:07",
"initialize" : "mad 12/16/2024 23:51",
"isTree" : "mad 10/9/2024 23:33",
"relative:" : "mad 12/16/2024 22:37" } }
"relative:" : "mad 12/16/2024 22:37",
"tooltip" : "mad 12/17/2024 19:27",
"tooltip:" : "mad 12/17/2024 19:28" } }
3 changes: 2 additions & 1 deletion src/GitS-Core.package/GSRefTree.class/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"commentStamp" : "",
"instvars" : [
"children",
"compressible" ],
"compressible",
"tooltip" ],
"name" : "GSRefTree",
"pools" : [
],
Expand Down

0 comments on commit 979f2ea

Please sign in to comment.