bastislack / highline-freestyle

Webapp for Highline Freestyle
GNU General Public License v3.0
10 stars 9 forks source link

Move sorting options out of the navbar #246

Closed Dosbodoke closed 1 year ago

Dosbodoke commented 1 year ago

fix bastislack/highline-freestyle#231

Link to issue

Correct me if this way of creating a PR is not correct, never done PR to open-source before.

What is the purpose of this PR:

Fix the Navbar responsiveness by approaching the proposed solution.

Move the sorting options out of the navbar. Therefore the navbar becomes so short that the issue will not occur under any reasonable circumstances anymore. The sorting options could be moved next to or underneath the search bar (maybe depending on the screen size), as a drop down menu.

What was done to achieve

How to test if it works?

Open the Tricks Page and see if it looks like this:

image

Now use Ctrl + Shift + M to simulate a mobile view and check if the responsiveness is good enough.

Know limitation

I couldn't make the text-based filtering work on ComboList.js so I added a comment on line 30: // TODO: Finish filtering functionality

Dosbodoke commented 1 year ago

I agree with Julian's comment, we need to resolve this Task before merging

Lastly on a general note, I think it would be good to find out how to get the text-based filtering to work on the ComboList before merging. Otherwise we will have a "broken" feature on the develop branch. Maybe someone else has an idea how to do this.

And I think that a linter like Prettier would be great to prevent the need for manual code style revision like

Add semicolon

Apparently, this is being implemented on this forked repository

JulianDietzel commented 1 year ago

I think I figured out how to get the search to work. In ComboList.js where your TODO comment is try using the following three lines (only the first two are changed, the last one is unaltered):

const searchOptions = { keys: ["name", "establishedBy"] };
const fuse = new Fuse(combos, searchOptions);
const searchResults = searchPattern ? fuse.search(searchPattern).map(i => i.item) : combos;

This should make the search look for the names of the combos and the names of the people who established them.

Dosbodoke commented 1 year ago

Seems good. will commit

JulianDietzel commented 1 year ago

Right after commenting I corrected myself. See the following line:

const searchOptions = { keys: ["name", "establishedBy"] };

You're just too fast for me :D

Dosbodoke commented 1 year ago

I trusted you bro :disappointed:, will fix that haha.

Dosbodoke commented 1 year ago

Did a force push in order to not mess up a lot with the commits

JulianDietzel commented 1 year ago

Also feel free to mark my comments as resolved when you implemented them. (I tend to reply with "Implemented" or something along the lines before resolving the comment so it is clear what the result was. I don't know if this is the best practice approach, but it seems somewhat sensible)

Dosbodoke commented 1 year ago

I'm used to work with BitBucket and there we create tasks that need to be marked as resolved in order to allow merge, I think that there is something similar here.

GitHub - Task list completed PR check

Don't know if it has a native approach for this.

JulianDietzel commented 1 year ago

Resolving the comments is the standard GitHub way to handle this. There are also changes that need to be done before the merge can happen, which can be seen in Pull Request 198 at the moment. My comment on not knowing what the best practice way is, was related to whether to write a brief one word response to the request before closing it or not (but in all honesty, who cares?).

Dosbodoke commented 1 year ago

What is missing for the merge?

JulianDietzel commented 1 year ago

Time. This is not a professional project, so it can take a moment for someone to find the time to check the PR. This PR also affects quite a number of files so checking all of them can't simply be done in a few minutes.

bastislack commented 1 year ago

Looks good! Thank you so much for your work :)