fix 5310 : show social links bar on non-scrollable item pages#5315
fix 5310 : show social links bar on non-scrollable item pages#5315tdonohue merged 16 commits intoDSpace:mainfrom
Conversation
nwoodward
left a comment
There was a problem hiding this comment.
Thanks for this PR @guillermo-escire. It works very well for items with little metadata that don't require scrolling.
One issue is that it changes the behavior on the homepage. On main when I scroll down to the footer the AddToAny links disappear and the COAR Notify logo and link are visible. But on this PR branch the AddToAny links stay at the bottom of the page and cover up COAR Notify. I think that is fine for items with little metadata, but is it possible to restore the original behavior on /home?
And this is only my personal opinion, but I don't think the AddToAny links are necessary on the homepage, because to me they are for sharing links to items/publications/etc.
|
Hi @nwoodward, thanks for the detailed feedback! You're absolutely right — the issue on the homepage was caused by always applying the floating style, which made the social links overlap the footer. I've updated the implementation so that the Regarding your point about the homepage, I agree that social links may not be strictly necessary there. For now, I've focused on restoring the original behavior to avoid regressions, but I'm happy to adjust further if needed. I'll push the update shortly. |
|
Hi @guillermo-escire. Thank you for looking at this again. I think something went wrong with the most recent commit, because now the AddToAny buttons are permanently under the footer at the bottom of the page on all items and
|
|
Hi @nwoodward, thanks for testing this again! You're right — the issue was caused by the AddToAny plugin not re-evaluating layout changes after the floating style was applied dynamically. I've now updated the implementation to reinitialize the AddToAny plugin after detecting scrollability, so it correctly recalculates its position. I'll push this fix shortly — please let me know if it works as expected after that. |
… when page is not scrollable
|
Hi @guillermo-escire. Thank you for continuing to work on this. I'm sorry that it is taking so much effort. I redeployed locally, and the AddToAny links appear on small and large item pages, as well as |
|
Hi @nwoodward , thanks for testing and your patience! I was able to reproduce the issue. It was caused by AddToAny not recalculating its position after the DOM update, so the bar never disappeared. I've now fixed it by reinitializing AddToAny after detecting scrollability. This restores the floating behavior, and the bar no longer overlaps the footer. I've pushed the update, could you please verify if it works correctly now? |
|
@guillermo-escire : I tested this today, and this doesn't appear to fix #5310. With this PR in place, the behavior is similar to
We need to find a way for this social links bar to appear on a non-scrolling page without it hiding footer content. That likely means one of the following:
Overall, I'm not sure what is easiest. I'm just trying to brainstorm possible solutions. |
|
Hi @tdonohue, thank you for the suggestions! I went with the last option you mentioned: embedding the social links bar permanently inside the footer. This way the bar is always visible on all pages, including small item pages that do not scroll, without overlapping any footer content. I also centered the bar for a cleaner look that fits better with DSpace's footer style. Could you please test and let me know if this works for you? |
|
Thanks @guillermo-escire ! I've tested the new view and this is what I see:
I think this new view works, but I'd prefer if the buttons were on the right side of the footer (above the COAR Notify icon in this example). As a sidenote, I just realized there's also another display that AddToAny recommends documented on this page: https://www.addtoany.com/buttons/customize/floating_share_buttons Currently, in Instead of putting these buttons in the header (where you need to potentially scroll down to see them), we could look at using the vertical share bar approach and dock it to the right side of the user's screen. So, it'd be the same display as on the AddToAny page above, except it would appear on the right side of any content. Something like this mockup:
If we go with the vertical bar, we'd just need to make sure it never overlaps with the header. So, it would need to float to the right of the content, near the top of the content. Personally, I'd have a slight preference towards seeing if we can get the vertical bar to work (as it'd always appear on the page in the same place for both long pages and short pages). But, if that is problematic, embedding it in the footer is also OK with me. @nwoodward : Do you have any strong preferences between these two screenshots? |
|
As a sidenote, I've looked into the Codecov report for this PR and I think it's a false positive. For some reason, in this PR, CodeCov is saying the coverage is decreasing by 0.66%. But, if you visit the report on codecov.io for this PR, it says the PR's own coverage is at 100%. So, I'm not sure how overall coverage can decrease in a PR with 100% code coverage. Therefore, I think we can safely ignore the failure in this PR from Codecov. |
|
Hi @tdonohue , Thanks for the notes! I think the new view works well, and I prefer the vertical bar docked to the right. It stays visible on both long and short pages without overlapping the header, making it cleaner and more user-friendly than placing it in the footer. Thanks! |
|
Thanks for checking it out @tdonohue ! I agree: it looks like a false positive from Codecov. Since the pull request itself shows 100% coverage for the changes. |
tdonohue
left a comment
There was a problem hiding this comment.
👍 Thanks @guillermo-escire ! I think this design looks great! I like having this social links bar floating on the right vertically. I've also verified that it looks good on all pages (including non-scrollable ones). So, I'm going to merge this immediately.
Thanks also for your many refactors to this PR as we figured out the best display. I think it was worth it in the end.



References
Fixes #5310
Description
The Social Links bar was only visible on pages that required scrolling. This fix detects whether the page is scrollable and adjusts the AddToAny plugin behavior accordingly, so the bar appears on all pages including short Item pages.
Instructions for Reviewers
List of changes in this PR:
In social.component.ts: Added AfterViewInit lifecycle hook that detects whether the current page has a scrollbar by comparing document.body.scrollHeight vs window.innerHeight. Injected ChangeDetectorRef to force re-render after the check, since the component uses OnPush change detection.
In social.component.html: Made data-a2a-scroll-show attribute conditional. If the page is scrollable, the original 0,60 value is used. If the page has no scrollbar, the attribute is omitted so the AddToAny plugin displays the bar immediately without requiring a scroll event.
Include guidance for how to test or review your PR. This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.
How to test:
addToAnyPlugin:
socialNetworksEnabled: true
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.