Skip to content

Conversation

@thostetler
Copy link
Member

A larger fix to improve how we do the lazy loading for author and affiliations on the abstract page.

This now moves the transform part into a separate function

Makes the authors list also be properly lazy, and some general clean up along with some more guarding inside the parser

… authors

When documents have partial authors loaded (e.g., 3 out of 2874), clicking
"Show affiliations" was displaying empty affiliation entries for authors
that hadn't been loaded yet. This change implements proper affiliation
slicing and caching to match the loaded author set.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves lazy loading for authors and affiliations on the abstract page to fix issues with empty affiliations being displayed. The changes separate the transform logic into a dedicated function and add proper lazy loading for the authors list.

Key changes:

  • Refactored author/affiliation data processing into a separate updateAuthorAffiliation method
  • Added lazy loading support for partial author data with new fetchAuthors method
  • Enhanced template logic to prevent empty affiliations from being displayed

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/js/widgets/abstract/widget.js Major refactoring of author/affiliation processing logic with new lazy loading capabilities
src/js/widgets/abstract/templates/abstract_template.html Updated template to conditionally show affiliations and display author count information
test/mocha/js/widgets/abstract_widget.spec.js Added comprehensive tests for the new lazy loading functionality
src/shared Updated subproject commit reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

// Explicitly copy full affiliation array before any slicing
const fullAff = freshDoc.aff ? [...freshDoc.aff] : undefined;
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

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

Using undefined as the fallback value is inconsistent with the rest of the codebase where empty arrays are used for missing affiliation data. Consider using [] instead for consistency.

Suggested change
const fullAff = freshDoc.aff ? [...freshDoc.aff] : undefined;
const fullAff = freshDoc.aff ? [...freshDoc.aff] : [];

Copilot uses AI. Check for mistakes.
@thostetler thostetler merged commit 675cd12 into adsabs:master Nov 7, 2025
6 of 7 checks passed
@thostetler thostetler deleted the SCIX-678 branch November 7, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants