-
Notifications
You must be signed in to change notification settings - Fork 805
Realtime percentage of tasks in the tab title #11696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Build Artifacts
|
Thank you, @GarvitSinghal47! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General code approach is sound, but internationalization needs to be addressed. Feel free to follow up if you have any questions about this!
kolibri/plugins/device/assets/src/views/ManageTasksPage/TaskPanel.vue
Outdated
Show resolved
Hide resolved
kolibri/plugins/device/assets/src/views/ManageTasksPage/TaskPanel.vue
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these updates, @GarvitSinghal47! I have not tested this, but it is looking good to me codewise.
One thing I realized when looking through the code just now, is that we do already use the VueJS MetaInfo plugin for setting document.title, and it is possible to use this to do both:
- A reactively updating title using the titleTemplate key: https://vue-meta.nuxtjs.org/api/#titletemplate
- Include the existing title to enhance it and create nested titles, as you are doing here.
If you would rather merge this as in, I'd be happy to file this as a follow up, but wanted to give the option of exploring this if you were interested.
@rtibbles Quick update on the recent changes I made. I managed to get the title updating using the metaInfo approach, and things are looking good. However, there's a tiny hiccup now. It seems that every time the refresh on meta is called, it's updating the title value based on the latest task number ( i think it is just getting it for the all and updating it for each one so get set to last task by default), not taking into account the remaining tasks or change in there percentage value until they are cleared from the page . Unlike the previous approach where it worked smoothly for all tasks. Any ideas on how to resolve this? I'd appreciate your insights! |
Did you try using the That means any logic encapsulated in the computed prop you have created should be the driver of what is displayed. |
kolibri/plugins/device/assets/src/views/ManageTasksPage/TaskPanel.vue
Outdated
Show resolved
Hide resolved
@rtibbles attempted the method you recommended, but the issue persists. The problem lies in the fact that it only considers the most recent changes in the title for the last process . While it updates the title for the last item, it fails to display changes for any preceding ones in the case of multiple processes until the last added process is cleared. |
Oh - I think the issue may be that we are setting the title in the wrong place. We should be doing it within the ManageTasks/index.vue component - where all of the tasks are available. That way you can aggregate across each task and choose the specific one you want to display for in the title. As it is currently in the TaskPanel component, we create an instance of this component for each running task - so they will be fighting it out for who has control over the title! |
This is still not quite what I meant, as issuing the title update from each individual TaskPanel component will still result in 'last updated wins' title updates, which could be unpredictable. Instead, we should be managing this all from within the parent component, and aggregating over each individual task to determine what the overall title should be. If there is only one active task, we should use that for the title, otherwise, we should aggregate over multiple tasks. |
@rtibbles Understood. I'm currently illustrating the percentage changes for each channel individually, but you prefer a consolidated display for all channels rather than showing individual percentages. I'll make this adjustment shortly. However, I have a few questions regarding handling failed tasks. Should I display a fail status at the top only if all tasks fail, or is there another preferred approach? Additionally, for the display format, I'll present it as "percentage - completed" for both import and delete tasks now combined , as for the combined channel name and the type will not matter then i think. Also I noticed that you've assigned the task to yourself, and I want to express my eagerness to continue working on resolving it from my end. If there's no inconvenience, I'd appreciate the opportunity to contribute to finding a solution. |
I have assigned the PR to myself - because I am responsible for reviewing, and we are starting to use assignment to help track who is the responsible reviewer for pull requests - so no worries, I am not taking over! I think maybe there is a prioritization here: If one task has failed, we should display We can then do cancelling and finally cancelled as the prioritization of the remaining displays. |
Just a quick clarification: are you suggesting that in the event of task failures, the display should prioritize showing the number of failed tasks at the top, and specifically adhere to the specified order of presentation, i.e., failed tasks first, followed by percentage changes, and then cancellations? In other words, if there are failed tasks, only showcase them initially, and update the display with percentage changes when they occur. So, if there are failed tasks, should the display remain static with the failed tasks, or should it update to show percentages for tasks that are not failed? |
I think we can have it stay static with failed tasks, and only start displaying progress again when someone has cleared the failed tasks. |
@rtibbles I have successfully implemented the logic, and it is functioning as expected. However, I am currently facing challenges in accessing and utilizing the translations present in the TaskPanel component from the index.vue file. Could you provide guidance on how to achieve this? |
Probably the best thing to do is to move these strings out of the TaskPanel component, and into this reusable common strings translator: https://github.com/learningequality/kolibri/blob/develop/kolibri/plugins/device/assets/src/views/commonDeviceStrings.js They can then be referenced using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good, and manual testing checks out. Thank you!
Fixes: #8011
Summary
Implemented a watch function for real-time tracking of percentage value changes. The document title now dynamically updates based on these changes for a more informative user experience.
…
References
…
Reviewer guidance
…
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)