Skip to content

[SPIKE] Show updated time for files #1084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

aaron-collier
Copy link
Contributor

This is a spike on one possible approach to #1061. There is a bit of a challenge in showing meaningful date information with regard to files on a work in H3 as we do not persist them in the database permanently, they are transient for display on the work form.

This approach sets the content_file.updated_at value to the updated_at value of the work. This at least allows the files table to display relatively accurate date content for a file based on the last time the work was deposited or edited.

Then when uploading new files, the updated_at value is accurate to the time the individual file record is created during the work edit session.

The attached screen recording shows that an existing file is displaying a date from yesterday, and then the new file gets the current date and time... And then uploading a file with the same name as the existing file updates it's time to show that it was altered.

This may be an incomplete approach at this time, but shows how we may be able to provide meaningful/helpful information in this way.

Screen.Recording.2025-03-14.at.3.42.56.PM.mov

@justinlittman
Copy link
Contributor

I'd suggest that claiming that the time a file was uploaded is the last time the work was updated is likely to be confusing.

@aaron-collier
Copy link
Contributor Author

Yeah, agree. I'm thinking along the lines of using something at the work level to identify files loaded during rendering of the show page and only display the time for files uploaded during this fit session.

I'm not sure that wouldn't be confusing as well though to only show the time for some files... pondering...

@aaron-collier
Copy link
Contributor Author

I'm thinking if we don't have a file timestamp in cocina we can't really do this without some confusion.

@justinlittman
Copy link
Contributor

One option is to not show a timestamp for the newly uploaded files, just an indicator that it is newly uploaded.

image

@aaron-collier
Copy link
Contributor Author

Yeah, I like that. It avoids needing to do anything in the builder when loading from cocina and just adding an indicator on upload.

@aaron-collier aaron-collier force-pushed the t1061-show-time-for-file-upload branch from 56ed57e to db3a89a Compare July 23, 2025 16:33
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