Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Aug 13, 2025

Closes #6846
Closes #6852

Why is this the best possible solution? Were any other approaches considered?

According to our discussions, the new confirmation dialog will be a better solution, and allowing project deletion even when there are unsent forms will also be an improvement.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

We need to test deleting projects to ensure the new confirmation dialog works as expected and that projects are correctly deleted when the user confirms.

Do we need any specific form for testing your changes? If so, please attach one.

No.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@grzesiek2010 grzesiek2010 changed the title Add project summary to the delete project dialog Rework the delete project dialog Aug 25, 2025
@grzesiek2010 grzesiek2010 requested a review from seadowg August 25, 2025 22:30
@grzesiek2010 grzesiek2010 marked this pull request as ready for review August 25, 2025 22:30
Copy link
Member

@seadowg seadowg left a comment

Choose a reason for hiding this comment

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

Just some initial high level comments before diving any deeper

import org.odk.collect.async.Scheduler

class DeleteProjectDialog(
private val projectDeleter: ProjectDeleter,
Copy link
Member

Choose a reason for hiding this comment

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

We should definitely flip the relationship between ProjectDeleter and ProjectsDataService - the former should be used by the latter. I don't want to hold this PR up, but could that be done as a follow-up change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I will do that in a follow-up pr.

@dbemke
Copy link

dbemke commented Sep 3, 2025

Should deleting a project be blocked while forms are being sent?

@grzesiek2010
Copy link
Member Author

Should deleting a project be blocked while forms are being sent?

A user would see that there are x forms unsent before right? If so, and they decide to delete the project, it doesn't matter if the forms are being sent or not. That's what we briefly discussed here #6853 (comment)

@grzesiek2010
Copy link
Member Author

Should tapping beyond the delete project dialog close the dialog?

I think that’s fine. The projects dialog in the main menu works the same way, and they are similar - they both display information and let you perform actions, but if you don’t, nothing bad happens.

@grzesiek2010
Copy link
Member Author

Is it ok that delete (space at the beginning) allows to delete a project?

Yes, the text is trimmed and case-insensitive, so it can be any variation of delete, with or without surrounding whitespace.

@grzesiek2010
Copy link
Member Author

Can you list what is included in each category (form definitions, sent, unsent, drafts) as an expected result e.g. form definitions - blank forms + their versions in the device or just the newest version?

Form Definitions - all forms (not only the latest versions)
Sent - forms successfully sent (unlike in the main menu, where the sent count includes both successful and failed attempts)
Unsent - forms ready to be sent (either finalized or previously attempted to send but failed)
Drafts - editable forms (not yet finalized)

@grzesiek2010
Copy link
Member Author

Should deleted sent forms count as sent forms in delete project dialog?

I think it is ok. @seadowg, please comment if you disagree.

@grzesiek2010
Copy link
Member Author

There is a crash after rotating device, while delete project dialog is open.

Fixed.

@grzesiek2010
Copy link
Member Author

There is incorrect grammar in delete project dialog info "you will be permanently delete"

Fixed.

@grzesiek2010
Copy link
Member Author

Should the long project name be scrollable in the Delete project dialog instead of showing/hiding the full name?

No. it should take one line, like in the settings dialog 9in the main menu. for example. Fixed.

@dbemke
Copy link

dbemke commented Sep 3, 2025

Soft-deleted forms (there's a draft of the form but the blank form was deleted) are visible in "Form definitions" - is it ok?

@grzesiek2010
Copy link
Member Author

Soft-deleted forms (there's a draft of the form but the blank form was deleted) are visible in "Form definitions" - is it ok?

I think I would fix that. It should ignore soft-deleted forms now.

@srujner
Copy link

srujner commented Sep 3, 2025

1.When the dark theme is set, the text on the red “Delete Project” button is barely visible (Trust me it looks worse on mobile)
2. Project text in the “Delete project” button should be capitalized
3. Text in the text field is not center aligned and just looks strange

Screenshot_20250902_145048_ODK Collect

@srujner
Copy link

srujner commented Sep 3, 2025

The device keyboard covers the “Delete Project” button

Screenshot_20250903_130856_ODK Collect

@dbemke
Copy link

dbemke commented Sep 3, 2025

Should the main body (text) be also moved to the right when an RTL is set in Collect (before translations are introduced)?
RTLdeleteProject

@grzesiek2010
Copy link
Member Author

Should the main body (text) be also moved to the right when an RTL is set in Collect (before translations are introduced)?

No. The longer string is not reversed because it starts with left-to-right text, so Android treats the whole block as LTR even in an RTL layout. Short simple strings like 'Delete Demo project' can still appear on the right (despite the fact it is also LTR text), but longer ones keep their LTR base direction. That’s how Android works.

@grzesiek2010
Copy link
Member Author

The device keyboard covers the “Delete Project” button

It depends on the screen size, but I think that’s fine for a dialog like this. We’d need to shorten the message to save space and ensure the button is visible. I don’t think it’s worth the effort right now. @alyblenkin if you think it is important to address, please file a separate issue.

@grzesiek2010
Copy link
Member Author

Project text in the “Delete project” button should be capitalized

It shouldn't. Sentence case (only the first word and proper nouns start with a capital letter) is recommended by Material Design.

@grzesiek2010
Copy link
Member Author

Text in the text field is not center aligned and just looks strange

Fixed.

@grzesiek2010
Copy link
Member Author

1.When the dark theme is set, the text on the red “Delete Project” button is barely visible (Trust me it looks worse on mobile)

Fixed.

@dbemke
Copy link

dbemke commented Sep 4, 2025

Tested with Success!

Verified on Android 10 (Dominika), 14 (Szymon), 16 (Wiktor)

Verified cases:

  • entering different values in the text field
  • project with a long name
  • deleting a project when a duplicate one exists
  • deleting a project when there’s only 1 project
  • deleting a project when there are more projects
  • adding the same project after deleting
  • deleting a project with a draft
  • deleting a project with a draft with a removed blank form
  • deleting a project with a finalized form
  • deleting a project with a finalized form which has an edit of the form
  • deleting a project with a sent form
  • deleting a project with “sending failed” status
  • deleting a project without any forms
  • deleting a project with deleted forms
  • deleting a project with an offline entity (not sent)
  • deleting a project with different form versions of blank form
  • deleting a project after resetting, reconfiguring a project (with forms changed and not)
  • deleting a project with set admin password
  • hide old versions setting
  • deleting ONA project
  • deleting a big project: many blank forms and many instances (drafts and finalized)
  • deleting a project while forms are being sent
  • deleting the Draft project
  • deleting an encrypted project
  • deleting project with unicode characters and symbols in the name of the project
  • deleting project in which form has an instance name defined in the form
  • rotating, minimizing, RTL

@grzesiek2010 grzesiek2010 merged commit 85ceddf into getodk:master Sep 4, 2025
6 checks passed
@alyblenkin
Copy link
Collaborator

It depends on the screen size, but I think that’s fine for a dialog like this. We’d need to shorten the message to save space and ensure the button is visible. I don’t think it’s worth the effort right now. @alyblenkin if you think it is important to address, please file a separate issue.

Agreed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

behavior verified high priority Should be looked at before other PRs/issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Always show the new confirmation dialog when deleting a project Adding project summary to the delete project dialog

6 participants