-
Notifications
You must be signed in to change notification settings - Fork 117
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
Subscribed tab feed improvements 20240514 #9289
Subscribed tab feed improvements 20240514 #9289
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.
With a really quick review with only the few minutes I have tonight this looks like ok changes to the EA Forum. Will check more tomorrow if you don't merge before then.
@@ -28,15 +31,23 @@ const styles = (_theme: ThemeType) => ({ | |||
*/ | |||
const UserNotifyDropdown = ({ | |||
user, | |||
isFriendlyUI=true, |
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.
isFriendlyUI=true, |
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.
This isn't the idomatic way to do this.
classes, | ||
}: { | ||
user: UsersProfile, | ||
isFriendlyUI?: boolean, |
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.
isFriendlyUI?: boolean, |
@@ -1,6 +1,9 @@ | |||
import React, { useCallback, useRef, useState } from 'react'; | |||
import { Components, registerComponent } from '../../lib/vulcan-lib'; | |||
import { useTracking } from '../../lib/analyticsEvents'; | |||
import { userHasSubscribeTabFeed } from '../../lib/betas'; | |||
import { useCurrentUser } from '../common/withUser'; | |||
import { PopperPlacementType } from '@material-ui/core/Popper/Popper'; |
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.
import { PopperPlacementType } from '@material-ui/core/Popper/Popper'; | |
import { PopperPlacementType } from '@material-ui/core/Popper/Popper'; | |
import { isFriendlyUI } from '../../themes/forumTheme'; |
I'm getting a flash of a loading spinner where I didn't before on our |
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.
No further comments
This is the element I most wanted feedback on. When I first tried the component, I got a loading spinner even though I wasn't seeing one when using the component live on EA Forum. My changes were to try to make the loading spinner look a little better than how it was before. I don't think I did anything to change whether or not there is a loading spinner. Maybe it's just faster in prod so it doesn't show there? |
); | ||
|
||
return ( | ||
<DropdownItem | ||
title={title} | ||
onClick={toggleSubscribed} | ||
afterIcon={afterIcon} | ||
loading={loading} |
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.
This could be the loading spinner change
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.
Ah, makes sense. So you say above "getting a flash of loading spinner" – do you want me to forum gate changes that cause this?
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 so? I haven't thought about what's going on too deeply, it could be that the loading spinner is "correct."
@@ -51,12 +51,12 @@ const ContentItemTruncated = ({classes, maxLengthWords, graceWords=20, expanded= | |||
</> | |||
} | |||
|
|||
const truncateWithGrace = (html: string, maxLengthWords: number, graceWords: number, rawWordCount: number): { | |||
export const truncateWithGrace = (html: string, maxLengthWords: number, graceWords: number, rawWordCount: number, suffix?: string): { |
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.
Docstring
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.
Recommend moving this to the same file as truncate comes from.
classes, | ||
}: NotifyMeToggleDropdownItemInternalProps) => { | ||
const {isSubscribed, onSubscribe} = useNotifyMe({ | ||
const {isSubscribed, onSubscribe, loading, disabled } = useNotifyMe({ |
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.
nit: spacing
|
||
return <ToggleSwitch value={subscribed} className={classes.toggle} smallVersion /> | ||
}, | ||
[subscribed, useCheckboxIcon, ToggleSwitch, classes.toggle ], |
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.
nit: spacing
TruncatedAuthorsList, PostsItemDate, ForumIcon, LWTooltip, EventTime, FormatDate | ||
} = Components; | ||
|
||
// TODO: Think about styling for events |
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.
does this TODO need something?
const authorsListElement = <InteractionWrapper className={classes.interactionWrapper}> | ||
<TruncatedAuthorsList | ||
post={post} | ||
expandContainer={authorExpandContainer} | ||
className={classes.authorsList} | ||
/> | ||
{separatorElement} | ||
</InteractionWrapper> |
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.
something about the indentation here looks weird
|
||
const styles = (theme: ThemeType) => ({ | ||
root: { | ||
|
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.
nit: newline
root: { | ||
|
||
'& .read-more-button': { | ||
// color: theme.palette.primary.main, |
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.
cleanup
marginBottom: 10, | ||
}, | ||
highlightContinue: { | ||
marginTop:theme.spacing.unit*2, |
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.
missing space after :
expandedDocument?: PostsExpandedHighlight, | ||
classes: ClassesType, | ||
}) => { | ||
const { htmlHighlight = "", wordCount = 0 } = post.contents || {}; |
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.
prefer ??
@jpaddison3 @oetherington I'm making use of the
UserNotifyDropdown
and have changed it in a few ways that plausibly affect EAF (maybe for the better). (1) I piped through existing loading and disabled props from useNotify, (2) I changed the loading spinner to encompass the full contents of the menu items because otherwise, it looked really janky. You might want to check out the branch to check everything is still how you like it