Skip to content

Refactor: Refactor Chat Store and Hooks #34

Description

@Mine77

Problem

Currently the Cap store manages the state of installed Cap and the current selected Cap.
The chat store manages the state of all the chat sessions.
In order to connect the state of chat sessions and caps, we need to add the cap information the chat session data.
This is also a good time to refactor the chat store and hooks.

Solution

  1. Adding Cap ID and Cap Version metadata to the Chat Session type.
  2. Update the Chat Store for handling the new Chat Session type. Adding new actions if needed. Also make sure the chat store has proper naming and definition of the actions. The naming should be following CRUD pattern.
  3. Update the hooks to use the new store actions. Remove the unused chat hooks.
    4.Update the components to use the new hooks.

Note that currently there is a service logic getting embedded in the chat store: the title generation. This should not be handled by the store and should be explicitely handled by the handleAIRequest function. This is also the same place where the currentCap should be stored into the current chat session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions