Skip to content

Conversation

@johrstrom
Copy link
Contributor

Here's a first pass at the events widgets - #4632.

Things to note are:

  • Currently filtered by time - could list all events with some pagination.
  • note all the TODOs in the file.
  • These are cached for a week - that could be too aggressive.

Copy link
Contributor

@Bubballoo3 Bubballoo3 left a comment

Choose a reason for hiding this comment

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

A few suggestions here, one direction that will be interesting to explore (not sure if it is feasible for 4.1) would be updating the cache in the background instead of expiring it all at once, so that events would only have to load once even if they are posted a month in advance. There may be better cache approaches we can take but the load time is the biggest drawback at the moment IMO, even if that only happens once a week.

<%= javascript_include_tag('nsf_access_events', nonce: true) %>

<div id="nsf_access_events">
Loading...
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this is a good place for that shared spinner component mentioned in #4354.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those are full page spinners, but yea, we could have a small spinner here in the HTML.


function widgetHeader(){
const header = document.createElement('div');
header.textContent = 'NSF ACESS Events';
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a typo probably? I imagine some centers, where being part of ACCESS is more front and center, might want the title to be 'Upcoming Events' or something similar. Do we have any widgets that accept arguments from the YAML?

It also seems to me like the title should be part of the partial instead anyway so that you know what it is as it loads and can decide whether to wait or not. I could go either way on that though as I imagine the ambiguity would fade after seeing it a few times.

Finally, we may want to left-align the title to stay consistent with other widgets. Just looking at how it meshes with my current MOTD, though if we have no convention for widget alignment it isn't a big deal

Image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a typo probably?

Yes it is.

I imagine some centers, where being part of ACCESS is more front and center, might want the title to be 'Upcoming Events' or something similar. Do we have any widgets that accept arguments from the YAML?

We can probably use a localization. As a first pass, it's easier to just reset the entire innerHTML than append children, but I can take a crack at it.

Finally, we may want to left-align the title to stay consistent with other widgets.

I can do that, sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

As a first pass, it's easier to just reset the entire innerHTML than append children, but I can take a crack at it.

That absolutely makes sense, and I guess I just wanted to start the conversation about how we might go about it. For example even appending has its issues, as you may have to strategically place where you append it to stay in chronological order. I think the most important aspect is just that we refresh the cache invisibly, so that you are never waiting on the API, it just happens in the background and might change (or fully update) the list.

@github-project-automation github-project-automation bot moved this from Awaiting Review to Changes Requested in PR Review Pipeline Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Changes Requested

Development

Successfully merging this pull request may close these issues.

4 participants