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

feat: [IOCOM-1413] Archiving/Restoring of user messages, new Messages Home #5935

Merged
merged 52 commits into from
Jul 9, 2024

Conversation

Vangaorth
Copy link
Contributor

@Vangaorth Vangaorth commented Jul 5, 2024

⚠️ This PR depends on #5912 ⚠️

Short description

This PR adds the support for archiving and restoring of user messages, in the new messages home.

iOS Android
AR_iOS.mp4
AR_android.mov

Please note that the toast showing "Annullato" has been removed.

List of changes proposed in this pull request

New archiving/restoring UI and UX. In order to both fix previous problems and not change a complex business logic, this PR builds above the latter, keeping the compatibility with the old system (the algorithm is explained in ts/features/messages/saga/handleUpsertMessageStatusAttributes.ts)

  • actions and reducer. The feature is implemented with three states:
    • "disabled" | "enabled": the latter displays the bottom CTAs and allows to select messages for archiving/restoring
    • "processing": the system is busy processing the asynchronous archiving/restoring of messages

Messages are enqueued by Id while in the "enabled" state and processed one at a time while in "processing" state, in order to properly handle whatever failure may happen. It also supports cancellation by the user. If at any moment an error or a cancellation happens, the processing is suspended, the user is notified but she can later resume it.

  • ArchiveRestoreBar is the component that displays the bottom CTAs for archiving/restoring

Since the bottom bar is hidden while picking messages or processing them, there are some application entry points that have been disabled, in order not to trigger a flow that may later bring back to another main screen without the bottom bar. Such flows are deep link following, push notification tapping, message reloading and next page loading during processing, first message page loading and message search.

How to test

Using the io-dev-api-server, make sure to enable both DS and new messages home. Long tap (and later tap) on some messages and try the archiving/restoring/cancelling.

@@ -122,6 +124,17 @@ export function* handlePendingMessageStateIfAllowedSaga(
yield* call(navigateToMainNavigatorAction);
}

// It the archiving/restoring of messages is not disable, make
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
// It the archiving/restoring of messages is not disable, make
// If the archiving/restoring of messages is not disabled, make

small typo ;p

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Corrected

Copy link
Contributor

@forrest57 forrest57 left a comment

Choose a reason for hiding this comment

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

LGTM, tested on both android and iOS

@Vangaorth Vangaorth merged commit b41b36e into master Jul 9, 2024
13 checks passed
@Vangaorth Vangaorth deleted the IOCOM-1413_archive branch July 9, 2024 14:12
Vangaorth added a commit that referenced this pull request Jul 15, 2024
⚠️ This PR depends on #5935 ⚠️

## Short description
This PR implements the new messages local search.

|iOS<br/>Soft keyboard|Android<br/>Hardware keyboard|
|-|-|
|<video
src="https://github.com/pagopa/io-app/assets/5150343/732e7561-9b81-4f6e-85b4-20a352625f70"/>|<video
src="https://github.com/pagopa/io-app/assets/5150343/a886421f-3cb1-48ef-989c-2eed645b5139"/>|

**_Please note_** that the extra horizontal padding (on list items and
dividers) shown in the video above has been removed.

## List of changes proposed in this pull request
- New screen with messages search
- New cached selector for message search

## How to test
Using the io-dev-api-server, generate some messages, make sure to enable
the new DS and the new Messages Home and tap the search lens.

---------

Co-authored-by: Martino Cesari Tomba <60693085+forrest57@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants