UnknownEnergy / chatgpt-api

https://www.chatworm.com
MIT License
90 stars 18 forks source link

Added saving and loading of chats. #11

Closed deWaardt closed 1 year ago

deWaardt commented 1 year ago

Hi,

I thought this was a very useful feature. I have implemented a messaging service so the contents of the chatbox are available application wide.

After that, I have implemented a method to save and load chats. The elements are fully responsive and I have tried to adhere to your code standards and styled the elements to match your design language.

I will soon make sure it is compatible with dark mode, but for now please check if you like my implementation.

Total list of changes:

Added MessageService

MessageService now contains the message history so it is available application wide. I have modified the chat-container to implement this service.

Added button to toolbar

This button opens the save/load chat dialog

Added save and load chat dialog

Dialog contains mat-accordion with saved chats. Allows updating existing chats as well as deleting chats. Dialog is as responsive as I think is realistic. Dynamically updates max-height to control overflow. Implements messaging service

image

image

image

image

deWaardt commented 1 year ago

Dark mode is not yet implemented.

UnknownEnergy commented 1 year ago

That looks awesome, people already asked for this :) also very good explanation of the pull request. let me take a closer look at it

UnknownEnergy commented 1 year ago

image

I also noticed it is difficult / not usable for our phone users. Inside the Chrome browser you can simulate a phone screen and try it there. I always test with the iPhone SE screen as this one is quite small and should cover most phone users.

deWaardt commented 1 year ago

image

I also noticed it is difficult / not usable for our phone users. Inside the Chrome browser you can simulate a phone screen and try it there

I had the idea of changing the dialog’s layout depending on device. I’ll look at an implementation for this soon!

I’ll take care of your comments as soon as I have time!

UnknownEnergy commented 1 year ago

image I also noticed it is difficult / not usable for our phone users. Inside the Chrome browser you can simulate a phone screen and try it there

I had the idea of changing the dialog’s layout depending on device. I’ll look at an implementation for this soon!

I’ll take care of your comments as soon as I have time!

no stress take your time yes might make sense to do that as we have a lot of phone users this would be needed for them. Awesome work :+1: we should add some credits page will do this in the future then we can add people like you who did some good contribution to this open-source project :)

deWaardt commented 1 year ago

https://streamable.com/2gci4r

I've put in a little effort today to make the dialog more responsive. It's almost working fine on all screen sizes now. I'm a bit short on time, I'll finish it up somewhere next week 👍

UnknownEnergy commented 1 year ago

https://streamable.com/2gci4r

I've put in a little effort today to make the dialog more responsive. It's almost working fine on all screen sizes now. I'm a bit short on time, I'll finish it up somewhere next week +1

looks awesome nice work

UnknownEnergy commented 1 year ago

hey @deWaardt any update on the feature? :D would be cool if we can integrate it.

deWaardt commented 1 year ago

Hey!

I’m sorry, it kinda flew under the radar. I have been very sick for a period and forgot about the project under work stress I had to catch up to.

I will have the feature finished soon, I’m gonna continue working on it this week!

deWaardt commented 1 year ago

I've mostly finalized it, I'm gonna do the finishing touches tomorrow and then I'll post it so you can review it. My brain is still a little cloudy from being pretty sick at the moment so please double check my pull request 😢

UnknownEnergy commented 1 year ago

thank you very much people are already waiting for this in some other feature request it looks awesome :+1: Yes no stress make sure to get well soon best wishes

deWaardt commented 1 year ago

I'm sorry for the delay, I am mostly better now.

I've updated the PR. The background color in dark mode isn't correct yet, I'll correct that ASAP. But please check over the code.

My brain is a bit messy still, I tested it thoroughly and everything seems to work well.

UnknownEnergy commented 1 year ago

yeah take your time just merged it now and will deploy it soon looks good to me