Main UI: show last date of last rule modification, sort by date

After switching (mostly) to GUI based rules, I miss being able to go to the rules directory and type “ls -lt” to see which rules I most recently worked on and when. Would it be possible to add a date/time stamp in the Main UI GUI to indicate when a rule was last saved? And would it be possible to add a sort button to show most or least recently modified order?

I have enough rules that it is sometimes difficult to find what I was working on recently when I want to get back to it and make a modification.

Am I alone or would this be useful to others?

Looking at the JSONDB for rules I see that there are not creation or edit timestamps saved so this would require:

  1. update to the JSONDB to save the timestamps
  2. update to the schema returned by the REST API to add the timestamps to the rule info
  3. updates to MainUI to use that information for display and sorting

I’ve always found that using meaningful uids, names, tags, and descriptions coupled with search and the developer sidebar mean I’ve never been lost when it comes to what I’ve worked on and when. I’m not sure I’d find it useful to have a timestamp on a rule beyond idle curiosity (hey! that rule hasn’t been changed in a long time, must have done it right!).

The search field on both the rules page and the developer sidebar will search all of the above. Furthermore, I think OH 4.2 introduces a “filter by tags” option to the rules page so you can just see those rules with a given tag.

The nice thing about the developer sidebar is it searches all OH entities and lets you pin the Things, Items, Rules, Pages, etc. for handy navigation and interaction right there on the side.

The pencil icons will open the page to edit that entity so it’s easy to have and navigate between all the stuff I’m currently working on. Depending on the Item type, semantic tags, and default widget metadata, you can also send commands to the Items from the sidebar or manually run rules, making testing convenient.

For me this is just a different paradigm. I can get to the rules I want to find, but it’s not the same as most everything else that I use a computer for. Every other program I use on the PC has a most recent file list. Word, PowerPoint, Excel, TurboTax, Acrobat - everything has most recent. I’m used to that methodology. Then I flip over to OH to work on rules and that’s gone.

Don’t get me wrong, this is only a minor annoyance and suggestion for improvement. I can work around it, but for me it is a workaround, not the way I would prefer. Not sure if anyone else feels this way.

I think this is an interesting idea, but I’d expand it beyond rules to include any MainUI page. This would be useful if you were carrying out a task that required jumping around a lot (thing, item, sitemap/page, rule, transformation, binding, etc.). I do that a lot when troubleshooting, and it usually takes me a few extra clicks before I realize I should just open multiple tabs.

Perhaps there’s a way to have MainUI cache a list of pages in the browser, or access the browser’s history?

I could see this being a nice quality-of-life addition to the UI.

Do you use the Developer Sidebar? That’s kind of what it’s there for. You can search for and pin any entity except Links and anything defined in Developer Tools (I think) to the sidebar and then use the pencil icon to move between the pages for each. It’s often still handy to have multiple tabs open but it’s a whole lot better than trying to do everything from the one tab without the sidebar.

The approach with the Developer Sidebar is to pin the pages and then you can jump between them as desired.

Beyond that MainUI does maintain a stack of the pages been to. The “< Back” link at the upper left should take you to the previous page you were viewing. It’s not quite the same as access to the full history as if you go back and then forward you lose all the stuff that was on the stack after that point, but it’s better than nothing.

One thing I think would be cool would be a way to save the pinned stuff to a “workspace” in the developer sidebar. Then I could create a “lights” workspace and pin all my lighting related Items, Rules, Things and Pages (etc), another one for HVAC, etc. I can save that set of pinned stuff and restore them later, perhaps even on another machine making it very easy to quickly access everything related to a given topic.

Even today it’s not super hard to set up the set of pinned stuff each time, but it would be super nice if it remembered, particularly if you have a lot of Items or Things that need to be pinned each time.

I admittedly haven’t used it enough to get comfortable with it, in part because I’m still caught midway between MainUI and text files. I really need to find time to complete the jump into full UI.

That is definitely better than nothing. It’s the “back and then forward” part that usually makes me realize I need a new tab.

I tend to think, “hmm, an automation didn’t work just now”, and then I sit down and start working through the rule/item/thing to figure out what happened. Since it’s a reactionary thought process, I don’t start by pinning all of the pages that I think will be involved. That’s where a “recent history” makes life a little easier.

Essentially, I need to be a little more strategic when I start doing something, so that I’ll pin things right off the bat.

I really like this idea, similar to a VS Code workspace.

Does this mean that the developer sidebar can list related pages? So if you’re looking at an item, it would list the rules, groups, thing, transformations, etc. that are directly linked to it, and then you can pin them?

You can still see all your Items, et. al. in the Developer Sidebar even for text file configs. You just won’t be able to edit them.

But when it comes to Pages, those can only be defined through managed configs anyway so it can be used to help with your use case.

Keep in mind you can adjust the pinned stuff as you go. You don’t need to pin everything up front and leave it unchanged. You can add and remove the pinned stuff as needed. It’s quite dynamic in that way.

Assuming the pages, rules, groups, Things, and transformations mention the Item by name. The search looks at the name/UID, label, description, tags, and contents of the entity. It does not follow Links, Group memberships, or stuff like that. It’s not going to find stuff that references that Item indirectly (e.g. you’re dynamically generating the Item name in a Rule or a widget). It’s not going to find it in places where the Item is otherwise dynamically used (e.g. Overview tabs, repeater widgets).

It’s just a text based search.

For example, if I search for my TimeOfDay Item I get the Item, the seven rules that use it and the five scenes that use it. Note that in most of these cases (including the Scenes) the Item is used as the trigger.

But lets say I also know that this Item is also included in the Open door reminder rule, but not by name. I can pin the results of this search and then search for the door rule too.

Once I have a good set pinned I hit “cancel” and I’ll get some nice controls on the pinned stuff.

Clicking the pencil on any of these takes me to that entity’s config page. Items with types and semantic tags that allow sending commands (e.g. Setpoint) can be clicked on and commands sent to the Item right from the sidebar. Rules and Things can be enabled/disabled using the pause icon. Rules can be manually run using the play button. And the UID for any of these can be copied to the clipboard with the copy icon.

If you decide you don’t need something pinned anymore, click the pushpin icon again to remove it from the list. To add something to the list, search for it and pin it just like we did when first starting.

Just about everything in OH supports tags so if you have a collection of stuff that isn’t easy to quickly find and pin, you can give them all the same tag and bring them all up with a simple search.

It would be nice if the sidebar could also bring up the Things associated with an Item but I’m not sure that’s technically feasible. It doesn’t know when you are searching for an Item, it just sees a text string. But you can find the Thing by clicking the pencil icon to get the Item’s page and from there you can see the Link(s) and therefore the Thing(s) the Item is Linked to. If needed, search and pin the Thing at that point.

In general, I find the Developer Sidebar works best when you use it dynamically rather than trying to set something up statically ahead of time. I’m constantly adding and removing stuff from the pinned objects as I work on something. As I find I need something, I search for it and pin it right then and there.

1 Like