Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch’s picture

Title: Link to the next new comment » Usability: Link to the next new comment

Massive, massive +1. Tested this and the code works great. Not sure about "Next new" as text but that's minor.

This won't work across pages, because the #new links disappear once you've viewed one page request. That's a different and more fundamental issue though really.

David_Rothstein’s picture

Status: Needs review » Needs work

Ooh, I like this a LOT!! I tested it and it does work great for the most part, but I noticed a few problems:

1. There's a PHP warning on nodes with no comments (easy to fix by declaring $comments_array before using it).

2. As @catch said, this will never work perfectly when there are multiple pages of comments, and that's OK -- but it's actually more broken than it needs to be. I found that if there are new comments spread across multiple pages, then the "next new" link will try to jump you to the LAST page, no matter where you are. At least it should be able to take you correctly through all the new comments on the page you're currently visiting. There seems to be something funny going on in the code with the call to comment_new_page_count() that is causing this, but I don't understand it at the moment...

3. It seems like $comments_array can be gigantic; it stores each comment, and then inside each comment is stored an entire copy of the node? I don't know anything about how the internals of PHP work, but this seems wasteful. The only new information from the node that needs to get passed along is the node comment count.

4. I agree that the text needs work. What about "jump to next new comment"? It's a little verbose, but it's good to have a verb in there, I think.

5. (feature) How about also having a "jump to first new comment" link at the top of the page? Sort of like the project issue tracker on drupal.org. This would be extremely easy to implement and would add even more to the usability.

6. (minor feature) How about putting the "jump to next new comment" link last in the list ... and perhaps theming it a bit differently from the others? For usability reasons, it might be good to separate it from the other comment links visually, since unlike the others ("delete, edit, reply") it's not something you're doing to the comment.

Sorry for the nitpicking ;) And certainly only the first 4 need to be dealt with for this to be RTBC. I'll see if I can look at this more later. Again, this is awesome! This patch might have the highest ratio of usability enhancement to lines of code in the history of Drupal ;)

David_Rothstein’s picture

Status: Needs work » Needs review
FileSize
6.61 KB
2.9 KB

The attached patch fixes bugs 1 through 4 from my above post.

It seems to work pretty well now, but here's a list of extra features that could be added to make it really shine (recapping the ones listed above, plus a couple new ones). None of these are in the patch right now:

1. Add a "jump to first new comment" link at the top of the page.

2. Improve the theming. The link gets marked with class "active" (because by definition it points to the same page that we're currently on), but that's really not what we want -- it comes out an ugly black color in Garland, whereas the other links are blue. I think it might have to be overridden at the individual theme layer. What about making the color of the link the same color as the "New" mark on the comment? I've attached a screenshot of what this could look like (in Garland)...

3. If you have ten new comments all in a row, having the "next new comment" link on each of them is not very useful, and, IMO, a little annoying. So what about hiding the link except when it's needed -- i.e., only showing it when you actually have to "jump" in order to get to the next new comment? This would be simple to implement.

4. I was thinking more about getting this to work across pages, and regardless of whether #6371: All comments marked as read when viewing any page. gets fixed, the only thing the current patch would be responsible for is finding ONE new comment beyond those on the current page and making a link to it. So it's really independent of that other bug. The problem is, I can't think of a way to do this that doesn't involve a heavy hit on the database... figuring out the next new sequential comment (and also figuring out what page it will show up on!) doesn't seem so easy, given all the possible ways that comments can be sorted, etc. Any ideas?

lilou’s picture

FileSize
2.85 KB

Re-roll

Sutharsan’s picture

Component: comment.module » usability

Moving all usability issues to Drupal - component usability.

Anonymous’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

Jooblay.net’s picture

Component: usability » ajax system
Issue summary: View changes

What is the status of this ticket:) Can we close this...

chx’s picture

Assigned: chx » Unassigned
David_Rothstein’s picture

Version: 7.x-dev » 8.x-dev
Component: ajax system » comment.module
Issue tags: +Needs backport to D7

An oldie but a goodie. I think it's still relevant, and could even be backported to D7 (maybe) although would have to be turned off by default for existing sites.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.