Skip to content

Sort update#34

Open
brandonhenry wants to merge 9 commits intomasterfrom
sort-update
Open

Sort update#34
brandonhenry wants to merge 9 commits intomasterfrom
sort-update

Conversation

@brandonhenry
Copy link
Copy Markdown
Collaborator

Used current structure (sortBar) to add sorting by song name, author name, BPM, and difficulty. This is only supported for local songs as such sorting by other factors such as PP, upvotes, etc are not included. Can also sort ascending/descending.

bhenry and others added 7 commits June 5, 2019 12:25
New package added for sorting json based on a param
First pass of UI design for sorting songs.
Added semi-colons where needed
Add eslint rule for semicolons
Quick ternary update before heading back to work.
Comment thread src/components/SortBar.js Outdated
@brandonhenry brandonhenry self-assigned this Jun 7, 2019
@StarGazer1258
Copy link
Copy Markdown
Owner

A couple of observations:

  1. Sorting by BPM is slightly confusing, as this is not displayed in the list. If you can find a good place to put it in the list item, that would be fine.

  2. Difficulty sorting seems either broken or very confusing. I'm not sure how this sort is supposed to work when songs have multiple difficulty levels available.

Also, implementing some arrows next to the sort criteria might make the UI look a little better. See sorting in the mod list and ModListView.js for examples. This is merely a suggestion. If you think that would be awkward, then you can leave it as it is.

<th onClick={ () => { this.setState({ sortBy: 'name', sortDirection: this.state.sortBy === 'name' ? !this.state.sortDirection : 0 }) } }><span>Mod Name{ this.state.sortBy === 'name' ? this.state.sortDirection ? '▼' : '▲' : null }</span></th>
<th width={ 80 } onClick={ () => { this.setState({ sortBy: 'version', sortDirection: this.state.sortBy === 'version' ? !this.state.sortDirection : 0 }) } }><span>Version{ this.state.sortBy === 'version' ? this.state.sortDirection ? '▼' : '▲' : null }</span></th>
<th width={ 80 } onClick={ () => { this.setState({ sortBy: 'gameVersion', sortDirection: this.state.sortBy === 'gameVersion' ? !this.state.sortDirection : 0 }) } }><span>Game V.{ this.state.sortBy === 'gameVersion' ? this.state.sortDirection ? '▼' : '▲' : null }</span></th>
<th onClick={ () => { this.setState({ sortBy: 'author', sortDirection: this.state.sortBy === 'author' ? !this.state.sortDirection : 0 }) } }><span>Author{ this.state.sortBy === 'author' ? this.state.sortDirection ? '▼' : '▲' : null }</span></th>
<th onClick={ () => { this.setState({ sortBy: 'category', sortDirection: this.state.sortBy === 'category' ? !this.state.sortDirection : 0 }) } }><span>Category{ this.state.sortBy === 'category' ? this.state.sortDirection ? '▼' : '▲' : null }</span></th>
<th onClick={ () => { this.setState({ sortBy: 'uploadDate', sortDirection: this.state.sortBy === 'uploadDate' ? !this.state.sortDirection : 0 }) } }><span>Upload Date{ this.state.sortBy === 'uploadDate' ? this.state.sortDirection ? '▼' : '▲' : null }</span></th>

Comment thread src/css/SongListItem.scss
margin-left: 5px;
opacity: 0.5;
}
.bpm {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Selector should have depth of applicability no greater than 2, but was 3

@zxsdklfhskyrvk
Copy link
Copy Markdown

@brandonhenry Any chance you could continue on this? I think many are interested in sorting and filtering, but it seems like your request has stalled. Maybe re-doing the pull request from a fresh repo would avoid the conflicts?

@StarGazer1258
Copy link
Copy Markdown
Owner

This has stalled because there is little that can be done. True sorting/filtering on BeatSaver song cannot be done locally, it must be done by the server. Unless BeatSaver implements these functions, there is nothing to be done unfortunately.

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.

3 participants