eigent icon indicating copy to clipboard operation
eigent copied to clipboard

[ENHANCE] simplify (refactor) chatStore design

Open a7m-1st opened this issue 2 months ago • 4 comments

Motivation

Abstract

  • In our efforts to organize projects based on chatStore #473 , we introduced a decoupled interface.
  • Previously it was chatStore -> tasks[], but now with projectStore it became projectStore -> chatStore[] -> tasks[]

Due to progressive shipping and backwards compatibility, I intentionally didn't touch the chatStore structure. But now perhaps its time to simplify bcz a single chatStore would contain a single task. The old design is absolute.

The bump in the road 🚧

  • Before starting modifying the structure take note of the ghost chatStore👻. It is being created somewhere (try to Replay then log the chatStore) due to the old code structure.
Image

Solution

⚠️ First Solve:

  • Ghost chatStore must be exterminated ❗

Migrate:

  • remove: chatStore.activeTaskId
  • tasks[] -> task
  • update all chatStore usage of chatStore.tasks[chatStore.activeTaskId] TO chatStore.task
  • update some functions in projectStore to use singular task
  • simplify all chatStore functions to use a singlar task design
Image

The frontend result

Image

Alternatives

No response

Additional context

No response

a7m-1st avatar Nov 07 '25 19:11 a7m-1st