Skip to content
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

Add last edit time to documents #1423

Closed
vkbo opened this issue Apr 24, 2023 · 9 comments · Fixed by #1510
Closed

Add last edit time to documents #1423

vkbo opened this issue Apr 24, 2023 · 9 comments · Fixed by #1510
Assignees
Labels
enhancement Request: New feature or improvement next release Note: Features planned for next release project management Component: Project or Project Tree

Comments

@vkbo
Copy link
Owner

vkbo commented Apr 24, 2023

It would be useful to record the last edit time for documents. This has been suggested before, but not been added.

The edit button at the top of the document editor is pretty much redundant now as all it does is change the label. The position could instead be used for a button that opens a hover box with details about the document, including when it was last edited. This would also be a new usage of the fuzzy time function that already exists.

@vkbo vkbo added the enhancement Request: New feature or improvement label Apr 24, 2023
@vkbo vkbo added this to the Future Release milestone Apr 24, 2023
@vkbo vkbo self-assigned this Apr 24, 2023
@HeyMyian
Copy link
Contributor

Will this be the "Date modified" of the file on disk, or the true last modification time of the document within novelWriter? I find that information valuable as well, but unfortunately lost it a couple of times because my files were newly synchronized (from GitHub or otherwise) with the current date. So that would be neat to have as accurate metadata within novelWriter.

@vkbo
Copy link
Owner Author

vkbo commented Apr 26, 2023

The file meta data is far too unreliable for this. I will definitely track it in novelWriter itself.

@HeyMyian
Copy link
Contributor

HeyMyian commented May 2, 2023

Do you also consider adding the document creation date?

@vkbo
Copy link
Owner Author

vkbo commented May 2, 2023

Yeah, I may as well when I'm adding the update date.

@vkbo vkbo added project management Component: Project or Project Tree next release Note: Features planned for next release labels May 7, 2023
@marek-lach
Copy link

I would only add that some software doesn’t use a precise date like Last updated 10/05/2023, but a more general way, such as: Last updated today, Last updated yesterday, or Last updated 2 weeks ago for example. It may be prefferable to give the user some choice over how to display such information.

@vkbo
Copy link
Owner Author

vkbo commented May 22, 2023

Currently, novelWriter displays the exact date with the relative date in brackets, like on the build tool. If I'm keeping the relative date for this feature, I will still display the exact date. I personally find relative dates rather useless on their own. I always opt out if it replaces exact dates.

@vkbo
Copy link
Owner Author

vkbo commented Aug 25, 2023

So, PR #1509 updates the document file meta data to the following:

%%~name: Making a Scene
%%~path: 6a2d6d5f4f401/636b6aa9b697b
%%~kind: NOVEL/DOCUMENT
%%~hash: 053cc65631403c15ddc112849dc7fcae44eb9d63
%%~date: Unknown/2023-08-25 16:56:11

The hash value is the sha1 hash of the text, and is used to check against overwrites of files that have changed outside of novelWriter. The date value consist of creation date before the slash and update date after it. The date is only updated if the hash changes, so it's a more accurate change date than the file system's modified date.

Of course, for existing documents, the creation date is unknown. I cannot extract it either based on file system info, because zipping, copying, git, etc can all modify that date. It will only be added to new documents created after this is released,

I'll add a GUI box to display this information as well.

@HeyMyian
Copy link
Contributor

Is it possible to open existing nwd files in an external editor and manually edit the dates in?

@vkbo
Copy link
Owner Author

vkbo commented Aug 26, 2023

Sure, you could do that. Just make sure to use the same version of the ISO8601 date format. Otherwise it may not display correctly on the GUI.

@vkbo vkbo linked a pull request Aug 30, 2023 that will close this issue
6 tasks
@vkbo vkbo closed this as completed Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request: New feature or improvement next release Note: Features planned for next release project management Component: Project or Project Tree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants