-
Notifications
You must be signed in to change notification settings - Fork 14
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
show follow notification in tab #1727
Conversation
👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Itunu, the code looks good to me! There are a couple minor issues I noticed, and some of them are design related. I'm ok to merge and ship this as-is, and we can address these in future PRs.
The first is that I think it would look a lot better to have "Follows" and "Out of Network" centered between "In Network", rather than having them pushed to the edge. This is only an issue on mac/ipad. Also I think it would be good if their tap targets covered the full height of the bar, instead of just the height of the text.
- This is totally a design thing, but I wish the default tab was "in network", not "Follows". Personally I think I'll be looking at "In Network" the most, "Out of Network" the second-most, and "Follows" the least. What do you think? We could ask about making a change if you also care.
- I don't like that the badge count is cleared as soon as I tap the notifications tab, even if I haven't viewed all the notifications. We could only mark the visible notifications as read. Again, not a blocker.
@@ -406,4 +406,11 @@ import Logger | |||
// Publish the modified list | |||
await currentUser.publishMuteList(keys: Array(Set(mutedList))) | |||
} | |||
|
|||
/// Returns true if this event tagged the given author. | |||
func this(author: Author) -> Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this name should be a little more descriptive. If I just saw it at the call site like authorA.this(author: authorB)
I would probably guess that it was some sort of equality check. The comment is confusing me too, because it says "if this event tagged" but this is a function on Author, so what event are we talking about?
@@ -96,7 +97,90 @@ extension Event { | |||
|
|||
return fetchRequest | |||
} | |||
|
|||
|
|||
/// A request for all out-Of-Network events that the given user should receive. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// A request for all out-Of-Network events that the given user should receive. | |
/// A request for all out-Of-Network events that the given user should be shown a notification for. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant to click approve on the last one 🙃
Thanks for your feedbacks @mplorentz. The first point is a bother for me too, thanks for pointing it out. @Chardot what do you think? For the UI change, I can throw a quick jab at it and see if the change can go with this PR. |
I agree with @mplorentz's observations about In Network being the default tab on this screen (in fact, that's how I designed it in the first place, but it got changed to Follow). As discussed with @pelumy today, we decided to make In Network the default tab, while keeping its position in the center to comply with the design that Linda referenced in the ticket, and we can modify the tab bar in a future iteration. Also agree that the tap surface should cover the full height of the tab bar. One thing we discussed with @pelumy is how tabs should be spaced between and also centered in the tab bar so that in larger windows on iPads and desktop, the tabs don't get too separated across the screen. We decided to wrap the tabs with a centered container that keeps a maximum width just like the one @martindsq added in the profile view and Feed so that the note cards don't stretch to the full width of the window. To illustrate how tabs are spaced between, here's an image I made in Figma: |
@pelumy the Mac/iPad screenshot you posted doesn't seem to follow the "space around" spacing that Sebastian described. Is that something you were intending to include in this PR or to add somewhere else? |
@mplorentz , it has been corrected. thanks for pointing it out: |
👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I'm still seeing one minor layout issue. The tab bar is not extending to the edges of the screen on my Mac. I think it is probably inside a container using .readabilityPadding()
, but that should only be used on the content.
…tary-social/nos into it/127-follow-notification
Thanks for catching that @mplorentz. The UI has been updated. |
This new failing test is not failing for me locally. I'm not sure what is wrong. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran the tests again and they passed. They also pass for me locally. Let's chalk it up to a random failure. Merge away!
Issues covered
127
P/S: This needs the backend to send follow notifications as a silent one and not an alert. This needs to be taken into consideration before merging.
Description
I wasn't expecting this PR to turn out this huge, but it did 😿. It contains the following changes:
NosNotification
entity needed a relationship with theEvent
entity.NosNotificationViewModel
andNotificationView
.NosNotification
and local notification for a silent follow notification.NosNotification
reference when anEvent
is deleted in theDatabaseCleaner
. Thanks for fixing this @mplorentz.NosNotification
andEvent
entities on launch based on aUserDefaults
flag.How to test
Screenshots/Video
Post screenshots or video showing your changes, ideally showing how the app worked before and after these changes. Delete this section if this PR contains no visual changes.
Notification tab view
Video showing follows notification, inNetwork and outOfNetwork.
https://github.com/user-attachments/assets/a08cab0c-0a66-4099-9b8c-3b31b3bee6eb
N/B: I updated the UI after making the video. The screenshot above is the correct UI.