Notifications improve links #6711
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#6711
Loading…
Reference in a new issue
No description provided.
Delete branch "notifications_click"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR Checklist
Please check all that apply to this PR using "x":
PR Type
What kind of change does this PR introduce?
Fixes
Issue Number: Closes #5095
What is the new behavior?
@ -69,0 +58,4 @@
<ChannelThumbnail small uri={channelUrl} />
</UriIndicator>
);
};
This one is probably not robust as it relies on how Commentron phrases the suggested title.
(e.g. will fail if phrasing changed to
"@@Welcome to my post@@" received a new comment from @mike
).It might be better to inspect
notification_parameters.dynamic
for the author, but you'll need to do it differently for each notification type that has a channel-mention. For example, the author for a comment-notification can be parsed fromnotification_parameters.dynamic.comment_author
.Aside: It is also possible to reconstruct the title ourselve from
notification_parameters
's info.device.title
is just Commentron's default.@jessopb, I believe this block is trying replace the channel name with something that's clickable. I recall this issue also affects livestream chat and maybe other places. Do you have a recommendation on how to address this issue in general?
The above breaks up the string. This will break any hopes of localizing the notifications page in the future.
Maybe something like how
LbcMessage
does the replacement will be a cleaner approach?But anyway, since Commentron doesn't support a i18n-friendly format yet, this solution is still better than current state.
@ -86,3 +83,4 @@
icon = creatorIcon(channelUrl);
break;
case RULE.DAILY_WATCH_AVAILABLE:
case RULE.DAILY_WATCH_REMIND:
I'm seeing missing avatars when I loaded the branch. Not sure which part of the code was causing it, but the issue goes away when I switch back to
master
.This crashes after bringing it out of the switch-case because not all notifications have
comment_author
Ooops, seems like this PR is still work-in-progress? Can put in "Draft" status.
CommentReactions
will show 0 reactions each time unless you've visited the comment before.One suggestion is to collect a list of comment IDs at one level up and fetch all reactions in one shot.
@ -69,0 +58,4 @@
<ChannelThumbnail small uri={channelUrl} />
</UriIndicator>
);
};
Or maybe something like this, which also fixes the i18n problem:
Thanks for adding this feature! It makes it possible to open all the new-video notifications in new tabs, and binge-watch them all.
Is this ready or are you still working on it @saltrafael?
I had messaged infinite-persistence to see the latest changes, then it just needs rebase and fix Reply !
The navlink only works when clicked on text. If you middle-click on empty areas, it doesn't work.
ClaimPreview
solves this by adding a wrapper to the blank areas.Not super critical -- can postpone.
@ -67,2 +55,2 @@
notificationLink += `?${urlParams.toString()}`;
const creatorIcon = (channelUrl) => {
return (
reaction.List
calls (see Network Tab in Dev Tools). The backend team will scold us again, lol.Suggestions:
[]
dependency list on theuseEffect
would work, assuming we have all the variables that we need on mount.Notification
level will create lots ofreaction.List
calls (1 for eachNotification
). It will be more efficient to do it atNotificationsPage
, since we have the full list comments to fetch for already. But we leave this up to you -- we can also make the change toNotificationsPage
at a later time when we see huge spikes inreaction.List
calls.@ -100,0 +103,4 @@
let channelName = channelUrl && '@' + channelUrl.split('@')[1].split('#')[0];
const notificationTitle = notification_parameters.device.title;
Feels like can be improved, but will pass for now so as not to stall the PR further.
With a little more work, I think we can avoid the unnecessary loop and also enable localization at the same time using something like the following (incomplete example). It'll also prevent the need to put a blanket
LbcMessage
for notifications that don't need it. We can also customize the phrase like adding quotes to the title for readability.@saltrafael if you've adjusted a PR in response to feedback, please click the icon to re-request a review (I just did this, so you won't see it)
When a "comment notification" is clicked, it navigates to the claim page but also reloads the site, causing the cache to be cleared and re-authenticated. Should avoid a reload if possible.
After leaving a comment reply directly from the notification component, the reply is not immediately visible. This will be confusing, and I think a toast wouldn't cut it either. I understand it is troublesome to place the reply component there with current code.
like this?
Only did some minor testing -- there are still issues. Also, as noted in the comments, I wonder if there's a better solution than to place "stop propagation" all over the place, and tweaking
form-field
needs more testing to ensure it doesn't break all clients.Handling the comment direct-reply and reaction seems tricky. Also, with an upcoming push "min-tips" push, we'll have to take more things into account.
When I click on a "XX commented on YY" notification, it now takes 2
Back
clicks to return to the notification page. Somewhere, it is double-pushing to the history.Separator lines are now missing
Yeah, something like that.
✔️ Ended "stop propagation" hell
I hid the support option from direct-reply which was causing the most issues, (also looked confusing, since replying to a comment sends a HyperChat to the content and not the reply). See if it's still needed to take it out
@saltrafael can you rebase and fix the conflict and we'll take another look soon.
Few more issues unfix/uncovered.
I'm still in favor of splitting out #5062 React/reply to comments from notifications into another PR so that we can ship your navigation link changes first.
The comment-replies doesn't seem straightforward to implement. YT does it by moving into a virtual "sub-page" that is basically a
CommentsList
-- I think that totally avoids all the issues and hacks that we've been trying to do in embedding theComment
component withinNotification
. But the sub-page is not trivial either.When I delete a comment in a regular content page, I now get this in the console:
This was previously reported, and is still happening. It auto jumps back.
When changing the active channel via "Set replying as", we'll need to re-fetch the reactions to get the right numbers (mine vs others). Currently, it resets to zero.
Second level reply is a bit weird. The GUI remains stuck at the following, with SuperChat appearing. When I pressed Cancel, I noticed a ton of comment was sent.
When I press the Creator Like (Heart), a medium-sized avatar gets stuck in the screen.
Not a blocker, but just wanted to note that it seems to always call
reaction.List
twice.Noticed this too, probably minor but should be fixed.
I ran into this but wasn't sure what happened - but now this makes sense.
That's a known bug on master - we should not be sending that notification to already approved users.
So that explains it 😅