mqttui icon indicating copy to clipboard operation
mqttui copied to clipboard

[Feature] Expand all key

Open mahyarmirrashed opened this issue 1 year ago • 3 comments

I searched through https://github.com/EdJoPaTo/mqttui/blob/main/src/interactive/mod.rs#L212-L259, but I couldn't find a key that expands the current subtree recursively. If you can confirm my findings, I think that's a feature that would be handy. I would be open with helping develop it.

mahyarmirrashed avatar Sep 16 '24 19:09 mahyarmirrashed

Yeah, something like that is currently not implemented. Ideally something like this should be implemented directly on the TreeState.

As the TreeState caches the last_identifiers it should be quite easy to put them all into the opened (Similar to close_all which cleans it up).

Adding this is kind of annoying currently as mqttui can't really update ratatui (see #172), but the tree widget is already on a newer version of ratatui. Not sure what the best solution for it might be as I hoped for #172 to resolve at some point of time…

EdJoPaTo avatar Sep 17 '24 22:09 EdJoPaTo

Given that its can result in a huge open tree, the search might be closer to what you are looking for? Personally I don't have a use-case for everything open as that's a huge list for me. Searching for what I am looking for is the more useful approach for me.

I am curious about your use-case where such a feature would be useful to you. It's always interesting to hear how others use mqttui!

EdJoPaTo avatar Sep 17 '24 22:09 EdJoPaTo

First off, love this tool! I've been getting more people at my workplace using it and it's loved a bunch.

We use it primarily to monitor the topics for an MQTT broker that handles self-updating machines on a distributed cluster. We know there are only going to be a few dozen topics, so we are safe to open a subtree recursively if need be.

I did see the draft PR that you have on this repo. However, from what it looks like on ratatui's side, it isn't something that they are going to let pass through very easily.

I'll have time in about two weeks to work on this, though. I'm just going to factory reset my computer and start from scratch in a bit. My system has gotten a bit too cluttered 😓

mahyarmirrashed avatar Sep 17 '24 23:09 mahyarmirrashed

I added an open/close all with the o key in 1c1dd9579583ef1d4bc52c50d4809556e5a2ed36 which was just released with v0.22.0. o Opens all known and O (Shift + o) closes all.

Thanks for suggesting the idea!

EdJoPaTo avatar Mar 01 '25 18:03 EdJoPaTo