ErwinKomen / RU-passim

0 stars 0 forks source link

Wrap-up: Functionalities: MS Search Slider Bars #717

Closed shariboodts closed 9 months ago

shariboodts commented 10 months ago

Based on example: https://passim.rich.ru.nl/manuscript/list?usersearch=9818 (Manuscripts > Collection/Dataset… > Historical Collection > Wolfenbüttel (irisdenis))

Part one of the issue:

Part two of the issue:

Screenshot 2024-01-29 at 11 40 34

NOTE: If this requires too much work, then we choose just one option > percentage will then only apply to the source item (HC, specific manuscript, PD (AF)).

So (overview):

o Manuscript comparison keep o Historical Collection keep (same as HC/Manu overlap? We need clarification!) o PD: Manuscript discard o PD: Sermon manifestation discard o PD: Authority file keep o HC/Manu overlap can be discarded (is this one indeed redundant?)

Part three of the issue:

ErwinKomen commented 9 months ago

Looking into part 1

  1. Question: what does the slidebar do?
    1. Location: ManuscriptListView
    2. Note: there is only one slider defined
      1. The defined slider's info should be made visible. It says: Percentage overlap between the Historical Collection SSGs and the SSGs referred to in the manuscripts
      2. The fact that four sliders are visible is a bug

Implementation notes

  1. Fixing visibility from occurring in four places to occuring in just one place, i.e. the part of the head_id, which is filter_collection:
    1. Corrected basic_list, which shows hidden (head_id) just anywhere (line 269, 'show the different filters in the list')
    2. Removed a superfluous hidden head_id line in ManuscriptListView
    3. This resulted in the slide bar only occurring inside the Collection part
  2. The visibility of the sliding bar is as follows:
    1. It is shown by itself, if HC/Manu overlap is selected
    2. it is automatically included, if any of the following are selected: Manuscript comparison, Historical collection, PD Authority file
    3. It is not shown automatically when these are selected: PD Manuscript, PD Sermon
  3. Location of the slider in the listview: it is filter collection_hcptc
    1. It makes use of dbfield hcptc, which is a non-existing field
    2. The actual overlap is calculated in the view's method adapt_search(), looking for overlap and making use of get_overlap_ptc()
    3. This shows that via field manu_colloverlaps the model CollOverlap is used.
      1. That model contains combinations of: 'collection', 'manuscript', 'overlap'
      2. The percentage taken there is determined by taking the HC as a starting point, and counting the number of SSGs matching an item from the HC.
      3. However, I need to check whether the set of SSGs that are 'part of' a manuscript is calculated correctly
        1. Yes, get_overlap() correctly calculates this, taking the HC as a starting point
      4. But when is get_overlap() actually called?
        1. Well, it is called whenever a comparison (with slider) is being asked for.
    4. Okay, I double checked, and the table CollOverlap is filled completely correctly.
    5. But the culprit is this: the calculation of the Q-expression in fields['overlap'] in method adapt_search() in the Manuscript list view. That did not include the list of collections with which a comparison is made, nor the user's profile.

Comment on part 1

The wish of the user was:

The user should be able to specify: 95% of the manuscript content vis-à-vis the HC OR 95% of the HC content vis-à-vis the manuscripts.

Well, there is one slider, and it has just one function in relation to the HC/Manu overlap when a HC is selected. And that one function is just one of the two above: the percentage of the manuscript content w.r.t. the HC. E.g: 70% of the HC's authority files occur in each of the manuscripts in the output. For Wolfenbuttel that would yield just 3 results (manu 1779, 7788 and 7217)

ErwinKomen commented 9 months ago

Part 2 - what is already there

  1. Three types of comparison are already possible via slider bars:
    1. Compare AF-content of HC with manuscripts (a) and vice versa (b, see part 1) image
    2. Compare AF-content of one manuscript with other manuscripts image
    3. Compare AF-content of Personal Dataset (AF) with manuscripts image
ErwinKomen commented 9 months ago

Part 2 - cleanup

  1. I removed the HC/Manu overlap button, since it only shows the slider
    1. Implementation: add "hide_button": True in table filters and process this in basic_list.html
  2. Discarded:
    1. PD: Manuscript discard
    2. PD: Sermon manifestation discard

Final checking

  1. When "Comparative search..." is clicked, the slide bar must also always disappear.
    1. This is now not happening in the following situation:
      1. Click "Comparative search"
      2. Perform a Historical collection or Manuscript comparison using a particular percentage
      3. Click "Comparative search" again.
    2. Resolution: hide the class of range input items in filter_click()
ErwinKomen commented 9 months ago

Part 3 - other

  1. Made range slider show percentage on moving
    1. See basic.js, trick was 'input' event
  2. Changed slider value description
  3. Possibility to select manuscripts: made it work as in the DCT example
ErwinKomen commented 9 months ago

Leftover

  1. Not implemented is the option to calculate the percentage the other way around.