Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The Style for the marker of a new comment looks like the content of the comment. Needs to diminished importance and/or highlight the marker to distinguish it from the body of the comment.
Proposed resolution
Add CSS to style the bartik new comment marker. Use theme_mark to keep the markup consistent
Remaining tasks
Implement theme_mark in a patch
Review
User interface changes
Comment new marker style to distinguish change from body copy
API changes
n/a
Comment | File | Size | Author |
---|---|---|---|
#14 | new-comments-in-bartik-highlight-2277643-14.patch | 9.52 KB | lauriii |
Comments
Comment #1
LewisNymanComment #2
natanmoraesComment #3
natanmoraesUpdated the "new" mark to be highlighted in red.
Comment #4
okami CreditAttribution: okami commentedI applied the patch and added a comment field, then added a comment and saw the styled new text.
I think this fixes the issue.
Comment #5
alexpottLet's use theme_mark here. And then this will be consistent with how the node "new" is marked up.
Comment #6
LewisNymanComment #7
natanmoraesWhat do you guys mean by "use theme_mark"? Isn't the "new" mark being rendered properly already?
Comment #8
star-szrtheme_mark() is now mark.html.twig (things can move fast around here). What @alexpott is saying is that the "new" marker for comments should use our standard mark theme hook/template rather than its own custom markup. Then likely no CSS changes would be needed.
Comment #9
lauriiiAfter changing rendering method I couldn't find any changes on the layout.
Comment #10
teroelonen CreditAttribution: teroelonen commentedComment #11
teroelonen CreditAttribution: teroelonen commentedMerged both patches and created an other one. Screenshot of the result:
Comment #13
lauriiiComment #14
lauriiiThis patch also removes deprecated Javascript file.
Comment #15
star-szrQuick drive by review, thanks @lauriii and @teroelonen for jumping on this one. I think the last point is the most important at this time, we need an answer there - maybe there is automated test coverage somewhere for that?
Try setting the variable as a render array here, there shouldn't be a need to pre-render it.
$variables['new'] = array('#theme' => 'mark')
Extra blank line here.
Wait a minute, can we be sure this doesn't break caching? And if that's not a problem, what's happening to the new_indicator_timestamp variable?
Comment #16
lauriiiActually I've been testing this manually already for a while, and because of comments are cached, so is the new marker also.
And because by manually testing this seems to be broken, I'm not sure if there's automated testing coverage for that because automated tests seems to pass.
Comment #17
star-szrOh I guess we don't have automated testing because JavaScript. Doh.
Comment #18
LewisNymanSetting to needs work based on #15
Comment #19
lauriiiThis needs issue summary update because whats described there isn't relevant anymore. I guess we have to stick with the javascript solution to not break caching.
Comment #20
andypostComment #21
andypostComment #22
andypostthis is no go now, so JS is a way