Bug 39464 - Z39.50 Search results not highlighting grey rows in yellow when previewing
Summary: Z39.50 Search results not highlighting grey rows in yellow when previewing
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Phil Ringnalda
QA Contact: Lucas Gass (lukeg)
URL:
Keywords: rel_24_11_candidate
Depends on: 35402
Blocks:
  Show dependency treegraph
 
Reported: 2025-03-26 22:52 UTC by Heather Rommens
Modified: 2025-05-07 19:50 UTC (History)
5 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39464: Grey rows in tables not highlighting in yellow when they should (2.64 KB, patch)
2025-04-12 19:45 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 39464: Grey rows in tables not highlighting in yellow when they should (2.69 KB, patch)
2025-04-14 06:58 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 39464: Grey rows in tables not highlighting in yellow when they should (2.74 KB, patch)
2025-04-21 14:25 UTC, David Nind
Details | Diff | Splinter Review
Bug 39464: Grey rows in tables not highlighting in yellow when they should (2.79 KB, patch)
2025-04-29 21:20 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Heather Rommens 2025-03-26 22:52:53 UTC
When previewing Z39.50 search results in the Cataloging module, the yellow highlighting only applies to white rows, grey rows. This highlighting is very helpful for staff to identify exactly which record they are previewing in the table.
Comment 1 Phil Ringnalda 2025-03-27 00:35:33 UTC
Also true of Administration - Circulation and fine rules, should also be true of Administration - Item search fields, Mana report and subscription search results, and maybe others, since they all have the selector ".highlighted-row, .highlighted-row td" fighting for specificity with "tbody tr:nth-child(odd):not(.dtrg-group, .active, .ok) td:not(.bg-danger, .bg-warning, .bg-info, .bg-success, .bg-primary)" which is... rather specific.
Comment 2 Phil Ringnalda 2025-03-27 22:16:12 UTC
Not (currently) item search fields, because bug 39477 keeps it from showing for any row, not just the grey rows.
Comment 3 Phil Ringnalda 2025-03-28 00:18:46 UTC
And it's clownshoes all the way down. Circulation and fine rules doesn't set .highlighted-row on its <tr>, it sets it on every <td> in the <tr>, so not only does the tr:nth-child(odd):not() need to include .highlighted-row, the td:not() needs to as well.

I was going to just write a patch and try to sell a test plan including only the uses I knew how to get to, but since those three are all broken in different ways, I think this needs someone who knows how to write a test plan that gets to mana-report-search-result.inc and mana-subscription-search-result.inc and subscription-detail.tt as well.
Comment 4 Owen Leonard 2025-03-31 15:27:04 UTC
(In reply to Phil Ringnalda from comment #3)
> And it's clownshoes all the way down.

I guess that makes me the clown! Cool. Cool cool cool.
Comment 5 Phil Ringnalda 2025-03-31 23:41:57 UTC
A surprising fact about clown shoes is that they are just normal shoes from the inside, so you don't necessarily know you're wearing them until you get up and try to walk around.

Or so I've heard. In a previous project where we used the term constantly, I thought about buying a pair for a profile picture, but another surprising fact about them is that they are jaw-droppingly expensive.
Comment 6 Owen Leonard 2025-04-01 11:08:32 UTC
I'll be more direct: Calling someone else's code "clown shoes" is rude and uncalled for.
Comment 7 Phil Ringnalda 2025-04-02 01:33:15 UTC
Please accept my apology for the unwarranted and unintended insult. While at Mozilla it's a term of art for a particular sort of cascading breakage, I should have known both before and immediately afterward that since nobody involved in Koha uses it, it wouldn't be seen that way.
Comment 8 Phil Ringnalda 2025-04-12 18:55:47 UTC
Not blocking on testing Mana.

The same patch does fix things for it, but testing it requires too many gyrations. Mana uses it to highlight entities with between 5 and 10 comments. For reports, comments aren't actually implemented, unless you submit them directly through the API. mana-kb currently has comments on 4 of its 1330 reports, none with 5-10 comments. For serials, there are comments on 26 of the 11810 subscription entities, 2 of which have between 5 and 10 comments (all test or joke comments), but because the comments column isn't filled by Serials - Search on Mana, actually seeing them requires triggering an apparently intermittent bug where you create a new subscription which will find a match on Mana, on the Frequency page click the Show Mana results link, and then wait for the one matching result displayed in the popup dialog to be replaced by every subscription on Mana, giving you a table where you can sort by the comments column.
Comment 9 Phil Ringnalda 2025-04-12 19:45:37 UTC Comment hidden (obsolete)
Comment 10 Magnus Enger 2025-04-14 06:58:26 UTC
Created attachment 180895 [details] [review]
Bug 39464: Grey rows in tables not highlighting in yellow when they should

Because the CSS rule for turning odd-numbered rows grey is highly-specific
(tbody tr:nth-child(2n+1):not(.dtrg-group, .active, .ok) td:not(.bg-danger,
.bg-warning, .bg-info, .bg-success, .bg-primary)), it overrides the
.highlighted-row, .highlighted-row td rule that some tables use to turn the
background of a currently-selected row yellow, so highlighted-row needs to be
added to the lists of not().

Test plan:
 1. Without the patch, Cataloging - New from Z39.50/SRU, perform a search like
    Author smith which will return at least two results.
 2. On an even-numbered row with a white background, click MARC and note that
    the row is given a yellow background (either by increasing the size of the
    popup to peer around the preview, or by closing the preview, since the
    highlight persists).
 3. On an odd-numbered row with a grey background, click MARC and note that
    the row isn't given a yellow background
 4. Administration - Circulation and fine rules, if you don't already have at
    least two rules add one by just changing the Patron category in the edit
    row and Save
 5. On a row with a white background, click Edit and note that the background
    for that row is yellow
 6. On a row with a grey background, click Edit and note that the background
    remains grey, not yellow
 7. Apply patch, in ktd --shell yarn build (or in a sandbox Actions - Build
    CSS and JS), clear browser cache or shift+Reload the page
 8. Repeat steps 1-6, but this time note that you get the same yellow
    highlighted background for both odd and even rows.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Comment 11 David Nind 2025-04-21 14:25:23 UTC
Created attachment 181219 [details] [review]
Bug 39464: Grey rows in tables not highlighting in yellow when they should

Because the CSS rule for turning odd-numbered rows grey is highly-specific
(tbody tr:nth-child(2n+1):not(.dtrg-group, .active, .ok) td:not(.bg-danger,
.bg-warning, .bg-info, .bg-success, .bg-primary)), it overrides the
.highlighted-row, .highlighted-row td rule that some tables use to turn the
background of a currently-selected row yellow, so highlighted-row needs to be
added to the lists of not().

Test plan:
 1. Without the patch, Cataloging - New from Z39.50/SRU, perform a search like
    Author smith which will return at least two results.
 2. On an even-numbered row with a white background, click MARC and note that
    the row is given a yellow background (either by increasing the size of the
    popup to peer around the preview, or by closing the preview, since the
    highlight persists).
 3. On an odd-numbered row with a grey background, click MARC and note that
    the row isn't given a yellow background
 4. Administration - Circulation and fine rules, if you don't already have at
    least two rules add one by just changing the Patron category in the edit
    row and Save
 5. On a row with a white background, click Edit and note that the background
    for that row is yellow
 6. On a row with a grey background, click Edit and note that the background
    remains grey, not yellow
 7. Apply patch, in ktd --shell yarn build (or in a sandbox Actions - Build
    CSS and JS), clear browser cache or shift+Reload the page
 8. Repeat steps 1-6, but this time note that you get the same yellow
    highlighted background for both odd and even rows.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: David Nind <david@davidnind.com>
Comment 12 David Nind 2025-04-21 14:26:57 UTC
Adding my sign-off - maybe Magnus's can count as QA?
Comment 13 Lucas Gass (lukeg) 2025-04-29 21:20:57 UTC
Created attachment 181689 [details] [review]
Bug 39464: Grey rows in tables not highlighting in yellow when they should

Because the CSS rule for turning odd-numbered rows grey is highly-specific
(tbody tr:nth-child(2n+1):not(.dtrg-group, .active, .ok) td:not(.bg-danger,
.bg-warning, .bg-info, .bg-success, .bg-primary)), it overrides the
.highlighted-row, .highlighted-row td rule that some tables use to turn the
background of a currently-selected row yellow, so highlighted-row needs to be
added to the lists of not().

Test plan:
 1. Without the patch, Cataloging - New from Z39.50/SRU, perform a search like
    Author smith which will return at least two results.
 2. On an even-numbered row with a white background, click MARC and note that
    the row is given a yellow background (either by increasing the size of the
    popup to peer around the preview, or by closing the preview, since the
    highlight persists).
 3. On an odd-numbered row with a grey background, click MARC and note that
    the row isn't given a yellow background
 4. Administration - Circulation and fine rules, if you don't already have at
    least two rules add one by just changing the Patron category in the edit
    row and Save
 5. On a row with a white background, click Edit and note that the background
    for that row is yellow
 6. On a row with a grey background, click Edit and note that the background
    remains grey, not yellow
 7. Apply patch, in ktd --shell yarn build (or in a sandbox Actions - Build
    CSS and JS), clear browser cache or shift+Reload the page
 8. Repeat steps 1-6, but this time note that you get the same yellow
    highlighted background for both odd and even rows.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 14 Katrin Fischer 2025-05-02 06:55:06 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 15 Eric Swenson 2025-05-07 19:50:25 UTC
Could this be backported into 24.11?