-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Outreachy] Add All Posts Route /notes #8800
Conversation
The The only pending section is what will be displayed at the banner section...should it be a featured post? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great till now
Ah, my apologies @RuthNjeri - in this new design, we won't be mixing the types, so each of Notes, Questions, Wikis, and Comments will each simply have their own tab, and their own URL (so we won't load them all on a single page load, it'll be more efficient to just reload the page when the tab is clicked, just like at https://publiclab.org/tag/outreachy for example!). Make sense? Thanks!!! |
So, perhaps we should think of this as a collection of pages that make up "All posts" -- All notes, All questions (would this lead to https://publiclab.org/questions so as not to be redundant?), All wikis (https://publiclab.org/wiki), All comments (this last one might actually link to or replace https://publiclab.org/comments?) Let's make this PR just about notes, as there is no place where all notes are collected. We can think on the remaining types in the meantime! I'll ping @publiclab/community-reps about this. The main challenge if we link all other types to their corresponding pages, is that if our layout looks like tabs, people may expect those pages to appear like tabs, and be confused if they're led to pages that don't seem to be a sub-tab of the "All posts" page collection. Either this is just OK, and not a big deal, or maybe we would think of some way to indicate that the other types aren't tabs at all, but just links? My take is that /questions /wiki /comments are well established and we should try to make the links not appear as tabs, which is a design challenge but not too tough, i think. Let's see what people think! |
This makes perfect sense! |
I'll create a query to collect all notes.. About the tabs issue, what if, instead of having a route and page called 'All Posts' we have a dropdown that has a link to each of the notes, questions, comments, and wiki.. that way, we won't have an entirely new page that looks similar to the topics page. Since the 'All Posts' link will be on the Dashboard, we can make it a dropdown instead of a link.. unless it is necessary to have a main page for all the posts. |
@jywarren I have just discovered that there's an action for all notes in the NotesController. The page is https://publiclab.org/notes This might mean that we have the pages that display all: notes, questions, wikis, and comments. The only pending issue is the design of the page, I have shared my suggestion of using a dropdown on the Dashboard page, see above... |
Hi @RuthNjeri -
Whoa! OK yikes yes! Let's use that, and just refine the design to better match the /tag/____ style. And /notes is a good URL!
I guess, to me, it makes sense for the /notes page to easily offer links to the other types, in case you go there and then want to "traverse" to other types. What if we instead of tabs, offered some "pill" links in the same order so it looks familiar in placement and order, but doesn't look like they function as tabs. The row of tabs shown here: Could instead be a pill nav: https://getbootstrap.com/docs/4.4/components/navs/#pills That way we can also keep the dashboard simpler with no dropdown. But, we can try this out and re-evaluate once we show it to people -- it would just take some styling changes on the Dashboard to make changes if people really want the dropdown, for example. How does this sound? One thing is, I'm not sure if there are functional tests for the /notes route. We may want to add some simple ones. Lastly, while we can get rid of all the sidebar content on /notes, we should consider retaining the "by likes" and "by views" options. Maybe those would go in the "sort by" dropdown we had been wanting to get rid of, since they already exist. Oh- one more thing -- http://publiclab.org/notes is really slow. I suspect the queries and pagination generating that page are not well optimized. Does anything stand out to you about them? Maybe, we could try to refine them to be closer to the TagController plots2/app/controllers/notes_controller.rb Lines 304 to 342 in cbb807b
|
Using the /notes URL and refining it seems like a great starting point. I think redesigning the page makes a lot of sense.. I'll break down the tasks needed for this in the Planning issue to keep track of the updates and push updates on this PR once I complete the first task... I'll update you once I need a review.... |
Gosh, actually looking at that code i don't see why it's so inefficient. it seems well limited by timestamp. Ah, i see! Line 139 in cbb807b
So that's this: plots2/app/controllers/notes_controller.rb Lines 6 to 9 in cbb807b
Leading to this sub-method plots2/app/controllers/application_controller.rb Lines 26 to 67 in cbb807b
I think we should just skip |
Ah sorry was still writing into that last comment. But, sounds great, Ruth! Thank you!!! |
Really great detective work in this thread @RuthNjeri ! Thank you for finding that https://publiclab.org/notes exists, and planning an update! I just consulted the @publiclab/community-reps staff, and there is agreement that can we work with pill navs to the pages where we already present content by type. There was excitement that wiki updates would be easier/more consistent to navigate to. Several people said that it was really the comments that they needed to browse chronologically. |
Thanks for the clarification @ebarry 😄 About the need to browse through the comments chronologically, we have the comments route https://publiclab.org/comments where the comments are ordered according to the most recent, is that the chronological order that's needed? |
Correct @RuthNjeri 👍 |
Hi! This is ready for review. 😄 |
Tagging @jywarren, @Sagarpreet, and @cesswairimu.. this is ready for review.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic @RuthNjeri tada: 🎉
Great great job..love the loads of refactoring and cleanup you did here 🚀 🚀
Thanks
5a16fd5
to
5963fc5
Compare
app/controllers/notes_controller.rb
Outdated
|
||
def published_notes | ||
hidden_nids = Node.hidden_response_node_ids | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
Force pushed due to recent rebase with the main branch |
Hi @jywarren, it seems that the database setup is failing when the build is running... I'm not sure why it's failing... |
Codecov Report
@@ Coverage Diff @@
## main #8800 +/- ##
=======================================
Coverage ? 81.86%
=======================================
Files ? 100
Lines ? 5938
Branches ? 0
=======================================
Hits ? 4861
Misses ? 1077
Partials ? 0 |
Strange, ok I'm actually seeing this integration test fail:
I restarted to see if it's intermittent... Any ideas otherwise? |
<% if params[:controller] == "tag" || params[:controller] == "search" %> | ||
<%= render :partial => "sidebar/related" %> | ||
<% elsif params[:action] == "author" || params[:action] == "author_topic" %> | ||
<%= render :partial => "sidebar/author" %> | ||
<% else %> | ||
<%= render :partial => "sidebar/user" %> | ||
<% end %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of this section is the one causing the tests to fail. Also I don't think we want to remove this sidebar...it gives access to recent wiki edits ... @RuthNjeri you might also want to add back the set_sidebar
under index in the controller. what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cesswairimu 😄
The removal of that section was part of this discussion with @jywarren where we replace it with the sort dropdown for the notes...
I think a user will still be able to access the recent wiki edits via the wiki section that will be linked on the notes page, I am working on this here, therefore, access to the recent edits won't be completely lost, just changed to another page....
I think this can also be open to further discussion before the PR is merged..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh okay, my bad missed that, then I think we might need to rewrite that test or remove it
Hi @jywarren the test is related to the sidebar that I removed, so I've removed the test...though there's a discussion happening above whether the sidebar should be removed.. |
Code Climate has analyzed commit a27dddb and detected 2 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
No I think that's correct to remove the sidebar and the test, thank you! This looks awesome and it's so comforting to see the green All checks have passed ✅ message 😅 Merging now! Congratulations!!!! Thanks everyone!!! |
This should shortly be visible at stable.publiclab.org!!! |
Nice! The notes URL is loading a bit faster now 😄 |
Awesome to see!
…On Thu, Dec 17, 2020, 1:52 PM Ruth ***@***.***> wrote:
Nice! The notes URL is loading a bit faster now 😄
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#8800 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAF6J7ITCUIJMR76VG6EL3SVJHOVANCNFSM4UNRMNYQ>
.
|
* all posts route * add to do item * notes controller * remove previous code and inline comments * remove inline comments * reuse published_notes for popular, recent, liked * implements review feedback * fix order and increase limit * fixed tests * revert pagy code in wiki * optimize query and add test for hidden response id * update styling * fix tests * add columns in the hidden_response select * fix failing test * revise node query * add a revision for the hidden note test node * remove trailing whitespace * remove sidebar test
* all posts route * add to do item * notes controller * remove previous code and inline comments * remove inline comments * reuse published_notes for popular, recent, liked * implements review feedback * fix order and increase limit * fixed tests * revert pagy code in wiki * optimize query and add test for hidden response id * update styling * fix tests * add columns in the hidden_response select * fix failing test * revise node query * add a revision for the hidden note test node * remove trailing whitespace * remove sidebar test
* all posts route * add to do item * notes controller * remove previous code and inline comments * remove inline comments * reuse published_notes for popular, recent, liked * implements review feedback * fix order and increase limit * fixed tests * revert pagy code in wiki * optimize query and add test for hidden response id * update styling * fix tests * add columns in the hidden_response select * fix failing test * revise node query * add a revision for the hidden note test node * remove trailing whitespace * remove sidebar test
* all posts route * add to do item * notes controller * remove previous code and inline comments * remove inline comments * reuse published_notes for popular, recent, liked * implements review feedback * fix order and increase limit * fixed tests * revert pagy code in wiki * optimize query and add test for hidden response id * update styling * fix tests * add columns in the hidden_response select * fix failing test * revise node query * add a revision for the hidden note test node * remove trailing whitespace * remove sidebar test
Fixes #8828
I'm still trying to understand what 'All Posts' means.. this is a first attempt at trying to understand it.
I'll add a test once feedback is provided.