Giter Club home page Giter Club logo

Comments (12)

Glavin001 avatar Glavin001 commented on July 22, 2024
  • Loading AKA "Beautification in progress..."
  • Errors
  • Unsupported language

from atom-beautify.

jamhall avatar jamhall commented on July 22, 2024

I was quickly looking into this.

Two options that I've found (many possibilities) and tested:

https://github.com/CodeSeven/toastr

Include toastr.js in the lib directory and toastr.css in the stylesheets directory. Add jquery as an npm dependency:

toastr = require "./toastr"
toastr.error "There was an error beautifying <b>/tmp/test/fixtures.sql</b>. The command <b>sqlformat</b> was not found.", "Atom beautifer"

Result:

beautifier-toastr

Another more atom-integrated solution is to use: https://github.com/tcarlsen/atom-message-panel

    messages.add new PlainMessageView(
      message: "There was an error beautifying <b>/tmp/test/fixtures.sql</b>. The command <b>sqlformat</b> was not found."
      className: "text-error"
      raw: true
    )

Result:

beautifier-atom-message-panel

Personally, I prefer the second solution; especially for error messages. I also don't think it's a nice idea to include jquery as a dependency (unnecessary bloat)

Anyway, some food for thought :-)

from atom-beautify.

Glavin001 avatar Glavin001 commented on July 22, 2024

Thanks for doing some research, @Flukey.

I have not seen the Toastr before. Looks nice! How did you include a Bower dependencies? Normally Atom restricts access to client-side libraries.

I have used Atom Message Panel before and I'd prefer to have something a little nicer and more customizable for this.

Using SpacePen you can easily build nice panels, such as deprecation notice and append them to the top of the workspaceView, and for easier developing Atom Preview now supports SpacePen previewing.

Personally, I prefer the second solution; especially for error messages. I also don't think it's a nice idea to include jquery as a dependency (unnecessary bloat)

jQuery is at the core of Atom's SpacePen, so you should not have to include it. You should be able to use {$} = require 'atom'.

I will be throw some screenshots here when they're ready to get some feedback :).

from atom-beautify.

Glavin001 avatar Glavin001 commented on July 22, 2024

I think you have a good idea with those because you could list off multiple errors and other messages, versus only one at a time. I'll keep that in mind when designing the Atom Beautify interface.

  • Support listing multiple messages
  • Clear messages on close view
  • if the messages list is empty, view should be closed
  • addMessage and clearMessages API

from atom-beautify.

Glavin001 avatar Glavin001 commented on July 22, 2024

How about something like these?

image

from atom-beautify.

Glavin001 avatar Glavin001 commented on July 22, 2024
  • Change close button to clear, which will execute clearMessages and consequently close the view

from atom-beautify.

Glavin001 avatar Glavin001 commented on July 22, 2024

I think I will go with Atom Message Panel for now, until we've fleshed out what features we want in the Message View. It can always be updated later, the important thing is having a view to better display these errors and other messages.

Current screenshot of work-in-progress:
image

from atom-beautify.

Glavin001 avatar Glavin001 commented on July 22, 2024

For Beautification in progress message:
image

from atom-beautify.

Glavin001 avatar Glavin001 commented on July 22, 2024

Published Beautification in progress message and Unsupported language messages (using Atom Message Panel) to v0.7.0

from atom-beautify.

Glavin001 avatar Glavin001 commented on July 22, 2024

This can be deprecated in favour of Atom Notifications!

Update: Since I still want to see beautification progress (start and completion), the currently implemented UI for showing that a beautification is in progress can stay. Errors and other notifications can use Atom Notifications. This is already being done for deprecate method in Beautifier class (See #282).

Given that the beautification progress UI is already implemented and the Atom Notifications can be used for everything else, this issue can be closed.

from atom-beautify.

Glavin001 avatar Glavin001 commented on July 22, 2024

Should go migrate off of Atom Message Panel to Atom Notifications.

from atom-beautify.

Glavin001 avatar Glavin001 commented on July 22, 2024

Removed old Atom Message Panel related code with 1dfac5b

from atom-beautify.

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.