Open jbilcke-hf opened 2 months ago
I have implemented a first version for the segment resolution task, but it is lacking some color I think (it's still monochrome in case of error, instead of being red/orange)
Hi, I found the same when generating videos: if an error is thrown while building the video, the dialog is stuck and no way to close it, so is a blocker for users; I found the solution by wrapping the main call with try/catch and using task.fail(), but it keeps showing the toast with the success message.
Please, could you tell where is the segment resolution task fix ? thanks!
in the "resolveSegment" function which is on the client side, there are now two tasks:
entityTask
(to track the progress and status of entity generation) and resolutionTask
(to track the progress and status of generation)
https://github.com/jbilcke-hf/clapper/blob/main/packages/app/src/services/resolver/useResolver.ts
Note that there is a special visibility
field which is used to control the visibility of a task (since we might have a lot of short tasks eg. storyboards)
but in case of error I think we want to always display the error toast (this is normally already implemented)
the idea for this visibility field is to give us the flexibility and freedom to display a toast or not, depending on the importance of a task, have some blocking tasks (eg. MP4 export) and even have some tasks fully running in the background
there is also a button in the bottom toolbar, to display a list of pending tasks, but I haven't worked a lot on this
Context
We need to display error messages to the user
it's a blocker for users but not for developers, who can always look at the browser console (for client-side errors) and the NextJS console (for server-side error)
I propose to wrap calls to the various APIs using the task manager
it is able to handle both visible and invisible tasks, short or long-running
Solution
What needs to be done is to:
useTasks()
in the code base)useTasks
might have to be modified a bit)