Skip to content
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

Merged
merged 24 commits into from
May 23, 2024

Conversation

darkruby501
Copy link
Collaborator

@darkruby501 darkruby501 commented May 15, 2024

  • Persistently hide the "recommended users to subscribe to widget"
  • show all comments (no longer filtering on karma and word length)
  • Option to subscribe to user activity for feed in user profile (including one's activity own - not sure if right solution, but can try it with admins)
  • fix bug: doesn't skip posts when they don't have any comments
Ruby - LessWrong 2024-05-15 14-17-27

@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

@darkruby501 darkruby501 requested a review from a team as a code owner May 15, 2024 19:05
@darkruby501 darkruby501 requested review from jpaddison3 and removed request for a team May 15, 2024 19:05
@jpaddison3 jpaddison3 self-assigned this May 15, 2024
Copy link
Collaborator

@jpaddison3 jpaddison3 left a 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,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
isFriendlyUI=true,

Copy link
Collaborator

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,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
import { PopperPlacementType } from '@material-ui/core/Popper/Popper';
import { PopperPlacementType } from '@material-ui/core/Popper/Popper';
import { isFriendlyUI } from '../../themes/forumTheme';

@jpaddison3
Copy link
Collaborator

I'm getting a flash of a loading spinner where I didn't before on our UserNotifyDropdown

Copy link
Collaborator

@jpaddison3 jpaddison3 left a comment

Choose a reason for hiding this comment

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

No further comments

@jpaddison3 jpaddison3 removed their assignment May 17, 2024
@darkruby501
Copy link
Collaborator Author

@jpaddison3

I'm getting a flash of a loading spinner where I didn't before on our UserNotifyDropdown

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}
Copy link
Collaborator

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

Copy link
Collaborator Author

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?

Copy link
Collaborator

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): {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Docstring

Copy link
Collaborator

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({
Copy link
Collaborator

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 ],
Copy link
Collaborator

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
Copy link
Collaborator

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?

Comment on lines 135 to 142
const authorsListElement = <InteractionWrapper className={classes.interactionWrapper}>
<TruncatedAuthorsList
post={post}
expandContainer={authorExpandContainer}
className={classes.authorsList}
/>
{separatorElement}
</InteractionWrapper>
Copy link
Collaborator

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: {

Copy link
Collaborator

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,
Copy link
Collaborator

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,
Copy link
Collaborator

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 || {};
Copy link
Collaborator

Choose a reason for hiding this comment

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

prefer ??

@darkruby501 darkruby501 merged commit 5e66730 into master May 23, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants