causalens / dara

Dara is a dynamic application framework designed for creating interactive web apps with ease, all in pure Python.
https://dara.causalens.com
Apache License 2.0
375 stars 9 forks source link

Improvement: DO-3471 - Improved some chat functionality #349

Closed jsumiguin-causalens closed 3 months ago

jsumiguin-causalens commented 3 months ago

Motivation and Context

Currently, the localValue for this component gets reset to props.value. This is okay most times, but if the update of props.value takes a while(i.e. props.value is coming from the backend and we're pushing it to the backend and reloading), this doesn't update the UI until onUpdate finishes.

Added functionality to disable the edit/delete popover as well when using it as non-editable

Implementation Description

Any new dependencies Introduced

N/A

How Has This Been Tested?

Storybook

PR Checklist:

Screenshots (if appropriate):

Before changes:

https://github.com/user-attachments/assets/53855fc2-d5b6-49ba-ab7e-52982ab2d8fa

After changes:

https://github.com/user-attachments/assets/9acaf4a8-1b9d-4655-8193-4b4f45f8f3b8

NOTE: There still seems to be an issue where if there are multiple changes(multiple messages sent) and the process to update is quite slow, there will be a lag behind actually getting the items committed(since the onUpdate fires multiple times for each change). Unfortunately, I don't know how to get around this, but I do know we have a loadingComponent added, which we can utilise on time-intensive requests.