From b1f6e31ddcb4b2a17aae24e836b5d66bcffc008a Mon Sep 17 00:00:00 2001 From: Christoph Thiede Date: Fri, 17 Jun 2022 20:07:51 +0200 Subject: [PATCH 1/5] ui: fixes for dialog text fields (save version dialog + feedback dialog) * disable formatting in text fields (>= Squeak 6.0) * save version dialog: implement setTextSelector (#message:) correctly to let the view know that the save was successful (will remove the orange triangle) * save version dialog: fix cancel to actually reset the text (#okToRevertChanges:) (>= Squeak 6.0) * feedback dialog: instead of hacking #editText:, update all dialog texts prior to submitting via #acceptChanges. This way, undo/redo is working as normally and the edit indication semantics of the toolbuilder are maintained. --- .../SquitFeedback.class/instance/actionSubmit.st | 1 + .../instance/buildInputFields..st | 14 +++++++++----- .../SquitFeedback.class/methodProperties.json | 4 ++-- .../instance/message..st | 3 ++- .../instance/okToRevertChanges..st | 5 +++++ .../instance/widgetSpecs..st | 3 +++ .../methodProperties.json | 5 +++-- 7 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 src/Squot.package/SquotSaveVersionDialog.class/instance/okToRevertChanges..st diff --git a/src/Squit.package/SquitFeedback.class/instance/actionSubmit.st b/src/Squit.package/SquitFeedback.class/instance/actionSubmit.st index c84d7d980..c4cec5ab4 100644 --- a/src/Squit.package/SquitFeedback.class/instance/actionSubmit.st +++ b/src/Squit.package/SquitFeedback.class/instance/actionSubmit.st @@ -1,5 +1,6 @@ actions actionSubmit + self changed: #acceptChanges. self actionTitle ifEmpty: [self error: 'No title provided.']. self actionMessage ifEmpty: [self error: 'No message provided.']. WebClient diff --git a/src/Squit.package/SquitFeedback.class/instance/buildInputFields..st b/src/Squit.package/SquitFeedback.class/instance/buildInputFields..st index be6d88f38..7267a24a7 100644 --- a/src/Squit.package/SquitFeedback.class/instance/buildInputFields..st +++ b/src/Squit.package/SquitFeedback.class/instance/buildInputFields..st @@ -4,24 +4,27 @@ buildInputFields: builder builder pluggableInputFieldSpec new model: self; getText: #actionTitle; - editText: #actionTitle:; setText: #actionTitle:; help: 'A feedback title...'; frame: (LayoutFrame new topFraction: 0; bottomFraction: 0 offset: self inputFieldHeight; - leftFraction: 0; rightFraction: 1). + leftFraction: 0; rightFraction: 1); + yourself. builder pluggableTextSpec new model: self; getText: #actionMessage; - editText: #actionMessage:; setText: #actionMessage:; help: 'A message explaining your issue/suggestion in detail...'; softLineWrap: true; frame: (LayoutFrame new topFraction: 0 offset: self inputFieldHeight; bottomFraction: 1 offset: self inputFieldHeight negated; - leftFraction: 0; rightFraction: 1). + leftFraction: 0; rightFraction: 1); + in: [:textSpec | + (textSpec respondsTo: #plainTextOnly:) ifTrue: ">= Squeak 6.0" + [textSpec plainTextOnly: true]]; + yourself. builder pluggableInputFieldSpec new model: self; getText: #actionAuthor; @@ -31,5 +34,6 @@ buildInputFields: builder frame: (LayoutFrame new topFraction: 1 offset: self inputFieldHeight negated; bottomFraction: 1; - leftFraction: 0; rightFraction: 1). + leftFraction: 0; rightFraction: 1); + yourself. } \ No newline at end of file diff --git a/src/Squit.package/SquitFeedback.class/methodProperties.json b/src/Squit.package/SquitFeedback.class/methodProperties.json index 15ecd145d..f91201dde 100644 --- a/src/Squit.package/SquitFeedback.class/methodProperties.json +++ b/src/Squit.package/SquitFeedback.class/methodProperties.json @@ -9,11 +9,11 @@ "actionCancel" : "fn 4/13/2017 13:27", "actionMessage" : "fn 4/13/2017 13:38", "actionMessage:" : "fn 4/13/2017 13:38", - "actionSubmit" : "jr 7/24/2020 10:16", + "actionSubmit" : "ct 6/17/2022 19:52", "actionTitle" : "fn 4/13/2017 13:38", "actionTitle:" : "fn 4/13/2017 13:38", "buildButtons:" : "fn 4/13/2017 13:27", - "buildInputFields:" : "jr 2/17/2022 23:17", + "buildInputFields:" : "ct 6/17/2022 20:07", "buildWith:" : "jr 1/13/2022 20:54", "close" : "fn 4/13/2017 13:27", "inputFieldHeight" : "jr 2/20/2022 11:26", diff --git a/src/Squot.package/SquotSaveVersionDialog.class/instance/message..st b/src/Squot.package/SquotSaveVersionDialog.class/instance/message..st index b85ef2159..78e9bdf08 100644 --- a/src/Squot.package/SquotSaveVersionDialog.class/instance/message..st +++ b/src/Squot.package/SquotSaveVersionDialog.class/instance/message..st @@ -1,4 +1,5 @@ accessing message: anObject - message := anObject \ No newline at end of file + message := anObject. + ^ true \ No newline at end of file diff --git a/src/Squot.package/SquotSaveVersionDialog.class/instance/okToRevertChanges..st b/src/Squot.package/SquotSaveVersionDialog.class/instance/okToRevertChanges..st new file mode 100644 index 000000000..3bebd9c5a --- /dev/null +++ b/src/Squot.package/SquotSaveVersionDialog.class/instance/okToRevertChanges..st @@ -0,0 +1,5 @@ +ui toolbuilder +okToRevertChanges: aspect + + aspect = #message: ifTrue: [self message: self defaultMessage]. + ^ true \ No newline at end of file diff --git a/src/Squot.package/SquotSaveVersionDialog.class/instance/widgetSpecs..st b/src/Squot.package/SquotSaveVersionDialog.class/instance/widgetSpecs..st index 0e6e0a7eb..c4849ff7a 100644 --- a/src/Squot.package/SquotSaveVersionDialog.class/instance/widgetSpecs..st +++ b/src/Squot.package/SquotSaveVersionDialog.class/instance/widgetSpecs..st @@ -8,6 +8,9 @@ widgetSpecs: builder setText: #message:; editText: #message:; frame: (LayoutFrame fractions: (0@0.7 corner: 0.8@1) offsets: (0@0 corner: 0@(self buttonHeight negated))); + in: [:textSpec | + (textSpec respondsTo: #plainTextOnly:) ifTrue: ">= Squeak 6.0" + [textSpec plainTextOnly: true]]; yourself. self buildCoAuthorSelector: builder. self buildButtonBar: builder} \ No newline at end of file diff --git a/src/Squot.package/SquotSaveVersionDialog.class/methodProperties.json b/src/Squot.package/SquotSaveVersionDialog.class/methodProperties.json index 08af2de8a..46f6a874e 100644 --- a/src/Squot.package/SquotSaveVersionDialog.class/methodProperties.json +++ b/src/Squot.package/SquotSaveVersionDialog.class/methodProperties.json @@ -21,10 +21,11 @@ "initialize" : "jr 11/18/2018 00:50", "inspectOriginalArtifactCommandLabel" : "jr 11/18/2018 01:05", "message" : "jr 2/17/2017 17:03", - "message:" : "jr 2/17/2017 17:03", + "message:" : "ct 6/17/2022 19:56", "messageWasChanged" : "jr 11/17/2018 23:19", + "okToRevertChanges:" : "ct 6/17/2022 19:59", "parentVersions:" : "jr 2/17/2017 19:34", "toggleLoadSelectedNode" : "jr 10/4/2020 17:54", "updateMessageFromViews" : "jr 10/14/2018 01:30", - "widgetSpecs:" : "jr 12/22/2021 13:09", + "widgetSpecs:" : "ct 6/17/2022 19:59", "windowLabel" : "jr 11/18/2018 01:29" } } From 09e241516a1b70fe54b75d0645ad0330f659b9e7 Mon Sep 17 00:00:00 2001 From: Christoph Thiede Date: Thu, 8 Sep 2022 15:08:38 +0000 Subject: [PATCH 2/5] Once again, fix Squot merge errors --- .github/workflows/ci.yml | 2 +- LICENSE | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12248bb91..494da704d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - smalltalk: [ Squeak64-trunk, Squeak64-5.3, Squeak32-5.2 ] + smalltalk: [ Squeak64-trunk, Squeak64-6.0, Squeak64-5.3, Squeak32-5.2 ] exclude: - os: macos-latest smalltalk: Squeak32-5.2 # 32bit no longer supported on macOS diff --git a/LICENSE b/LICENSE index 1221e3cda..ea205eb92 100644 --- a/LICENSE +++ b/LICENSE @@ -1,10 +1,18 @@ This repository contains multiple packages: -- Squot, Squit, VersionControl, Pharo-compatibility come from here +- Squot, Squit, VersionControl come from here +- Pharo-compatibility was also initialized here, but consists mainly of code that was + copied and adapted from Pharo, in order to make FileSystem-Git run in Squeak. - FileSystem-Git and FileSystem (FS-*) are forks of packages originally hosted elsewhere. - Squot-CoAuthorsExtension was originally a separate project. The packages originating here are released under the MIT license as described below. +The code copied from Pharo in 2017 is released under the MIT license according to +https://github.com/pharo-project/pharo/blob/6.0.0/src/System-Support.package/SmalltalkImage.class/instance/licenseStringTemplate.st, +https://pharo.org/features, https://pharo.org/contribute (all last accessed 2022-07-10). +The adapations to Squeak included here are also released under the MIT license +as described below. + The original FileSystem-Git was released under the MIT license according to http://smalltalkhub.com/#!/~FileSystemGitDev/FileSystem-Git/ (last accessed 2019-02-15) and http://ss3.gemstone.com/ss/FileSystem-Git.html (last accessed 2019-02-15). @@ -16,15 +24,16 @@ http://www.squeaksource.com/fs.html (last accessed 2019-02-15). The additions and changes provided here are also released under the MIT license as described below. -=============================================================== -Squot, Squit, VersionControl, Pharo-compatibility packages, -Squot-CoAuthorsExtension, +===================================================================== +Squot, Squit, VersionControl, Squot-CoAuthorsExtension, changes and additions to FileSystem and FileSystem-Git packages -=============================================================== +and Squeak adaptations to the code in the Pharo-compatibility package +===================================================================== MIT License Copyright (c) 2017 Jakob Reschke, Software Architecture Group (Hasso Plattner Institute) +Copyright (c) 2017-2022 Contributors to the Squot project (see Git history) Copyright (c) 2019 Maximilian Stiede, Leon Bein (for the Squot-CoAuthorsExtension) Permission is hereby granted, free of charge, to any person obtaining a copy From 19460691f9dcc3ae4036b3ea870eb84ff4b424f4 Mon Sep 17 00:00:00 2001 From: Christoph Thiede Date: Thu, 8 Sep 2022 15:12:05 +0000 Subject: [PATCH 3/5] Once again, fix Squot merge errors --- src/Squit.package/SquitBrowser.class/methodProperties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Squit.package/SquitBrowser.class/methodProperties.json b/src/Squit.package/SquitBrowser.class/methodProperties.json index 88ced8073..6d158d4dd 100644 --- a/src/Squit.package/SquitBrowser.class/methodProperties.json +++ b/src/Squit.package/SquitBrowser.class/methodProperties.json @@ -2,7 +2,7 @@ "class" : { "defaultTitle" : "fn 4/11/2017 17:23", "initialize" : "jr 4/18/2018 21:28", - "initializeSelfUpdate" : "jr 4/18/2018 21:27", + "initializeSelfUpdate" : "jr 7/8/2022 21:05", "open" : "fn 4/11/2017 09:09", "registerInWorldMenu" : "jr 4/15/2017 13:34", "selfUpdate" : "jr 3/7/2020 00:09", From 45eedacc6afa4f5d5d37ad23a79bea37b3e55be4 Mon Sep 17 00:00:00 2001 From: Christoph Thiede Date: Thu, 8 Sep 2022 17:15:14 +0200 Subject: [PATCH 4/5] Fix: drafted commit message not updated after pressing cmd + l and re-opening the version saver --- .../SquotInteractiveSave.class/instance/chooseChanges.st | 7 ++----- .../SquotInteractiveSave.class/methodProperties.json | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Squot.package/SquotInteractiveSave.class/instance/chooseChanges.st b/src/Squot.package/SquotInteractiveSave.class/instance/chooseChanges.st index bcf7264f0..47b10773d 100644 --- a/src/Squot.package/SquotInteractiveSave.class/instance/chooseChanges.st +++ b/src/Squot.package/SquotInteractiveSave.class/instance/chooseChanges.st @@ -9,12 +9,9 @@ chooseChanges self message ifNotNil: [tool message: self message]. ^ (tool selectedChangesWithTitle: self title) then: [:ignored | - tool messageWasChanged - ifTrue: - [self workingCopy newVersionMessage: tool message asString]. + self workingCopy newVersionMessage: tool message asString. self message: tool message asString. tool selectedPatch] ifRejected: [:ignored | - tool messageWasChanged - ifTrue: [self workingCopy newVersionMessage: tool message asString]. + self workingCopy newVersionMessage: tool message asString. Promise new rejectWith: 'Save was cancelled'] \ No newline at end of file diff --git a/src/Squot.package/SquotInteractiveSave.class/methodProperties.json b/src/Squot.package/SquotInteractiveSave.class/methodProperties.json index bf0a8e428..30f0cb379 100644 --- a/src/Squot.package/SquotInteractiveSave.class/methodProperties.json +++ b/src/Squot.package/SquotInteractiveSave.class/methodProperties.json @@ -3,7 +3,7 @@ }, "instance" : { "applyToWorkingCopy" : "jr 3/9/2022 23:06", - "chooseChanges" : "jr 6/8/2020 21:21", + "chooseChanges" : "ct 9/8/2022 17:06", "confirmAdditionalParents" : "jr 3/9/2022 23:06", "validate" : "jr 11/19/2020 13:02", "validateForCherryPick" : "jr 11/19/2020 13:01" } } From bc66078e668ffd20db6c7612840c50e2c21be756 Mon Sep 17 00:00:00 2001 From: Christoph Thiede Date: Sun, 11 Sep 2022 19:06:18 +0000 Subject: [PATCH 5/5] Revert "Fix: drafted commit message not updated after pressing cmd + l and re-opening the version saver" This reverts commit 45eedacc6afa4f5d5d37ad23a79bea37b3e55be4. Turned out that there is little sense in restoring the placeholder text permanently. See: https://github.com/hpi-swa/Squot/pull/380#discussion_r967860268 --- .../SquotInteractiveSave.class/instance/chooseChanges.st | 7 +++++-- .../SquotInteractiveSave.class/methodProperties.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Squot.package/SquotInteractiveSave.class/instance/chooseChanges.st b/src/Squot.package/SquotInteractiveSave.class/instance/chooseChanges.st index 47b10773d..bcf7264f0 100644 --- a/src/Squot.package/SquotInteractiveSave.class/instance/chooseChanges.st +++ b/src/Squot.package/SquotInteractiveSave.class/instance/chooseChanges.st @@ -9,9 +9,12 @@ chooseChanges self message ifNotNil: [tool message: self message]. ^ (tool selectedChangesWithTitle: self title) then: [:ignored | - self workingCopy newVersionMessage: tool message asString. + tool messageWasChanged + ifTrue: + [self workingCopy newVersionMessage: tool message asString]. self message: tool message asString. tool selectedPatch] ifRejected: [:ignored | - self workingCopy newVersionMessage: tool message asString. + tool messageWasChanged + ifTrue: [self workingCopy newVersionMessage: tool message asString]. Promise new rejectWith: 'Save was cancelled'] \ No newline at end of file diff --git a/src/Squot.package/SquotInteractiveSave.class/methodProperties.json b/src/Squot.package/SquotInteractiveSave.class/methodProperties.json index 30f0cb379..bf0a8e428 100644 --- a/src/Squot.package/SquotInteractiveSave.class/methodProperties.json +++ b/src/Squot.package/SquotInteractiveSave.class/methodProperties.json @@ -3,7 +3,7 @@ }, "instance" : { "applyToWorkingCopy" : "jr 3/9/2022 23:06", - "chooseChanges" : "ct 9/8/2022 17:06", + "chooseChanges" : "jr 6/8/2020 21:21", "confirmAdditionalParents" : "jr 3/9/2022 23:06", "validate" : "jr 11/19/2020 13:02", "validateForCherryPick" : "jr 11/19/2020 13:01" } }