Bug 38433

Summary: Conflicting behaviour of the columns visibility on the items table
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Staff interfaceAssignee: Jonathan Druart <jonathan.druart>
Status: ASSIGNED --- QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: caroline.cyr-la-rose, gmcharlt, schodkowy.omegi-0r
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38391
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38436
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 33484, 38482, 38485    
Bug Blocks:    

Description Jonathan Druart 2024-11-13 15:25:49 UTC
On the items table of the bibliographic record there are different behaviour conflicting with each others.

First you have the admin settings that gives you the default visibility.
Then you have the "hide the column if no data to display" behaviour, and finally you have the state that is saved.

When visibility changes, the state changed and is saved for the next time.

So, when you come back, what to do? Restore from the state but hide empty columns. But... you cannot know if the column has been hidden from the user or if the column was empty

I guess we need an additional layer, and store the user's preference in a separate localStorage item, then merge and then hide if empty

but it's getting complicated, for a single table, especially when I am trying to standardize our DT uses.
Comment 1 Jonathan Druart 2024-11-13 15:27:33 UTC
What do we do? One solution would be to prevent the state to be restored for this table and disable the option from the admin config page.
Comment 2 Jonathan Druart 2024-11-13 15:31:53 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2024-11-15 13:44:08 UTC

*** This bug has been marked as a duplicate of bug 38436 ***
Comment 4 Jonathan Druart 2024-11-19 05:54:18 UTC
Won't actually be fixed on bug 38433.
Comment 5 Michał 2024-11-19 13:56:35 UTC
On that note, as I understand this behavior hasn't been changed so far yet:

> Then you have the "hide the column if no data to display" behaviour

It would be nice if this was re-computed on every page change too.

It's a bit confusing if going to page 2, and certain non-empty columns now remain hidden, because they keep the initial empty column hiding settings from page 1, I know this has confused some users.

And currently the only dirty workaround is to increase how many items are loaded at once and cross fingers that all the used columns won't happen to be empty on page 1 then... But there are very often cases where just a single item would have some column populated in a very long item list, for one reason or another. And that fact would remain completely concealed to the librarian in the default view, even though it's visible in OPAC unbeknownst to them...

If column visibility changing logic is to be re-coded in a more smart fashion, it would be very nice to fix that thing as well at the same time.
Comment 6 Jonathan Druart 2024-11-19 14:29:37 UTC
(In reply to Michał from comment #5)
> On that note, as I understand this behavior hasn't been changed so far yet:
> 
> > Then you have the "hide the column if no data to display" behaviour
> 
> It would be nice if this was re-computed on every page change too.
> 
> It's a bit confusing if going to page 2, and certain non-empty columns now
> remain hidden, because they keep the initial empty column hiding settings
> from page 1, I know this has confused some users.
> 
> And currently the only dirty workaround is to increase how many items are
> loaded at once and cross fingers that all the used columns won't happen to
> be empty on page 1 then... But there are very often cases where just a
> single item would have some column populated in a very long item list, for
> one reason or another. And that fact would remain completely concealed to
> the librarian in the default view, even though it's visible in OPAC
> unbeknownst to them...
> 
> If column visibility changing logic is to be re-coded in a more smart
> fashion, it would be very nice to fix that thing as well at the same time.

This will be fixed on 24.11.
Comment 7 Jonathan Druart 2024-11-20 09:38:59 UTC
Note that bug 38485 is now "storing" user preferences to have a consistent behaviour when pagination is used.