Giter Site home page Giter Site logo

Improve app notifications/alerts about timelapse HOT 2 OPEN

mre avatar mre commented on May 23, 2024
Improve app notifications/alerts

from timelapse.

Comments (2)

cmangla avatar cmangla commented on May 23, 2024

I think we can start by creating a UI class, so that all notifications and other outputs go through it, and then it can handle them appropriately, and in the future use a different notify implementation.

For example, we might have methods called ui.error, ui.info, ui.debug. Then we could replace, for example,

notify("Timelapse", f"Creating timelapse. This might take a while")
print(' '.join(command))

with

ui.info("Timelapse", f"Creating timelapse. This might take a while")
ui.debug(' '.join(command))

and then, for now, the ui.info implementation can call notify while the ui.debug can call print. In the future, we'll be able to update the implementations with better notifications and logging, etc.

from timelapse.

mre avatar mre commented on May 23, 2024

I like your idea.
If this was an external library, I'd expect a builder pattern like this:

notification = Notify.create()
      .title("Title Text")
      .text("Hello World!")
      .icon('example.png');

notification.show()

This is similar to dorkbox/Notify.
The advantage would be, that we could customize our notification once and use the same style throughout the app.
notify() would then become a wrapper around the builder, that we could maintain inside timelapse. The rest would probably be in a separate library to improve re-usability and avoid close coupling between the components - but this could be done in a next step. 😉

So if you want to work on this and refactor the code a bit, please be welcome to do so.

from timelapse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.