Discovery #2
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
consider soon
dependencies
documentation
Epic
good first issue
hacktoberfest
help wanted
icebox
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-react-native#2
Loading…
Reference in a new issue
No description provided.
Delete branch "discovery"
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?
It doesn't look like this or the line below introduced these magic values so it's not mandatory to fix, but ideally they would not be used here.
I assume the above line means that some claims have a thumbnail property of
' '
or similar.Would it make sense to
trim
this value somewhere inlbry-redux
or elsewhere in the data model instead? Otherwise, this line would theoretically have to be repeated whenever working with this property, which is not intuitive/expected.yep, just saw this here too https://github.com/lbryio/lbry-react-native/pull/2/files#diff-5cf471858420cda219b3d4720a301029R41
please move to redux
https://lbryians.slack.com/archives/C81FGKR51/p1563989434031800
If "10" is a default page size in multiple places, please abstract it as a shared constant
@ -0,0 +62,4 @@
} = this.props;
const { orderBy, tags, channelIds, trendingForAll } = nextProps;
if (
!_.isEqual(orderBy, prevOrderBy) ||
I dislike bringing in a dependency just to compare objects :/
If we're not making heavy usage of lodash, I'd propose just bringing in this function (that is, just copy/paste it - yes, this is sometimes better than a dependency).
If this is only being used to determine if non-nested objects contain identical values and keys, I suspect it can be done in just a few lines ourselves
@ -0,0 +84,4 @@
options.channel_ids = channelIds;
}
if (trendingForAll) {
this.setState({ trendingForAllView: true });
if both
tendingForAll
andchannelIds
can be true it results in two calls tosetState
(and thus it's better to build an object)if it shouldn't be possible for both to be true, I'd make it an else just to be clearer that they are exclusive conditions
it could also make sense to write a "stupid" (simple) claimList component that only receives claims, and then create a ChannelClaimList and StreamClaimList component that performs all component logic, then passes the resulting uris/claims to the stupid version
missing
__
why are we calling
toLowerCase
only here? tag display should be consistentIMO either lowercase always (and thus move to redux) or display as they are with mixed capitalization even in the toast
reading logic below, I think you can do:
@ -5,3 +4,4 @@
import __, { navigateToUri } from 'utils/helper';
import SubscribeButton from 'component/subscribeButton';
import SuggestedSubscriptionItem from 'component/suggestedSubscriptionItem';
import Colors from 'styles/colors';
i18n
@ -13,0 +23,4 @@
}
buildSections = () => {
const { suggested, claimSearchUris } = this.props;
why shuffle?
since these are global constants, this should probably be
CLAIM_SEARCH_SORT_BY_ITEMS
or similaralso, i18n if it's possible to do it here
after looking lower, I think you want something like this
we have a find and replace spill in aisle 5
we lose the value of constant usage if we're just repeating the strings anyway
i18n
appears to match https://github.com/lbryio/lbry-react-native/pull/2/files#diff-b0a4f62a7317c2f3fb4521b1ce85991cR186
🤢
https://github.com/lbryio/lbry-react-native/pull/2/files#diff-a7748843fbda5167d065231e3a2e7a1fR85 is more constructive than the above emoji
clean up
this looks like bad usage of a magic value
can this be tracked as independent boolean?
.
@ -15,3 +29,4 @@
didFocusListener;
componentWillMount() {
use same pattern as above
also if all usage of values is confined to a single file I don't feel nearly as strongly about using constant patterns
the insistence on constant patterns is significantly driven by making inter-dependencies clear and explicit
@ -0,0 +62,4 @@
} = this.props;
const { orderBy, tags, channelIds, trendingForAll } = nextProps;
if (
!_.isEqual(orderBy, prevOrderBy) ||
I only decided to make use of the dependency since it was already being imported by a different module.
@ -0,0 +84,4 @@
options.channel_ids = channelIds;
}
if (trendingForAll) {
this.setState({ trendingForAllView: true });
It's not possible for both to be true. I initially created the ClaimList component just for displaying content for a tag or set of tags, but then I realised I needed to have the subscriptions (using channelIds) and then eventually trending for all.
This is a habit I picked up for whenever I want to compare strings making sure they're case insensitive first. I believe the names in followedTags are always lowercase.
@ -13,0 +23,4 @@
}
buildSections = () => {
const { suggested, claimSearchUris } = this.props;
There is currently a sdk bug where if I try to search for claims using
channel
forclaim_type
, and having more than 2 items inany_tags
, the request times out and no results are returned.Working with the limitation of 2 items, I decided to display suggested channels based on two random tags from the list of the user's followed tags. This also makes the suggested subscriptions list look dynamic every time a sees the suggestions.
I don't even know how I managed this!
I'm using the entire object at that index here, not just the
name
value. I would expect the index to always be at the same spot since it is defined as a constant.No references to this method anymore. I forgot to delete it after I moved it to the helper file.