Skip to content

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

Merged
ssciolla merged 36 commits into
mainfrom
arc-149-contents
Aug 17, 2026
Merged

Add contents hierarchy to collection display (ARC-149)#67
ssciolla merged 36 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? (Determined no action was needed. The log message is originating from the below line and just is designed to filter out unneeded parameters before it goes to the search_service. The log message will go away in production.)
    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"} }
    
  • Tidy up show more/ show less (truncation control shows even when it's not needed).
  • Fix indentation
  • Make sure box info is showing up in Contents hierarchy (added this manually. Looks like maybe we could use document actions?)
  • Make interesting(?) items links (items are linked always right now, no counter is in use)
    According to the Claude analysis is_interesting items are linked. Counter is not enabled on label-only items.
    • What's the deal with counters?
      Blacklight uses the counter option in link_to_document for search session tracking. When it's supplied:
      - The generated link includes tracking data with the counter value
      - Clicking through to a record lets Blacklight record which position in the results the user clicked.
      - It powers features on the show page like "« Previous | 123 of 456 | Next »" navigation
  • Auto-expand item with checkbox whenever an item has only one child
  • Requests should be EAD-specific, but persist across collections during session (aeonform.js)
  • Search results should default to "Grouped by collection"

Comment thread app/javascript/aeonform.js
@ssciolla ssciolla added the enhancement New feature or request label Aug 11, 2026
ssciolla and others added 21 commits August 13, 2026 14:22
… in contents hierarchy; add container_types to component EAD config; add needed methods to SolrDocument
…tmap and applications.js, not via manifest.js
… using document actions, for now); make extent data look more like it does in search results
Comment thread app/components/um_contents_document_collection_hierarchy_component.html.erb Outdated
Comment thread app/components/um_contents_document_collection_hierarchy_component.html.erb Outdated
@ssciolla
ssciolla requested a review from rshiggin August 13, 2026 21:05

@rshiggin rshiggin left a comment

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.

Great work!

Comment on lines +308 to +320
class NokogiriXpathExtensions
def is_component(node_set)
node_set.find_all do |node|
component_elements = (1..12).map { |i| "c#{'%02d' % i}" }
component_elements.push "c"
component_elements.include? node.name
end
end
end

to_field "child_component_count_isi" do |record, accumulator|
accumulator << record.xpath("/ead/archdesc/dsc/*[is_component(.)]", NokogiriXpathExtensions.new).count
end

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We needed to add this for the root document, but the ead_component_config has something similar for components using | between all the possible cX values. I wonder if it's possible to do something like that here, but not going to worry about it right now.

@ssciolla
ssciolla marked this pull request as ready for review August 17, 2026 17:07
@ssciolla
ssciolla requested a balanced review from Copilot August 17, 2026 17:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a navigable collection contents hierarchy with Aeon item-request selection and updated collection-page navigation.

Changes:

  • Adds expandable contents hierarchy, breadcrumbs, and sidebar links.
  • Indexes child counts and container types for hierarchy behavior.
  • Adds session-persisted Aeon selections and request metadata.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
lib/um_arclight/traject/ead2_config.rb Indexes top-level child counts.
lib/um_arclight/traject/ead2_component_config.rb Indexes component container types.
config/importmap.rb Pins Aeon and truncation JavaScript.
app/views/catalog/hierarchy.html.erb Selects the contents hierarchy renderer.
app/views/arclight/requests/_aeon_hidden_form_request.html.erb Adds Aeon JavaScript hooks.
app/models/solr_document.rb Adds hierarchy and Aeon metadata helpers.
app/javascript/arclight/truncate_controller.js Detects whether content is truncated.
app/javascript/application.js Loads Aeon functionality.
app/javascript/aeonform.js Persists and submits Aeon selections.
app/helpers/um_arclight_helper.rb Determines component linkability.
app/controllers/catalog_controller.rb Configures breadcrumbs and metadata.
app/components/um_document_component.html.erb Adds breadcrumbs and contents hierarchy.
app/components/um_contents_document_collection_hierarchy_component.rb Defines hierarchy presentation behavior.
app/components/um_contents_document_collection_hierarchy_component.html.erb Renders hierarchy entries and controls.
app/components/um_collection_sidebar_component.html.erb Adds Contents and Access navigation.
app/components/um_breadcrumbs_hierarchy_component.rb Limits breadcrumbs to components.
app/components/um_breadcrumbs_hierarchy_component.html.erb Renders component ancestry.
app/components/um_aeon_request_checkbox_component.rb Defines Aeon checkbox component.
app/components/um_aeon_request_checkbox_component.html.erb Renders request metadata inputs.
app/assets/stylesheets/application.scss Loads contents styling.
app/assets/stylesheets/_search_results.scss Removes obsolete truncator styling.
app/assets/stylesheets/_contents.scss Styles hierarchy and request controls.
app/assets/stylesheets/_collection.scss Updates toolbar and breadcrumb styling.
app/assets/stylesheets/_base.scss Adds sticky toolbar positioning.
Suppressed comments (1)

app/models/solr_document.rb:108

  • This returns the raw multivalued Solr array, so interpolation into the hidden input serializes it with Ruby array syntax (for example, ["Restricted"]) rather than as usable Aeon item information. Join the values before exposing them as a form value.
  def aeon_item_info_1_value
    accessrestrict
  end

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread app/javascript/aeonform.js
Comment thread app/helpers/um_arclight_helper.rb
<input type="hidden" name="ItemSubTitle_<%= document.id %>" value="<%= document.aeon_item_sub_title_value %>">
<input type="hidden" name="ItemVolume_<%= document.id %>" value="<%= document.aeon_item_volume_value %>">
<input type="hidden" name="ItemCitation_<%= document.id %>" value="<%= document.aeon_item_citation_value %>">
<input type="hidden" name="ItemInfo1" value="<%= document.aeon_item_info_1_value %>">

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.

We copied line 8 as it was in original from umich-arclight.
<input type="hidden" name="ItemInfo1" value="<%= document.aeon_item_info_1_value %>">

Comment thread app/models/solr_document.rb Outdated
Comment thread app/components/um_contents_document_collection_hierarchy_component.html.erb Outdated
Comment on lines +14 to +20
<li class="nav-item">
<%= link_to "Contents",
"#{document_path}#contents",
class: 'nav-link pl-0 ps-0 py-1',
data: { turbolinks: 'false' }
%>
</li>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This made sense on first glance, but on testing, things are still working, i.e. they send the user back to the Contents of the root document. This seems to be because of the logic in the sidebar component here: https://github.com/projectblacklight/arclight/blob/105af73da603b337b1f8fa54d76103f34e98350a/app/components/arclight/collection_sidebar_component.rb#L32

Comment thread app/javascript/aeonform.js
@ssciolla
ssciolla merged commit 968f514 into main Aug 17, 2026
4 of 5 checks passed
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.

3 participants