We already use Zustand to manage context for PV updates, which works pretty well as a widget only rerenders if the PV it subscribes to re-renders.
This only happens though on runtime mode (LiveWidget.tsx).
During editMode we use a standard React Context, and this makes a huge part of the app to re-render whenever something on the global context changes.
This decreases performance, and is noticeable for example on delays when switching between selected widgets for example.
Proposed fix: move everything to zustand store management.
It will envolve a considerable code reorganization, but may AI help us on that!
We already use Zustand to manage context for PV updates, which works pretty well as a widget only rerenders if the PV it subscribes to re-renders.
This only happens though on runtime mode (LiveWidget.tsx).
During editMode we use a standard React Context, and this makes a huge part of the app to re-render whenever something on the global context changes.
This decreases performance, and is noticeable for example on delays when switching between selected widgets for example.
Proposed fix: move everything to zustand store management.
It will envolve a considerable code reorganization, but may AI help us on that!