UI Idea to make it easier to port to other platforms

Issue #1016 closed
Samuel Pessorrusso created an issue

Hi folks,

N.I.N.A. is amazing and I love it. The single thing that bothers me is that it runs only on Windows. I know you are using WPF so it will only run on Windows while you are still using this framework.

My suggestion would be to port the UI to something more flexible like a web application.

Pros:

  • Writing HTML pages/application is easy
  • You will be able to run anywhere with a simple web server like nginx or apache
  • The user will not need to install any Remote Desktop/VNC client/server application, a simple browser will do it.
  • You will be able to run pretty much anywhere: raspberry pie, linux/arm, windows, etc. The limit will be just the equipment drivers.
  • No Windows!
  • Stretch: You will even be able to make money selling preconfigured devices by using a free OS (an “asiair” alternative but with N.I.N.A. software!).

Cons:

  • It would not make sense to keep current UI from a maintenance perspective, so this is a major refactoring
  • Need to be well planned to avoid JS/CSS nightmare.
  • UI customization can be tricky, not as easy like today where you can just move things around, it will be needed something like a yaml to define user interface customizations (like it is with Home Assistant) if you want to allow customizations.

Comments (13)

  1. Samuel Pessorrusso reporter

    If you use a modular approach yes it is easy:

    • base framework (JS) to communicate with the server
    • different standalone components(pages) using the base framework to get specific status from the server (one page for the focus, one for the camera, etc…).
    • The whole thing that makes html hard to maintain is when you embed css/js on each page or when you need to build pages with thousand of lines of code.
    • Nine does not even need to think about authentication/security (if someone has access to your local network you have bigger problems), it is really just a view layer communicating with the business layer.

    Anyway, it is just an idea to make an awesome tool more flexible and platform independent, but I know this would be a major refactoring.

  2. Dale Ghent

    Your enthusiasm is admirable, but your unfamiliarity with the internals of the app as it is is showing, and you are making a lot of assumptions in the process.

  3. George Hilios

    Thanks Samuel for the suggestion. This is already on our radar. As Dale mentioned, this is a pretty tall task. There are over 45,000 lines of UI presentation xaml, not to mention the bindings in our MVVM controllers. That said, if this is something you are passionate about we’d appreciate your help doing the large amount of work required to pull this off.

  4. Tom Palmer

    If you head down this path, take a look at React - much more powerful component-based platform for this sort of thing. At least for the front end …

  5. Fortran Ladwin

    This is a TERRIBLE idea for UI.

    Look at the MS Teams (Electron UI) on Linux - it’s crashing, unstable, and even unusable on most Linux platforms (counting how many dists are in use for Linux).

    Why do you guys always think that HTML UI is SIMPLE? It’s never close to simple, with any access to hardware the development experience is nightmare-level. Do you understand how difficult it is to write hardware manipulating code across the OS boundary? That takes tons of people with tons of trouble, not to mention the hell of messy X and Wayland. Windows is still the best platform for any UI application and industrial software at the moment, and I don’t expect this to be changed in the next at least 10 years.

    Flexible comes with a price, and if you want to pay for it you do that. Don’t expect someone else will be paying for that.

  6. Dale Ghent

    The issues around Electron and apps built on that platform are not necessarily indicative of other cross-platform framework tech. I use Teams as well, on macos and windows, and it’s totally junk. But I think that is more of an indication of a crappy implementation of Electron and a poor concept of UX than it being an HTML-based UI. On the other side, we have the Discord client which, while not flawless, it does act more like what one would expect. The team that maintains the client puts an obvious emphasis on UX.

    Eventually, NINA should grow a cross-platform UI framework, but that’s not the only thing that needs to happen for NINA to be cross-platform. There are a lot of Windows-isms in the code that need to be located and and either ported or made more generic. There is also the large undertaking of integrating native INDI/INDIGO support into NINA. So, the UI framework is but one complex component of several complex undertakings that need to happen. The OP’s assertion that it is “easy” is terribly misguided and perhaps reflects experience in already-made environments, not ones such as this.

  7. Ruediger

    There is also the large undertaking of integrating native INDI/INDIGO support into NINA. 

    This is an exciting news!
    This would be a quantum leap forward and push the door wide open for a much wider usage. I’d be so happy if this becomes true.

  8. Dale Ghent

    Don’t get too excited and misunderstand what I wrote 🙂

    I said INDI/INDIGO would need to happen, not that it is happening. This particular topic isn’t being worked on by anyone at the moment. I was only listing it as one of the many things that would have to be done to make NINA x-platform, if it were going to ever become x-platform.

  9. Fortran Ladwin

    On the other side, we have the Discord client which, while not flawless

    It would take you guys way too much time to get to the point where Teams currently is, while Discord takes even more time & money cost. Don’t take it easy because cross-platform GUI application is huge trouble… I have experience with multiple QT apps running cross-plat for factories and a few electron apps, every time it involved anything like direct operation to the hardware (or even the best, some external APIs) it’s always a nightmare…

  10. Linwood Ferguson

    As NOT a NINA developer, a comment: cross platform becomes important when one is after a market, to sell a product. NINA was developed for personal use, and those developers were kind enough to share with the rest of us. I think making a case that it somehow must eventually become multi-platform is difficult, especially given the amount of volunteer labor involved.

    Now arguably one day Microsoft may irritate everyone enough to become a case in itself, that doesn’t seem to have quite happened yet.

    FWIW.

  11. Stefan B repo owner

    Closing the ticket.

    • Way too big of scope for a single ticket
    • Will not happen anytime soon
    • It is on the very very long term goals
  12. Log in to comment