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

IDE-68 Undo functionality in backpack #4993

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

p0dlunsek
Copy link
Contributor

@p0dlunsek p0dlunsek commented May 30, 2024

  • Implemented an Undo function in the backpack feature.
  • The Undo symbol appears when an item is deleted from the backpack.
  • The Undo function is limited to one action; once the Undo button is pressed, it disappears.
  • The Undo option is not available again if the backpack is exited until another change is made.
  • Introduced a new test class, BackpackUndoTest, to ensure the correctness of the Undo functionality.
  • Updated the view logic to handle the visibility of the Undo button based on user actions.

https://catrobat.atlassian.net/browse/IDE-68

Your checklist for this pull request

Please review the contributing guidelines and wiki pages of this repository.

  • Include the name of the Jira ticket in the PR’s title
  • Include a summary of the changes plus the relevant context
  • Choose the proper base branch (develop)
  • Confirm that the changes follow the project’s coding guidelines
  • Verify that the changes generate no compiler or linter warnings
  • Perform a self-review of the changes
  • Verify to commit no other files than the intentionally changed ones
  • Include reasonable and readable tests verifying the added or changed behavior
  • Confirm that new and existing unit tests pass locally
  • Check that the commits’ message style matches the project’s guideline
  • Stick to the project’s gitflow workflow
  • Verify that your changes do not have any conflicts with the base branch
  • After the PR, verify that all CI checks have passed
  • Post a message in the catroid-stage or catroid-ide Slack channel and ask for a code reviewer

@p0dlunsek p0dlunsek force-pushed the IDE-68 branch 2 times, most recently from 86f924a to 004a9e2 Compare July 10, 2024 20:57
Comment on lines 191 to 198
var exceptionOccurred = false

try {
onView(withId(R.id.menu_undo)).perform(ViewActions.click())
} catch (e: androidx.test.espresso.NoMatchingViewException) {
exceptionOccurred = true
}
assert(exceptionOccurred)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
var exceptionOccurred = false
try {
onView(withId(R.id.menu_undo)).perform(ViewActions.click())
} catch (e: androidx.test.espresso.NoMatchingViewException) {
exceptionOccurred = true
}
assert(exceptionOccurred)
onView(withId(R.id.menu_undo)).check(matches(not(isDisplayed())))

Comment on lines 224 to 231
var exceptionOccurred = false

try {
onView(withId(R.id.menu_undo)).perform(ViewActions.click())
} catch (e: androidx.test.espresso.NoMatchingViewException) {
exceptionOccurred = true
}
assert(exceptionOccurred)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
var exceptionOccurred = false
try {
onView(withId(R.id.menu_undo)).perform(ViewActions.click())
} catch (e: androidx.test.espresso.NoMatchingViewException) {
exceptionOccurred = true
}
assert(exceptionOccurred)
onView(withId(R.id.menu_undo)).check(matches(not(isDisplayed())))

Comment on lines 261 to 268
var exceptionOccurred = false

try {
onView(withId(R.id.menu_undo)).perform(ViewActions.click())
} catch (e: androidx.test.espresso.NoMatchingViewException) {
exceptionOccurred = true
}
assert(exceptionOccurred)
Copy link
Contributor

Choose a reason for hiding this comment

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

the same as above

Comment on lines 294 to 301
var exceptionOccurred = false

try {
onView(withId(R.id.menu_undo)).perform(ViewActions.click())
} catch (e: androidx.test.espresso.NoMatchingViewException) {
exceptionOccurred = true
}
assert(exceptionOccurred)
Copy link
Contributor

Choose a reason for hiding this comment

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

also here

@p0dlunsek p0dlunsek changed the title IDE-68 Added undo button to the backpack (limited to one revert) IDE-68 Undo functionality in backpack Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants