octo icon indicating copy to clipboard operation
octo copied to clipboard

Bug: The "New" button does not work

Open davidmyersdev opened this issue 1 year ago • 2 comments

Summary

After starting a conversation with the Assistant, the "New" button does not work. You have to navigate to another page (such as the history page) and then click "New" from there.

Steps to reproduce

  • Navigate to /assistant
  • Start a conversation (requires an OpenAI API token)
  • Click "New"
  • Nothing happens

davidmyersdev avatar Aug 18 '24 18:08 davidmyersdev

would this one have conflicts? low hanging fruit.

3thanHead avatar Aug 18 '24 21:08 3thanHead

@3thanHead this one should be safe to pick up!

davidmyersdev avatar Aug 22 '24 01:08 davidmyersdev

@davidmyersdev technically, since this view is used to create a new conversation, wouldn't there be no need for a "New" button here, since it would only redirect to the same page. All it currently does is increment the query string: https://github.com/davidmyersdev/octo/blob/main/components/AssistantContainer.vue#L12 https://github.com/davidmyersdev/octo/blob/main/composables/useSoftNavigation.ts#L8

The conversation isn't started and available in history until the first message is sent. Does removing the "New" button on the assistant view solve the issue?

3thanHead avatar Aug 29 '24 04:08 3thanHead

For posterity, @3thanHead and I discussed in person that the bug here happens only when a new conversation is started and the page is not reloaded. For more context, the useSoftNavigation feature was originally implemented to prevent the URL change from re-rendering the page components. This happened due to a previous hack I had in place where URL changes would force pages to re-render. I believe removing that hack is what broke this functionality.

davidmyersdev avatar Sep 02 '24 18:09 davidmyersdev

Understood. Played around with this a bit. If I remove this watcher (https://github.com/davidmyersdev/octo/blob/main/components/AssistantContainer.vue#L14-L20) and add redirect with vue router instead when message is submitted, bug is solved. Putting PR up for this.

3thanHead avatar Sep 02 '24 18:09 3thanHead

Fixed in #302! Thanks so much @3thanHead! 🎉

davidmyersdev avatar Oct 17 '24 02:10 davidmyersdev