Comment by luke-stanley
Comment by luke-stanley 21 hours ago
A hierarchical progress bar service is a cool idea in principle, for some tasks state is worth decoupling from process memory. I do note that the homepage example changes colour without real hierarchy shown though! Something worth noting, is that the hierarchy of an important task of some kind might not be known at the start. It's interesting to consider how to have a great developer UX for managing this. I'd probably want MCP support (or a boring OpenAPI). If someone can show in a few lines how a developer can have a messy process get meaningful hierarchy and progress added to it and it's child nodes, without being overly rigid or SaaS externality concerns, that would be really cool, it could perhaps help give feedback on some very intractable problems. People often don't realise that showing useful progress can easily be a really hard distributed systems problem that a lot of real life systems are bottlenecked by. It's interesting that LLMs might actually be able to help ask questions about progress to help better represent what progress should be shown as, asking about subproblems, helping guide the state with structured decision making etc.
Interesting! I agree that nested / hierarchical progress is not straightforward. Even if all child problems are known, the weighting between their individual progress to compute the overall, aggregated parent progress is not easy to determine as it depends on the relative complexity of the child tasks. Perhaps an LLM could help here, but it would have to know the detailed scope of each task it is tracking. Alternatively, pbar could allow users to set their own weights for each sub-bar, so they could integrate their own logic or an LLM to do that. I didn’t want this to become complex in any way though. I therefore opted to do the same as tqdm. A parent progress bar simply counts how many of its children bars are fully completed. It will show 90% progress if 9 out of 10 child tasks are done, even if the last task takes much longer than the others. You can try it e.g. by making nested loops using the tqdm wrapper.