Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

[NEW] Support autocompletion in new composer #2224

Merged

Conversation

cardoso
Copy link
Collaborator

@cardoso cardoso commented Sep 28, 2018

@RocketChat/ios

I had to refactor AvatarView to be programmatic so it can work with UserHintCell

@cardoso cardoso changed the title [WIP][NEW] Support autocompletion in new composerFeat/autocomplete new composer [WIP][NEW] Support autocompletion in new composer Sep 28, 2018
@codecov
Copy link

codecov bot commented Sep 29, 2018

Codecov Report

Merging #2224 into feature/integrate-rc-view-controller will increase coverage by 0.27%.
The diff coverage is 27.43%.

Impacted file tree graph

@@                           Coverage Diff                            @@
##           feature/integrate-rc-view-controller    #2224      +/-   ##
========================================================================
+ Coverage                                 27.83%   28.11%   +0.27%     
========================================================================
  Files                                       402      405       +3     
  Lines                                     15030    15186     +156     
========================================================================
+ Hits                                       4184     4269      +85     
- Misses                                    10846    10917      +71
Impacted Files Coverage Δ
...iews/Cells/Subscription/BaseSubscriptionCell.swift 0% <ø> (ø) ⬆️
...Chat/Controllers/Chat/MessagesViewController.swift 48.83% <ø> (ø) ⬆️
...cket.Chat/Controllers/Chat/MessagesViewModel.swift 54.23% <ø> (ø) ⬆️
...ocket.Chat/Views/Cells/Chat/AutocompleteCell.swift 0% <0%> (ø)
Rocket.Chat/Views/Cells/Chat/ChatMessageCell.swift 0% <0%> (ø) ⬆️
Rocket.Chat/Views/Cells/Chat/Info/MemberCell.swift 0% <0%> (ø) ⬆️
...at/Views/Cells/Chat/Info/ChannelInfoUserCell.swift 0% <0%> (ø)
...t/Views/Chat/New Chat/Cells/BasicMessageCell.swift 0% <0%> (ø) ⬆️
...t/Controllers/Chat/MessagesComposerViewModel.swift 0% <0%> (ø)
...Views/Cells/Chat/ChatDirectMessageHeaderCell.swift 0% <0%> (ø) ⬆️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 850bbac...f3e9d69. Read the comment docs.

@cardoso cardoso changed the title [WIP][NEW] Support autocompletion in new composer [NEW] Support autocompletion in new composer Sep 29, 2018
Copy link
Contributor

@rafaelks rafaelks left a comment

Choose a reason for hiding this comment

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

Nice one @cardoso! The tests are failing for this changes (I believe is because of the refactor you did on the AvatarView). Also, added one suggestion about splitting the code in another view model just for the hints... let me know what you think please! 👍

emojis.forEach {
viewModel.hints.append($0.suggestion)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about moving this method to the view model as well? Maybe we can have one view model just for the hints? 🤔

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 saw that you guys are doing this pattern, so I did the same. I created a MessageComposerViewModel and put this logic there 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

}

// MARK: Themeable

extension AvatarView {
override func applyTheme() {
labelInitials?.textColor = .white
labelInitials.textColor = .white
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

👌

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe you need to call super here... don't you?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not needed in this particular case I think, but I can do it for consistency.

@rafaelks rafaelks added this to the 3.2.0 milestone Oct 1, 2018
@rafaelks rafaelks merged commit 9f796eb into feature/integrate-rc-view-controller Oct 2, 2018
@rafaelks rafaelks deleted the feat/autocomplete_new_composer branch October 2, 2018 20:47
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants