Skip to content

Add contents hierarchy to collection display (ARC-149) - #67

Draft
ssciolla wants to merge 14 commits into
mainfrom
arc-149-contents
Draft

Add contents hierarchy to collection display (ARC-149)#67
ssciolla wants to merge 14 commits into
mainfrom
arc-149-contents

Conversation

@ssciolla

@ssciolla ssciolla commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

To Do

  • Add Contents to sidebar navigation
  • Add Aeonform functionality - see inventory of Aeon code in umich, especially aeonform.js https://mlit.atlassian.net/browse/ARC-161
  • Fix navbar styling
  • Investigate wrapping of Javascript (IIFE) (can we remove it?) Yes. With current modules method not necessary, but good to have for standalone js.
  • Finalize JS loading pipeline
  • Fix strong parameters?
    Unpermitted parameters: :contents, :key, :paginate. Context: { controller: CatalogController, action: hierarchy, request: #<ActionDispatch::Request:0x0000000126c232c0>, params: {"contents" => "true", "key" => "-document", "paginate" => "true", "controller" => "catalog", "action" => "hierarchy", "id" => "umich-bhl-032"} }
    
  • Make interesting(?) items links (items are linked always right now, no counter is in use)
  • Tidy up show more/ show less (truncation control shows even when it's not needed).
  • Fix indentation

@rshiggin rshiggin Aug 10, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What changed and why

  • jQuery removed entirely
  • turbolinks:load → turbo:load. Turbolinks is gone in Rails 8.
  • navigation.contains.elements → turbo:frame-load. In ArcLight 1.x, contents pagination arrives via turbo-frames, so turbo:frame-load is the correct replacement.
  • Event delegation replaces per-element binding. The new model: one listener on document, forever, when you click a checkbox, the change event fires on the checkbox, then bubbles up through every ancestor: label → div → body → document. A listener anywhere on that path hears it.
  • Event delegation instead of per-element binding. One change listener on document replaces BindEvents()/SelectCheckbox binding to each checkbox and the data-initialized guard. New checkboxes work automatically.
  • CSS.escape() used when building the value selector in restoreCheckboxes, preventing breakage/injection from special characters in identifiers.
  • harvestItemMetadata uses a dirty flag to save state only once (old buildCollectionItemsMap called saveCollectionItems() inside the loop on every item).
  • Removed sessionSave utility and its null-removal branch; saving is now inline in saveState.
  • Constants CHECKBOX_SELECTOR and FORM_ID replace repeated string literals.

Net effect: same behavior and storage format, but dependency-free, Turbo-compatible, more robust to dynamically loaded content, and safer/cleaner.

@ssciolla ssciolla added the enhancement New feature or request label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants