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

Feature/messaging #143

Open
wants to merge 69 commits into
base: feature/messaging
Choose a base branch
from

Conversation

frehelfer
Copy link
Contributor

@frehelfer frehelfer commented Apr 12, 2023

Overview of changes

  • Created ChatListScreen

    • It shows a List with all types of user's chats.
    • Fetches from local database only the messages needed to present.
    • If the user has no messages, it will display a noMessagesView.
    • Shows whether the message has already been read or not.
    • Update the unRead variable when the user advances in the navigation.
    • Has a button to sync messages with remote server.
  • Created MessageScreen

    • Shows all messages between user and admin.
    • Fetches from db the last 40 messages and as the user scroll up it loads more.
    • User can send new messages.
    • New messages are saved in local data base.
    • Text view container increases when the user types, after 5 lines it enable a scroll.
  • Created AnnounceScreen

    • Shows an announcement.
  • Created Survey Screen

    • Shows a survey with as many questions and choices as needed.
    • Can only answer once, after that, it’s hidden from the user.
    • If the user access the same account in another device the survey already answered will be hidden.

Screenshots (if applicable)

Simulator Screen Recording - iPhone 14 - 2023-08-18 at 10 21 43

Copy link
Collaborator

@AlexCornforth AlexCornforth left a comment

Choose a reason for hiding this comment

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

Thanks for your great work Fred, clear you put a lot of time and effort into this!

Left some comments to look at 🙏

TreeTracker/UI/Views/Notes/NotesViewController.swift Outdated Show resolved Hide resolved
TreeTracker/Resources/Localizable.strings Outdated Show resolved Hide resolved
TreeTracker/Resources/Localizable.strings Outdated Show resolved Hide resolved
TreeTracker/SwiftGen/Assets.swift Outdated Show resolved Hide resolved
TreeTracker/UI/Navigation/Home/HomeCoordinator.swift Outdated Show resolved Hide resolved
TreeTracker/UI/Navigation/Home/HomeCoordinator.swift Outdated Show resolved Hide resolved
Copy link

@nshutinicolas nshutinicolas left a comment

Choose a reason for hiding this comment

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

Hey @frehelfer, I just landed on this PR after a while and while I was not able to build the app to see this first hand, I left some personal Nit changes. And from the attached video, the buttons look quite big

All in all this was massive work mate.🎉

@@ -99,3 +100,25 @@
"Settings.PhotoQuality.Option.Medium.Info" = "Medium resolution, medium data usage.";
"Settings.PhotoQuality.Option.High.Title" = "High";
"Settings.PhotoQuality.Option.High.Info" = "High resolution, high data usage.";

//ChatList Screen
"ChatList.SyncMessages.normal.Title" = "Sync Messages";

Choose a reason for hiding this comment

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

Nit

Suggested change
"ChatList.SyncMessages.normal.Title" = "Sync Messages";
"ChatList.SyncMessages.normal.Title" = "Update Messages";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @nshutinicolas, thank you for your review!

The only way to sync the messages, both fetch and send, is through this button, so I used the word "sync" to emphasize that the messages will be brought into alignment between the user's device and the remote server, I don't know if the word "update" has the same meaning.

As English is not my main language, I don't know which one would be more suitable for this situation. What do you think?

Choose a reason for hiding this comment

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

As a dev the action is sync but as a user, they understand Refresh or update.

//ChatList Screen
"ChatList.SyncMessages.normal.Title" = "Sync Messages";
"ChatList.SyncMessages.loading.Title" = "Loading...";
"ChatList.LastSyncLabel.WithouDate.Text" = "Please, tap the button above to sync messages.";

Choose a reason for hiding this comment

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

Nit

Suggested change
"ChatList.LastSyncLabel.WithouDate.Text" = "Please, tap the button above to sync messages.";
"ChatList.LastSyncLabel.WithouDate.Text" = "Please, tap the button above to update messages.";

"ChatList.SyncMessages.normal.Title" = "Sync Messages";
"ChatList.SyncMessages.loading.Title" = "Loading...";
"ChatList.LastSyncLabel.WithouDate.Text" = "Please, tap the button above to sync messages.";
"ChatList.LastSyncLabel.WithDate.Text" = "Last sync time:";

Choose a reason for hiding this comment

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

Suggested change
"ChatList.LastSyncLabel.WithDate.Text" = "Last sync time:";
"ChatList.LastSyncLabel.WithDate.Text" = "Last updated:";


//Messages Screen
"Messages.Title" = "Admin";
"Messages.InputTextView.PlaceHolder" = "Click to write a message";

Choose a reason for hiding this comment

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

I always felt like click is a web term🤷🏿‍♂️. Personal preference would be Start conversation, send a message or new message

Comment on lines +72 to +77
} else if isHighlighted {
backgroundColor = Asset.Colors.secondaryOrangeDark.color
tintColor = .white
} else {
backgroundColor = Asset.Colors.secondaryOrangeLight.color
tintColor = .white

Choose a reason for hiding this comment

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

Since isEnabled and isHighlighted are different, you can put them in separate conditional statements
something like

if !isEnabled {
    ...
}

if isHighlighted {
    ...
} else {
    ...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great! I'll make this change

// TODO: Change the button icon
sendMessageButton.titleLabel?.font = FontFamily.Montserrat.bold.font(size: 30)
sendMessageButton.backgroundColor = Asset.Colors.primaryGreen.color
sendMessageButton.setTitle(">", for: .normal)
Copy link

@nshutinicolas nshutinicolas Aug 21, 2023

Choose a reason for hiding this comment

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

You can use SFSymbols or asset instead of this

Sorry just seen the todo on top

# Conflicts:
#	TreeTracker.xcodeproj/project.pbxproj
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.

3 participants