The goal of this ticket was to create an example of a citation popover triggered by clicking on a BoundingBox.
To achieve this, I made the following changes:
Created a new CitationPopover component that:
Exists in the example app portion of the repo, not the library
For each bounding box in a citation, displays a BoundingBox which triggers an Ant Popover on click
Popover displays a paper's title, authors, year, and abstract
If a URL exists for the paper title, the title is displayed as a link that opens in a new tab on click
If a URL exists for any of the authors, their name is displayed as a link that opens in a new tab on click
Author name list is formatted with commas and the word "and" where necessary. Formatting rules are the same as for ScholarPhi author lists.
Added an example of using the CitationPopover in the main Reader app:
I replaced an older example with red bounding boxes with this new example
BoundingBox is displayed over a real citation example, but the popover displays obviously fake test data that will be replaced in the sample data ticket
Styling:
BoundingBox example is styled to look exactly like in ScholarPhi: dotted underline, light blue background, slightly darker background on hover, cursor pointer on hover.
CitationPopover example is styled to roughly resemble the popovers in ScholarPhi but is missing a lot of detail. When we use this library is S2 these popovers will be replaced with our CLPopover component which we can style as we see fit.
Added temporary data types that will be overwritten once https://github.com/allenai/pdf-component-library/pull/29 is merged. Added a TODO in the data types regarding keeping Author ID which I did not add in the data model ticket.
Testing Plan
Manual testing:
BoundingBox for popover is displayed where expected and styled like ScholarPhi
Ant Popover is displayed on click. Popover shows paper title with a link that opens in a new tab on click, author names with links that open in new tabs on click, paper year, and abstract. Popover is styled similarly to ScholarPhi but not exact
Tested that all other menu items work as expected (zoom in/out, rotate CW/CCW, outline, highlight overlay, text highlight, scroll to figure).
Description
Ticket: https://github.com/allenai/scholar/issues/28698
The goal of this ticket was to create an example of a citation popover triggered by clicking on a
BoundingBox
.To achieve this, I made the following changes:
CitationPopover
component that:BoundingBox
which triggers an Ant Popover on clickCitationPopover
in the mainReader
app:BoundingBox
is displayed over a real citation example, but the popover displays obviously fake test data that will be replaced in the sample data ticketBoundingBox
example is styled to look exactly like in ScholarPhi: dotted underline, light blue background, slightly darker background on hover, cursor pointer on hover.CitationPopover
example is styled to roughly resemble the popovers in ScholarPhi but is missing a lot of detail. When we use this library is S2 these popovers will be replaced with ourCLPopover
component which we can style as we see fit.Testing Plan
BoundingBox
for popover is displayed where expected and styled like ScholarPhiDemo