Skip to content

chore: refactor ai suggestion state

Illya Klymov requested to merge xanf-refactor-state into main

Related issue: feat: AI Assisted Code Suggestions: Provide a q... (#809 - closed) Related issue: feat: AI Assisted Code Suggestions: Improve UX ... (#786)

The thing which started as "straightforward" ai suggestion state now quickly grows out of control feat: AI Assisted Code Suggestions: Provide a q... (#809 - closed) implies to add new "temporary disabled" state, making it even more complicated

This MR refactors state management, introducing several "layers" and explicitly declaring logic how they are merged to visible state which is displayed at bottom toolbar:

  • 1️⃣ global state. Affects entire app. Currently it is on/off in settings, but soon "temporary disabled" state wil be added
  • 2️⃣ document state. Currently represented by boolean flag "is document supported or not"
  • 3️⃣ "flash" state describing current operation - loading/error belongs here

I expect even more states to be added soon, like "Enabled, but not having seat assigned" so acting early on this one

Edited by Illya Klymov

Merge request reports