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

feat: edit multiple files #22

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ca-d
Copy link

@ca-d ca-d commented Dec 13, 2024

No description provided.

@ca-d ca-d requested a review from JakobVogelsang December 13, 2024 04:33
@ca-d
Copy link
Author

ca-d commented Dec 13, 2024

This still needs the tests fixed.

@danyill
Copy link

danyill commented Dec 14, 2024

Thankyou for this! 💌

It might be nice if 'Rename file' is greyed out when there is no change to the file or extension:

image

If one opens a file which already exists in OpenSCD with the same file name, what is the correct behaviour?

@danyill
Copy link

danyill commented Dec 17, 2024

If one opens a file which already exists in OpenSCD with the same file name, what is the correct behaviour?

How about a toast that notifies the user if a new file is opened and the old file is renamed with a counter appended on the end.

@danyill
Copy link

danyill commented Jan 30, 2025

I've rolled this into our distribution for testing and find it to be very delightful 👍

The only additional thing which might be nice would be to copy the present file to another file and hold it in memory, but perhaps that is an anti-pattern (?).

It would be nice for functionality, like "create a copy within OpenSCD and do a compare to show the changes"

@danyill
Copy link

danyill commented Feb 3, 2025

I've rolled this functionality into our distribution for some early testing and to enable testing the comparison/diffing plugin.

In particular I created a snapshot plugin which takes a copy of the existing document and adds a timestamp to the name so it can be used to compare files. See here.

I did this by mutating this.docs to add the additional documents because I did not want to use the OpenEvent which also selects the new document to the current document.

https://github.com/OpenEnergyTools/open-scd-core/blob/main/API.md#openevent

Perhaps we could consider (either as part of this PR or a separate issue) have an argument as to whether the document should be opened or made the current document.

@ca-d
Copy link
Author

ca-d commented Feb 10, 2025

Do you require this for SCL documents as well, or only for support documents?

Perhaps we could consider (either as part of this PR or a separate issue) have an argument as to whether the document should be opened or made the current document.

@danyill
Copy link

danyill commented Feb 10, 2025 via email

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