Bug 36559

Summary: Transport cost matrix update helpers
Product: Koha Reporter: holly
Component: Hold requestsAssignee: Lucas Gass <lucas>
Status: Needs documenting --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: blawlor, fridolin.somers, george, gmcharlt, lucas, martin.renvoize, pedro.amorim
Version: MainKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
With a lot of columns and rows the transport cost matrix got hard to edit. This patch makes it so that the header column and row are fixed and will always remain visible while editing.
Version(s) released in:
24.05.00
Attachments: Bug 36559: Add sticky table headers to transport cost matrix
Bug 36559: (follow-up) Fix To/From z-index
Bug 36559: Add sticky table headers to transport cost matrix
Bug 36559: (follow-up) Fix To/From z-index
Bug 36559: (follow-up) Fix To/From z-index
Bug 36559: Add sticky table headers to transport cost matrix
Bug 36559: (follow-up) Fix To/From z-index

Description holly 2024-04-09 21:49:57 UTC
In the transport cost matrix, library name row and column titles are only visible in the browser window if the user is working in a part of the matrix fairly close to the top or left side of the matrix. For large consortia, and when there are many libraries in the system, the matrix is often too big to see this information. 

For ease of filling out the matrix, it would be nice if the user always had a way to see the library combination for the active cell. 
This could look a few ways, and I'm sure someone out here has additional ideas. 
1. Library names could be frozen and always visible
2. Library names could show when the user hovers over any given cell.
Comment 1 George Williams (NEKLS) 2024-04-10 14:02:31 UTC
+1  Good ideas
Comment 2 Lucas Gass 2024-04-12 07:45:20 UTC
Created attachment 164794 [details] [review]
Bug 36559: Add sticky table headers to transport cost matrix

To test:
1. APPLY patch and regenerate CSS. ( yarn build )
2. Have many, many branches. To test it is good to have more branches than in a standard k-t-d.
3. Go to Admin > Transport cost matrix
4. Scroll down and to the right, the table headers should stay visible.
5. Hover over any cell, a title should appear like 'Branch A / Branch B'
6. Test in Chrome and Firefox.

This uses position: sticky which has recently gained more widespread browser support:
https://caniuse.com/?search=sticky
Comment 3 Brendan Lawlor 2024-04-12 20:57:51 UTC
I tested this with 40 branches and it works well in both Chrome and Firefox. 

One small thing I noticed is that the first column table header From \ To does not stick in either vertical or horizontal scrolling directions.
Comment 4 Lucas Gass 2024-04-18 20:50:40 UTC
Created attachment 165145 [details] [review]
Bug 36559: (follow-up) Fix To/From z-index
Comment 5 Lucas Gass 2024-04-18 20:51:13 UTC
(In reply to Brendan Lawlor from comment #3)
> I tested this with 40 branches and it works well in both Chrome and Firefox. 
> 
> One small thing I noticed is that the first column table header From \ To
> does not stick in either vertical or horizontal scrolling directions.

Thanks Brendan! I provided a follow up to fix that.
Comment 6 Brendan Lawlor 2024-04-19 13:50:48 UTC
Created attachment 165202 [details] [review]
Bug 36559: Add sticky table headers to transport cost matrix

To test:
1. APPLY patch and regenerate CSS. ( yarn build )
2. Have many, many branches. To test it is good to have more branches than in a standard k-t-d.
3. Go to Admin > Transport cost matrix
4. Scroll down and to the right, the table headers should stay visible.
5. Hover over any cell, a title should appear like 'Branch A / Branch B'
6. Test in Chrome and Firefox.

This uses position: sticky which has recently gained more widespread browser support:
https://caniuse.com/?search=sticky

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 7 Brendan Lawlor 2024-04-19 13:50:50 UTC
Created attachment 165203 [details] [review]
Bug 36559: (follow-up) Fix To/From z-index

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 8 Pedro Amorim 2024-04-23 10:47:22 UTC
Hi guys, second patch is failing to apply for me:

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 36559: Add sticky table headers to transport cost matrix
Applying: Bug 36559: (follow-up) Fix To/From z-index
error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss).
error: could not build fake ancestor
Patch failed at 0001 Bug 36559: (follow-up) Fix To/From z-index
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-36559-follow-up-Fix-ToFrom-z-index-cx2obgcd.patch
Comment 9 Lucas Gass 2024-04-23 13:42:16 UTC
Created attachment 165400 [details] [review]
Bug 36559: (follow-up) Fix To/From z-index

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 10 Pedro Amorim 2024-04-23 14:01:15 UTC
Created attachment 165402 [details] [review]
Bug 36559: Add sticky table headers to transport cost matrix

To test:
1. APPLY patch and regenerate CSS. ( yarn build )
2. Have many, many branches. To test it is good to have more branches than in a standard k-t-d.
3. Go to Admin > Transport cost matrix
4. Scroll down and to the right, the table headers should stay visible.
5. Hover over any cell, a title should appear like 'Branch A / Branch B'
6. Test in Chrome and Firefox.

This uses position: sticky which has recently gained more widespread browser support:
https://caniuse.com/?search=sticky

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 11 Pedro Amorim 2024-04-23 14:01:19 UTC
Created attachment 165403 [details] [review]
Bug 36559: (follow-up) Fix To/From z-index

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 12 Pedro Amorim 2024-04-23 14:02:19 UTC
Working as described. Great improvement. QA script happy.
Used Nick's https://github.com/kidclamp/handy-koha-script/blob/main/randbranches.pl to generate a ton of branches to test this.
Comment 13 Katrin Fischer 2024-04-29 15:43:05 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 14 Fridolin Somers 2024-05-24 10:03:42 UTC
Not backported to 23.11.x