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

Implement sorting menu #156

Merged
merged 14 commits into from
May 3, 2019
Merged

Implement sorting menu #156

merged 14 commits into from
May 3, 2019

Conversation

jg18
Copy link
Collaborator

@jg18 jg18 commented Dec 29, 2018

Note: this is a WIP with a bunch of known issues.

This branch is based on the branch for PR #155 since delta updates for mod list updates are required to get reasonable responsiveness.

I couldn't get the existing sorting menu to work (event listeners wouldn't fire no matter what I did) so I switched to useing popper.js since we already use it in the Home tab. Hope it can be made to work here...

Known issues:

  • The "Last Played" option is missing because it doesn't work yet. Fixed!
  • The formatting and styling are all messed up. Presumably fixing this requires the right mix of changes to CSS and popper.js options, but my CSS is kind of weak, so I'd really appreciate help here. Fixed! Formatting/styling look decent to me now although you be the judge. 😜
  • The CSS is messy, although as mentioned this may be hard for me to fix on my own.
  • The sort buttons are only clickable from a small spot on the right edge of the button. Not sure why that is. Fixed!
  • The sorting menu doesn't disappear after you select an option. Possibly a feature?
  • The sorting menu icon button still looks active even after the menu is closed sometimes. Fixed!
  • Switching between Home and Explore tabs causes sorting menu selection to be lost. Apparently this is no longer an issue.
  • Selected sorting option doesn't persist between Knossos sessions. Maybe not needed?

@jg18
Copy link
Collaborator Author

jg18 commented Dec 30, 2018

Just noticed that unlike Release or Last Updated, Last Played should provide a strict total ordering and consequently needs to take time into account, even if the time probably won't be user-facing. I'll work on it...

@jg18
Copy link
Collaborator Author

jg18 commented Dec 30, 2018

Since I wasn't sure if you'd like using "Today"/"Yesterday" for dates in mod details, I made a gist of the changes: https://gist.github.com/jg18/11844ab6af10b53f911db4edaee56111

Copy link
Owner

@ngld ngld left a comment

Choose a reason for hiding this comment

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

Phew, lots of changes. Looks good overall, although I'm not happy with the way last_played is handled. Take a look at InstalledMod.save and InstalledMod.save_user to get an idea of how existing user-specific stuff is saved. I don't like adding new parameters to get() since modifications to the mod data for displaying purposes (or similar stuff) should be handled in the same location where the list is generated since that's usually closer to the related code.

html/templates/kn-details-page.vue Outdated Show resolved Hide resolved
html/templates/kn-details-page.vue Outdated Show resolved Hide resolved
@@ -21,7 +24,7 @@ export default {

search_text: '',
status_message: '',
tab: 'explore',
tab: 'explore', // FIXME shouldn't this be initialized to 'home'? isn't that what's assumed elsewhere like in center?
Copy link
Owner

Choose a reason for hiding this comment

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

Doesn't really matter since it's overwritten on initialisation anyway.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When 'explore' is the initial value, on startup the Explore tab header is briefly highlighted before the highlighting moves to the Home tab header. If the initial value is 'home' then that doesn't occur. Ultra-tiny nitpickI admit. Opinion?

Copy link
Owner

Choose a reason for hiding this comment

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

That's... a good reason to change it. IIRC explore used to be the default tab which later changed due to user feedback and the default value here is just a relic. Feel free to change it.

knossos/nebula.py Outdated Show resolved Hide resolved
knossos/nebula.py Outdated Show resolved Hide resolved
knossos/repo.py Outdated Show resolved Hide resolved
knossos/repo.py Outdated Show resolved Hide resolved
knossos/runner.py Outdated Show resolved Hide resolved
knossos/tasks.py Outdated Show resolved Hide resolved
knossos/web.py Outdated Show resolved Hide resolved
@jg18
Copy link
Collaborator Author

jg18 commented Jan 2, 2019

Thanks for the feedback. Yeah some of these changes (especially the last_played stuff) were pretty hackish. I'll work on implementing your requested changes, but first let's get my other PRs in. Then I can interactively rebase this branch against develop (dropping the commits that I copied over from PR #155 ).

@jg18
Copy link
Collaborator Author

jg18 commented Jan 2, 2019

Tangentially, since the strftime and strptime strings are starting to be duplicated in a number of places I was thinking of adding getter functions in util for retrieving them so that they're defined in only one spot. The function for returning kn_library.json should probably be moved to util as well since I'd think it fits better there than in center.

Reminds me also that now that the welcome page changes are in, we need a commit to start adding the kn_library.json file to Knossos installs so that the welcome wizard doesn't complain when you select an old library folder as your new library. Would you be up for adding that?

@jg18
Copy link
Collaborator Author

jg18 commented Jan 14, 2019

I think the new commit addresses all of your comments. Thanks for the thorough review. Once all of my other PRs are merged, I'll do an interactive rebase of this branch, dropping the commits copied over from mod-list-delta-update.

@ngld
Copy link
Owner

ngld commented Jan 29, 2019

LGTM. Do you want to do the default value change for tab here or in one of the other PRs?

@ngld ngld merged commit 4df7d2e into ngld:develop May 3, 2019
ngld added a commit that referenced this pull request May 3, 2019
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