Skip to content
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

Add a "Add from template" page for the semantic model #2105

Merged
merged 12 commits into from
May 31, 2024

Conversation

JustinGeorgi
Copy link
Contributor

This is the second of my suggested additions for helping new users.

This adds a button and new sub page to the semantic model. On that sub-page the user can select from a few different basic templates for semantic locations which can then be automatically created and added to the model.

There are a few options for customization:

  1. The user can select a custom prefix that will be applied to all the items to fit or establish a desired naming scheme (or just differentiate between two different semantic dwellings if this is a multi dwelling OH instance)
  2. The user can optionally deselect extra pieces of the model that are not appropriate to their needs.

image

image

@JustinGeorgi JustinGeorgi requested a review from a team as a code owner October 2, 2023 03:02
@relativeci
Copy link

relativeci bot commented Oct 2, 2023

#1990 Bundle Size — 10.63MiB (+0.1%).

7301adb(current) vs 5ae3e37 main#1987(baseline)

Warning

Bundle contains 2 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes
                 Current
#1990
     Baseline
#1987
No change  Initial JS 1.86MiB 1.86MiB
No change  Initial CSS 607.87KiB 607.87KiB
Change  Cache Invalidation 19.42% 17.8%
No change  Chunks 223 223
No change  Assets 246 246
Change  Modules 2884(+0.14%) 2880
No change  Duplicate Modules 149 149
No change  Duplicate Code 1.85% 1.85%
No change  Packages 97 97
No change  Duplicate Packages 2 2
Bundle size by type  Change 2 changes Regression 2 regressions
                 Current
#1990
     Baseline
#1987
Regression  JS 8.81MiB (+0.12%) 8.8MiB
Regression  CSS 891.48KiB (+0.06%) 890.94KiB
No change  Fonts 526.1KiB 526.1KiB
No change  Media 295.6KiB 295.6KiB
No change  IMG 140.74KiB 140.74KiB
No change  HTML 1.24KiB 1.24KiB
No change  Other 871B 871B

Bundle analysis reportBranch JustinGeorgi:jag-sm-templateProject dashboard

@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels Oct 3, 2023
@ghys
Copy link
Member

ghys commented Oct 9, 2023

Thank you for this!
It isn't what I had in mind (a multiple-step wizard with simple options) but it could do the job.
I think we should indeed offer the option only when the model is empty, so it could be added as a button to the empty state placeholder (under the "Start Modelling your Home" blurb) instead of an in-your-face dialog box ("There is no semantic model. Create model locations from template?").

In any case I'm good with adding this feature early even as a "beta" feature, even if we revisit it later, it is a net benefit (as it's meant to be used just once so there's no regressions to keep in mind).

@JustinGeorgi
Copy link
Contributor Author

I think we should indeed offer the option only when the model is empty

That was my first intention as well, but on further thought I wondered whether 1) it's better for a user to still be able to find it after they've made a couple of their own test semantic elements 2) the available templates could be expanded in the future to be more than just this initial setup.

I'm not convinced either way is better, so I'm happy to go back just available when the model is blank.

@JustinGeorgi
Copy link
Contributor Author

Something like this?

image

@ghys
Copy link
Member

ghys commented Dec 20, 2023

Sorry for not following up lately @JustinGeorgi.
I think the goal now would be to target it for 4.2 - and it's not all that bad, it allows us some time to get it just right.
This would be be an important feature, I think, so we shouldn't rush it.

@ghys
Copy link
Member

ghys commented Dec 20, 2023

Something like this?

image

I would simply name the button 'Get Started'. And then you would have something to.... well, get started, like a wizard.

I wondered whether 1) it's better for a user to still be able to find it after they've made a couple of their own test semantic elements 2) the available templates could be expanded in the future to be more than just this initial setup.

This is also interesting, but is it worth the drawback though? (I would rather like a new user to easily figure out what to do).

@JustinGeorgi
Copy link
Contributor Author

Sorry for not following up lately

No worries at all. It's a busy time for everyone.

I would simply name the button 'Get Started'.

Done.

This is also interesting, but is it worth the drawback though?

It should be easy enough to go back and expand it to be available more generally if it winds up being a frequently used/popular option, so leaving it just as a start for now is fine by me.

@florian-h05 florian-h05 requested a review from ghys February 26, 2024 14:55
@florian-h05
Copy link
Contributor

@ghys Can you please review this PR, since it seems you have a vision how it could look which I don't have?

@ghys
Copy link
Member

ghys commented Mar 25, 2024

sorry @florian-h05 (and @JustinGeorgi) for not following up. My "vision" of sorts was that the first-time model setup could be a wizard (like the one you get when starting the instance for the first time) with several steps asking you very practical (as opposed to technical) questions:

https://community.openhab.org/t/getting-started-with-oh3-rewriting-the-tutorial-6-model-your-home-with-items-link-channels/101008/6

I felt that this:

image

could be too complicated when you discover OH as a first-time user and therefore too confusing.

Now I'm not likely to back it up with an actual implementation of this "vision" so I'm just okay with anything easing the onboarding process.

I also saw this video: https://www.youtube.com/watch?v=iOOdFyh2keY where he tries to get openHAB up and running in 30 minutes with no prior knowledge, it was pretty interesting. This should be a must-watch I think when thinking about ways to improve the onboarding.

@ghys
Copy link
Member

ghys commented Mar 25, 2024

My point really was that sometimes you have to design screens for people who know their way around and others for people who don't. I felt it was a case of the former when it should have been the latter.

@JustinGeorgi
Copy link
Contributor Author

sorry for not following up.

No worries, @ghys! Honestly, I've got so many other things going on right now, I had forgotten about this one too.

My "vision" of sorts was that the first-time model setup could be a wizard (like the one you get when starting the instance for the first time) with several steps asking you very practical (as opposed to technical) questions:

That's fine too. I'll admit, however, that I personally have no instinct at all for what that series of "practical questions" might be other than "Do you have a kitchen?", etc. At that point, that's no different than the series of checkboxes, so clearly you've got something in that's a completely different approach.

My point really was that sometimes you have to design screens for people who know their way around and others for people who don't.

If the "Item Name Prefix" section is too intimidating (and I can see that), that's easy to hide behind an advanced options toggle like so many of the other dialogs.

In the end though, we can shelve this if you don't see a way to salvage it.

@ghys
Copy link
Member

ghys commented Mar 27, 2024

In the end though, we can shelve this if you don't see a way to salvage it.

I wouldn't dare shelve it as it's a clear UX improvement, and I recognize the good work that you made.

In fact it could coexist with the "wizard" that I eventually would like to see. When both are available we could have some sort of menu which asks you whether you prefer this "create locations from template" page (which assumes you know what the model and locations are) or the full wizard.
In the meantime we can clearly add your page.

Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.
Really nice addition!!

I have done a few minor changes:

  • Fix styling of the add from template page for narrow screens (fix padding).
  • Minor code improvements, including disabling the erroring ESLint rule for the affected line.
  • Rename the button from "Get Started" to "Add Locations from Template".
  • Set category/icon for the template Items, just looks nicer afterwards.

@florian-h05 florian-h05 changed the title New add from template page for semantic model Add a "Add from template" page for the semantic model May 31, 2024
@florian-h05 florian-h05 added this to the 4.2 milestone May 31, 2024
@florian-h05 florian-h05 merged commit aa4e218 into openhab:main May 31, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants