Bug 39698 - Add option to expand responsive datatable rows by default
Summary: Add option to expand responsive datatable rows by default
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Jake Deery
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-22 14:48 UTC by Jake Deery
Modified: 2025-06-13 20:44 UTC (History)
2 users (show)

See Also:
GIT URL:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement lets you control the default responsiveness of OPAC tables, such as OPAC search history. New system preference 'OPACTableColExpandedByDefault' controls the default behavor. Tables are collapsed by default with a '+' to expand, and when expanded a '-' is visible to collapse. (This enhancement is a result of recommendations from a recent accessibility audit.) ** Sponsored by: Open Fifth **
Version(s) released in:
Circulation function:


Attachments
Bug 39698: Add option to expand responsive datatable (24.36 KB, patch)
2025-04-22 14:52 UTC, Jake Deery
Details | Diff | Splinter Review
Bug 39698: Add option to expand responsive datatable (23.89 KB, patch)
2025-04-25 22:29 UTC, David Nind
Details | Diff | Splinter Review
Screenshots - Not expanded and expanded (103.35 KB, application/pdf)
2025-04-25 22:41 UTC, David Nind
Details
Bug 39698: Add option to expand responsive datatable (23.91 KB, patch)
2025-06-13 19:44 UTC, Jake Deery
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jake Deery 2025-04-22 14:48:00 UTC
kohaTables on the OPAC are currently configured to display a '+' button, when the table is overflowing. When this '+' is clicked, the overflowing cells are displayed on new lines.

I propose a system preference that would control whether this button is a '+' or a '-' by default, and thusly, whether the overflowing cells are shown or hidden.
Comment 1 Jake Deery 2025-04-22 14:52:27 UTC
Created attachment 181288 [details] [review]
Bug 39698: Add option to expand responsive datatable

This patch adds the 'OPACTableColExpandedByDefault' system preference,
disabled by default, which controls whether responsive datatable rows
are expanded or not. This work has been performed after recommendations
from a recent accessibility audit.

TO TEST:
a)  set 'OpacLocationBranchToDisplay' to both
b)  search the OPAC for history, select first result
c)  zoom your browser in to maxiumum, scroll down to holdings table
    -   notice how the rows are collapsed by default, with '+' visible
**apply patch**
e)  refresh details page, notice how the behaviour is currently unchanged
f)  change new 'OPACTableColExpandedByDefault' syspref to 'Expand'
g)  return to OPAC details page, refresh, zoom in
    -  notice how the rows are now expanded by default, with '-' visible
**sign off**
Comment 2 David Nind 2025-04-25 22:29:36 UTC
Created attachment 181560 [details] [review]
Bug 39698: Add option to expand responsive datatable

This patch adds the 'OPACTableColExpandedByDefault' system preference,
disabled by default, which controls whether responsive datatable rows
are expanded or not. This work has been performed after recommendations
from a recent accessibility audit.

TO TEST:
a)  set 'OpacLocationBranchToDisplay' to both
b)  search the OPAC for history, select first result
c)  zoom your browser in to maxiumum, scroll down to holdings table
    -   notice how the rows are collapsed by default, with '+' visible
**apply patch**
e)  refresh details page, notice how the behaviour is currently unchanged
f)  change new 'OPACTableColExpandedByDefault' syspref to 'Expand'
g)  return to OPAC details page, refresh, zoom in
    -  notice how the rows are now expanded by default, with '-' visible
**sign off**

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2025-04-25 22:41:23 UTC
Created attachment 181561 [details]
Screenshots - Not expanded and expanded

I've signed off, as it does what is says in the test plan.

However, the "buttons" with the + and - don't really look that great to me, and I find them confusing. 

Particularly the lack of contrast with the darker and lighter green, I don't see any + sign to expand, and the - is very hard to see.

See the attached screenshots - hopefully what I'm describing makes sense!


Testing notes (using KTD):
1. After applying the patch, run a database update: updatedatabase
Comment 4 Owen Leonard 2025-04-28 12:49:30 UTC
(In reply to David Nind from comment #3)
> Created attachment 181561 [details]
> Screenshots - Not expanded and expanded
> 
> I've signed off, as it does what is says in the test plan.
> 
> However, the "buttons" with the + and - don't really look that great to me,
> and I find them confusing. 

This is a bug caused by 39600 which adds inclusion of datatables.min.css to the OPAC's doc-head-close.inc in a way that overrides opac.css. I have filed Bug 39761.
Comment 5 David Nind 2025-04-29 08:20:26 UTC
(In reply to Owen Leonard from comment #4)
> 
> This is a bug caused by 39600 which adds inclusion of datatables.min.css to
> the OPAC's doc-head-close.inc in a way that overrides opac.css. I have filed
> Bug 39761.

Thanks Owen!
Comment 6 Lucas Gass (lukeg) 2025-05-08 19:18:18 UTC
Your atomicupdate is named 'bug_xxxxx_' and doesn't have the proper permissions.
Comment 7 Jake Deery 2025-06-13 19:44:09 UTC
Created attachment 183250 [details] [review]
Bug 39698: Add option to expand responsive datatable

This patch adds the 'OPACTableColExpandedByDefault' system preference,
disabled by default, which controls whether responsive datatable rows
are expanded or not. This work has been performed after recommendations
from a recent accessibility audit.

TO TEST:
a)  set 'OpacLocationBranchToDisplay' to both
b)  search the OPAC for history, select first result
c)  zoom your browser in to maxiumum, scroll down to holdings table
    -   notice how the rows are collapsed by default, with '+' visible
**apply patch**
e)  refresh details page, notice how the behaviour is currently unchanged
f)  change new 'OPACTableColExpandedByDefault' syspref to 'Expand'
g)  return to OPAC details page, refresh, zoom in
    -  notice how the rows are now expanded by default, with '-' visible
**sign off**

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 Jake Deery 2025-06-13 19:45:01 UTC
Thanks, Lucas. Got around to setting the mode on that file, and have renamed it to match expectations.

Ta,
Jake.