Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing #selectedChest when selecting an item in the tree table view #34

Conversation

adri09070
Copy link
Collaborator

@adri09070 adri09070 commented Apr 23, 2024

Fixes #27 , #31, #28, #30, #25

Each commit fixes one issue, in the order above

…table presenter before raising an exception `#remove` was sent to nil
…unupdated table, with the tree table view as active presenter
…g` with the same `#variableName`  instead of the same key
…er, when the class has not fully been initialized
…Chest class via the class environment (Smalltalk globals) to hide thedependency to the Chest class
@adri09070 adri09070 added the bug Something isn't working label Apr 30, 2024
@adri09070
Copy link
Collaborator Author

adri09070 commented Apr 30, 2024

unrelated failing tests @StevenCostiou

…ger-extension-Remove-item-context-menu-entry-raises-an-exception-remove-was-sent-to-nil
Copy link
Member

@StevenCostiou StevenCostiou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are good, some comments that should be answered prior to merge.

src/BaselineOfChest/BaselineOfChest.class.st Outdated Show resolved Hide resolved
@@ -796,14 +797,15 @@ ChestTableWithContentPresenter >> removeAllChests [
{ #category : 'removing' }
ChestTableWithContentPresenter >> removeAllItemsFromSelectedChest [

| items |
| items chest |
self flag: 'to do with polymorphism'.

items := activePresenter == chestWithContentTreeTable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see clearly how the code works, it seems that seometimes the activePresenter can be nil (possibly a constraint from Spec?). However in one case (line 922) when testing if activePresenter == chestWithContentTreeTable there is a nil check over activePresenter first and in the other case (line 803) there is no nil check.

Shouldn't the nil check be also present line 803?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it on line 922 because #selectedChest is a method called by commands in their #canBeExecuted method and activePresenter is not initialized at that moment.

In line 922, this is ok, this method is called when the user clicks a button, which implies that the presenter is already initialized and that activePresenter is not nil

@StevenCostiou StevenCostiou merged commit 67c8b6f into pharo-spec:master May 6, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants