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

Messages shouldn't overwrite by default #564

Closed
richawo opened this issue Sep 30, 2023 · 1 comment · May be fixed by #566
Closed

Messages shouldn't overwrite by default #564

richawo opened this issue Sep 30, 2023 · 1 comment · May be fixed by #566
Assignees
Labels
Enhancement New feature or request

Comments

@richawo
Copy link
Contributor

richawo commented Sep 30, 2023

Is your feature request related to a problem? Please describe.

def handle_save_message(self, json_path):
    if json_path == "":
      json_path = "messages.json"
    if not json_path.endswith(".json"):
      json_path += ".json"
    with open(json_path, 'w') as f:
      json.dump(self.messages, f, indent=2)

    display_markdown_message(f"> messages json export to {os.path.abspath(json_path)}")

Right now, the messages overwrite by default when no path is provided. That shouldn't be the case. You could lose conversations by mistake - especially without warnings in place.

Describe the solution you'd like

I'd prefer that the saved by date, and an incremental suffix.

Describe alternatives you've considered

Considered just added a warning to prevent overwriting but that is a lot of friction for every time you want to save quickly. The best user experience is storing a new json, especially since they aren't large files it's fine. We can even add a simple cleanup command if needed.

The warning can still be added but this will only be when you type in the same file name.

Additional context

No response

@MikeBirdTech
Copy link
Collaborator

Closing this stale issue. Please create a new issue if the problem is not resolved or explained in the documentation. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants