The "Add site" action doesn't work if there is no site
Quick summary
The "Add site" action doesn't work if there is no site.
https://github.com/user-attachments/assets/7b5407c1-f0ef-40ad-8d29-6394175cf2fb
Steps to reproduce
- Delete all sites.
- From the app menu, access File > Add site.
What you expected to happen
The "Add site" modal should open.
What actually happened
Nothing happen.
Impact
One
Available workarounds?
No but the app is still usable
Platform
Windows
Logs or notes
Studio version: 1.0.6 OS: Windows 11
Thanks for reporting this one, @t-hamano! Good catch.
I'm able to reproduce this in Mac, too:
https://github.com/user-attachments/assets/b8c03e3a-d696-499a-aa75-44264f8dc2a7
@wojtekn what is the expected behaviour here? The Add Site opens a very similar form to the onboarding form? In that case, should that shortcut be enabled at all when the screen presented is the onboarding screen?
[...] should that shortcut be enabled at all when the screen presented is the onboarding screen?
I believe this is the way to go - we should disable this item during onboarding.
@katinthehatsite I think it might be better to go with the original approach and disable the menu item during onboarding.
Now, the menu item behaves inconsistently:
- it opens the form when there are any sites already
- it submits the form when there are no sites
@wojtekn I will take a look if this would be possible. Here is some context as to why we decided to handle it differently in the first place:
- we can easily check if the user has any sites created or not (this is the condition that we use to determine if the onboarding screen should be displayed or not) and disable or enable the menu item
Add sitebased on that; - so we can have something like this: the app starts with
Add sitebutton disabled and the onboarding screen if the user has no sites or the app starts withAdd sitemenu item enabled if the user has sites; - the tricky part is when the user starts with onboarding screen and then creates a site without re-starting the app: the top menu is created as a part of the main window so it is already there and it does not dynamically change. This means that we have to somehow re-render the main window so that the topbar menu also re-renders when this condition changes and i have not found a straightforward way to do this yet (I will keep on checking)
- Alternatively, we could avoid re-rendering the main window and the topbar and accept the tradeoff of that menu item not changing dynamically until the app restarts
I investigated some more and will attempt a solution tomorrow