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

Create dynamic lists from Explore page #436

Merged
merged 3 commits into from
Nov 17, 2019
Merged

Conversation

chrisbenincasa
Copy link
Owner

@chrisbenincasa chrisbenincasa commented Nov 16, 2019

Also: people search / filtering (on Explore page currently)

Screen Shot 2019-11-16 at 1 09 00 PM

Screen Shot 2019-11-16 at 1 09 12 PM

Screen Shot 2019-11-16 at 12 32 04 PM

Screen Shot 2019-11-14 at 6 45 41 PM

Copy link
Collaborator

@markdavella markdavella left a comment

Choose a reason for hiding this comment

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

This is fucking awesome and the screenshots look incredible!

Mostly nits and a couple updates

export const PEOPLE_FETCH_FAILED = 'people/fetch/FAILED';

export interface PeopleFetchInitiatedPayload {
ids: (Id | Slug)[];
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: in future we can just use a canonicalId type

<span>
{labels.map((label, idx, all) => {
return (
<React.Fragment key={extractLabel(label)}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just verify in console that you aren't getting Material UI errors here. I used a React Fragment in a MenuItem list and it said React Fragments were usable inside lists, but it may have been Menu specific.

fontSize: '1em',
}}
>
{listLength}
{listLength >= 100 ? '99+' : listLength}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like how this turned out! In the future we could do something where it's a number of "new" items for that smart list in a given period of time, otherwise I imagine most list that are a bit general will always be 99+

Copy link
Owner Author

Choose a reason for hiding this comment

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

most defffff - we'll have to keep track of some counts over time maybe? or maybe we can just estimate based on last view time or how recent items are?

{showPersonFilters
? people &&
people.map((person: string) =>
personNameBySlugOrId[person] ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you make this for the same issue we had for Popular? If so, should we go the same route and just use ID?

Copy link
Owner Author

Choose a reason for hiding this comment

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

yeah this can probably use ID... i forget why i used slugs lol. there's some other work that needs to be done here so i'll do this in a follow-up

{showResetDefaults ? (
<Chip
key="Reset_default"
className={classes.networkChip}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: we should think of a more generic class name

onInputChange={debouncedChange}
getOptionLabel={option => nameBySlugOrId[option]}
options={slugz}
filterOptions={opts => opts}
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this doing?

Copy link
Owner Author

Choose a reason for hiding this comment

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

this is some dumb shit in Autocomplete where it tries to filter down the choices based on what your input is... except that our backend is really doing the filtering, so we just want to present the options that are returned from the API without MUI trying to be smart

null,
mapDispatchToProps,
)(ItemCard);
export default connect(null, mapDispatchToProps)(ItemCard);
Copy link
Collaborator

Choose a reason for hiding this comment

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

lol, we def have different settings somewhere. I noticed my new machine has been formatting like the above and it looks like yours is correcting that. Did you update your line width locally? If so, maybe we update in prettier config?

Copy link
Owner Author

Choose a reason for hiding this comment

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

haha, i dont think i did - we have the prettier config checked into Git dont we? https://github.com/chrisbenincasa/teletracker/blob/master/web/.prettierrc

maybe we just need to define a width in there? is it possible we're using different versions that have different default widths? or maybe my intellij is being a piece of shit?

{!loading && items ? (
<InfiniteScroll
pageStart={0}
loadMore={() => this.loadMoreResults()}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can just use this.loadMoreResults here, otherwise it creates a new callback on every render, this is unavoidable if we are passing stuff into a callback but looks like we aren't here

Copy link
Owner Author

Choose a reason for hiding this comment

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

i have no fucking idea how this shit works

>
<Grid container spacing={2}>
{items.map((result, index) => {
let thing = thingsBySlug[result];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move to thingsById to match Popular setup

Copy link
Owner Author

Choose a reason for hiding this comment

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

Fixed

.filter(u => !_.isUndefined(u))
.map(u => u!)
.value();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

fucking classic christian

Copy link
Owner Author

Choose a reason for hiding this comment

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

lololol

Also: people search / filtering (on Explore page currently)
@chrisbenincasa chrisbenincasa merged commit 5e8fd33 into master Nov 17, 2019
chrisbenincasa added a commit that referenced this pull request Mar 18, 2020
Create dynamic lists from Explore page
@chrisbenincasa chrisbenincasa deleted the make-dynamic-lists branch March 18, 2020 23:38
chrisbenincasa added a commit that referenced this pull request Apr 30, 2024
Create dynamic lists from Explore page
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.

2 participants