Skip to content

Proof of concept: speed up tree view by loading item info from a JSON API

Josh Wier requested to merge 20220517-jww-speed_up_tree_view_poc into master

Speed up the "Inventory" tab's tree view by:

  • Loading items from a JSON API. The old version rendered HTML on the server side, seemingly with a lot of overhead.
  • Only loading 100 results at a time. For nodes with more than 100 children, pagination will appear.

This code is messy. The old code (both the Arclight parts and the parts we added) was too, but these additions are even messier. Since this project already uses Vue, the entirety of context_navigation.js would best be rewritten using Vue. Barring that, my code could definitely use a pass of name changes and function break-up.

Other changes in this branch, all of which are separable, with some effort:

  • When visiting the permalink for a Series or Subseries (e.g., /catalog/ms3548aspace_ref81_zoq), the tree view shows only the descendants of that node. The old version (when it worked) showed the hierarchy from the top of the collection down to the chosen series or subseries, with the chosen series or subseries highlighted. The old behavior is hard to reconcile with pagination (What if some intermediate node is not on the first page of its parent's children?), but it could be done.
  • The "Request Box ..." buttons have been moved, mostly to demonstrate that the new code can wrap all items that are in the same physical container within a <div>, allowing for more styling options. This change could easily be reverted, but I think it looks good, except for collections where most items are available both physically and online (e.g., David Lewis Earnest photograph collection).
  • I've added some border lines and tweaked some margins to go with the above change. All of this can easily be reverted.
  • I've attempted to fix the breadcrumb links for Subseries/Items. But this is a hasty fix, so it may have broken some cases I don't know about.
  • Made a change to the "aeon-info" metadata that seems to make it pass eadid to cart correctly on series/subseries pages
Edited by Josh Wier

Merge request reports

Loading