Add indicator for selected conversation in conversation list#86
Merged
gluonfield merged 3 commits intogluonfield:mainfrom Apr 29, 2024
Merged
Conversation
wzulfikar
commented
Apr 27, 2024
| ForEach(conversationGroup.conversations, id:\.self) { dailyConversation in | ||
| HStack { | ||
| Button(action: {onTap(dailyConversation)}) { | ||
| let isSelected = selectedConversation?.name == dailyConversation.name && selectedConversation?.createdAt == dailyConversation.createdAt |
Contributor
Author
There was a problem hiding this comment.
Conversation doesn't have a unique ID so I'm using combination of name and createdAt. Not sure if having this conditional logic in view is acceptable here, but since it's quite simple (IMO) I think it's fine to put here.
Contributor
Author
|
Wanted to open an issue to ask about this but looks like it might be straightforward changes. So I went ahead and created this PR to illustrate my question. Happy to address any feedbacks (or close if you have other plan). |
Owner
|
Hi @wzulfikar great idea! I have adjusted style a bit to match the vision of the app.
LGTM! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
selectedConversationtoConversationHistoryListViewto determine when to show the indicator.Before (no indicator for selected conversation):
Screen.Recording.2024-04-28.at.1.01.08.AM.mov
After (selected conversation has blue indicator):
enchanted-convo-indicator.mov.mp4
Why
When selecting other conversation from the list, I noticed I had difficulty figuring out what's the currently selected conversation. This PR adds a little indicator to the selected conversation.