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

Make history persistent #40

Merged
merged 5 commits into from
Dec 5, 2024
Merged

Conversation

0xHumban
Copy link
Contributor

@0xHumban 0xHumban commented Dec 4, 2024

After review of the pull request #39, add feature of the issue #33

Changes:

  • Load chats in the data directory to history at the start of the application
  • When a new chat is created, save in a file
  • Remove default archive file
  • Remove Save history feature (CTRL-S)

Create 'load' function to load the conversation in the archive file to history and call it when application is starting
Add Automatically load the last saved chat into history.
- Load chats in the data directory to history
- When a new chat is created, save in a file
- Remove default archive file
- Remove Save history feature (CTRL-S)
update README with the persistent history feature
src/history.rs Outdated
Ok(_) => {
let notif = Notification::new(
format!("Chat saved to `{}` file", archive_file_name),
format!("Chat saved to `{}` file", file_path.display()),
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe a message like Chat Saved is enough, no need to mention the file

src/history.rs Outdated
Comment on lines 114 to 117
format!(
"Chat loaded in history from `{:?}` files",
directory_path.display()
),
Copy link
Owner

Choose a reason for hiding this comment

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

Same here, just History loaded is enough as a message

Copy link
Owner

@pythops pythops left a comment

Choose a reason for hiding this comment

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

You need to remove the message from help.rs as well

@pythops
Copy link
Owner

pythops commented Dec 5, 2024

Great job 👏

There is few things we can add, maybe in other PR:

  1. Store a date for every chat in history, so when it is loaded you can see when that chat has happened.
  2. Add a keybinding to remove specific chat in history
  3. Add a keybinding to remove ALL the history.

What do you think ?

@0xHumban
Copy link
Contributor Author

0xHumban commented Dec 5, 2024

Great job 👏

There is few things we can add, maybe in other PR:

  1. Store a date for every chat in history, so when it is loaded you can see when that chat has happened.
  2. Add a keybinding to remove specific chat in history
  3. Add a keybinding to remove ALL the history.

What do you think ?

Yes it's a good idea, i created a new issue (#41 ) for this features, if anyone want to make a new PR

@pythops
Copy link
Owner

pythops commented Dec 5, 2024

I will merge this one and we can continue on other PRs
Great job again 👏

@pythops pythops merged commit 0f3181a into pythops:master Dec 5, 2024
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