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

[CLOSED] console error indicator for status bar #6874

Open
core-ai-bot opened this issue Aug 30, 2021 · 30 comments
Open

[CLOSED] console error indicator for status bar #6874

core-ai-bot opened this issue Aug 30, 2021 · 30 comments

Comments

@core-ai-bot
Copy link
Member

Issue by zaggino
Friday Apr 25, 2014 at 04:11 GMT
Originally opened as adobe/brackets#7639


Old Subject: error icon for main-toolbar

This is something I've made out of need when working with Brackets especially on non-brackets projects (when I don't have my Brackets developer console open) to see if something wrong happened inside Brackets immediately.

From my experience many users don't use console to look for errors before reporting an issue so having a red icon appearing on the main toolbar might help also to non-developers.

Leaving to your consideration if this's a good idea for a default extension, or if I should move it to the extension registry. I'm fine with both.

Looks like this:
image


zaggino included the following code: https://github.com/adobe/brackets/pull/7639/commits

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Friday Apr 25, 2014 at 18:32 GMT


@zaggino This is pretty cool. We talked about it in the team meeting today, and would need to see the following changes for this to go into master:

  • Move it to the status bar which is a more appropriate place for this
  • While this is great for devs, we're concerned that this could be disconcerting to users that aren't Dev Tools savvy, so it should have a Debug menu command to toggle it on/off and the default is off.
  • This seems to fit with DebugCommands, so merge it there

Of course, you're welcome to keep it as it is and release it as an extension, but this would be great to have in core Brackets.

At one time, Brackets had an option to "open dev tools on exception". It would be nice to have something like that again. This would also need to have toggle switch. If you want to try to get this working, be sure to test case when dev tools window is already open, the existing window should be re-used (and optimally brought to front) instead of opening new window (which was a problem with original feature).

@core-ai-bot
Copy link
Member Author

Comment by zaggino
Saturday Apr 26, 2014 at 06:51 GMT


@redmunds take a look now please if this's what you've meant
image

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Saturday Apr 26, 2014 at 21:12 GMT


@zaggino Nice! We'll have to get@larz0 to give it a UX review.

Seems like it should get inserted at left end (of the status bar indicators on the right side) so all other indicators are not shifted when it's toggled on/off.

Not sure if you have access to a Windows system, but hit the Insert key and watch how the INS/OVR indicator does a single pulse when it changes. That might help you notice when error number is incremented (but it might have to be debounced in case where several errors come in very quickly).

I like how clicking on the status bar indicator opens Dev Tools. The mouse pointer should change to a hand in the hover state.

It might be nice to have a way to clear the count. I could see wanting to do that if you've looked at the console log and understand all the errors, then you could clear the count so it's easier to tell when new errors happen.

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Saturday Apr 26, 2014 at 21:58 GMT


You could also event console.clear() to reset the count.

@core-ai-bot
Copy link
Member Author

Comment by larz0
Monday Apr 28, 2014 at 20:04 GMT


@zaginno I agree with@redmunds that it should be on the left end. I can't get the error count to show in the status bar for some reason despite having errors in dev tools.

From the screenshot you provided looks like we could use a space after ":".

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Monday Apr 28, 2014 at 20:20 GMT


@larz0 He already added the space in 24be428

@core-ai-bot
Copy link
Member Author

Comment by larz0
Monday Apr 28, 2014 at 20:23 GMT


@SAPlayer ahh awesome!

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Monday Apr 28, 2014 at 20:27 GMT


@larz0 In the Debug menu, toggle it on with "Show Errors in Status Bar".

I wrote a simple extension that adds a "Randy Test" item to Debug menu and causes an exception every time you click it:

/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50, regexp: true */
/*global define, brackets, $, window */

define(function (require, exports, module) {
    "use strict";

    var CommandManager      = brackets.getModule("command/CommandManager"),
        Menus               = brackets.getModule("command/Menus");

    function randyTest() {
        // Force an exception
        Menus.nonExistentFunction();
    }

    CommandManager.register("Randy Test", "randy-test", randyTest);

    Menus.getMenu("debug-menu").addMenuItem("randy-test");
});

@core-ai-bot
Copy link
Member Author

Comment by zaggino
Monday Apr 28, 2014 at 20:27 GMT


@larz0 have you turned it on in Debug menu? It won't show without it. I'll move it to the left.

Btw is it a good thing that status bar dissapears when viewing images or no file is open?

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Monday Apr 28, 2014 at 20:42 GMT


@zaggino The current design is to only show status bar for files being edited (not viewed). Not sure if we've considered any other designs.

@core-ai-bot
Copy link
Member Author

Comment by larz0
Monday Apr 28, 2014 at 20:45 GMT


@redmunds thanks that worked.

@zaggino we can show the status bar in image view if there's a need for it. Right now the info we get above the image is enough.

@core-ai-bot
Copy link
Member Author

Comment by zaggino
Monday Apr 28, 2014 at 22:40 GMT


comments implemented, you can clear now with console.clear as suggested by@SAPlayer

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Tuesday Apr 29, 2014 at 01:52 GMT


@larz0 This is ready for another review.

@core-ai-bot
Copy link
Member Author

Comment by larz0
Tuesday Apr 29, 2014 at 02:41 GMT


@zaggino@redmunds looks good! Just realized that we should probably add a tooltip that says something along the lines of "Show Errors in Dev Tools…".

@core-ai-bot
Copy link
Member Author

Comment by zaggino
Tuesday Apr 29, 2014 at 03:18 GMT


It won't navigate you exactly to the errors so just "Show Developer Tools" would probably be more accurate description of the click action?

@core-ai-bot
Copy link
Member Author

Comment by larz0
Tuesday Apr 29, 2014 at 03:24 GMT


@zaggino sounds good. Remember the "…" because it goes to a different window.

@core-ai-bot
Copy link
Member Author

Comment by zaggino
Tuesday Apr 29, 2014 at 03:30 GMT


Yes, added.
image

@core-ai-bot
Copy link
Member Author

Comment by larz0
Tuesday Apr 29, 2014 at 03:36 GMT


@zaggino looks good!

@redmunds review complete.

@core-ai-bot
Copy link
Member Author

Comment by njx
Tuesday Apr 29, 2014 at 17:47 GMT


This is really cool. I had a UI idea: what if instead of blinking the number, we did a background fade like the INS/OVR status bar field does? i.e., set the background to red and fade it out. I could imagine doing the same thing for the JSLint icon too - when the panel is closed I often don't notice when the icon turns yellow.

@larz0 what would you think of that? It would make those status bar indicators all very consistent with each other, which I find very appealing.

@peterflynn pointed out that the main issue with this is that if the text is red as well as the initial background color, then you wouldn't be able to read it at first - so we'd need to pick a background color that wasn't exactly the same as the text (or the same yellow as the warning icon in the JSLint case).

@core-ai-bot
Copy link
Member Author

Comment by njx
Tuesday Apr 29, 2014 at 17:48 GMT


Also@zaggino - we talked about making it so the error indicator shows errors even from before you toggle it on - would that be possible?

@core-ai-bot
Copy link
Member Author

Comment by larz0
Tuesday Apr 29, 2014 at 18:46 GMT


@njx sounds good. We can use #ffb0cd, the same color we used for input error glow.

@core-ai-bot
Copy link
Member Author

Comment by zaggino
Tuesday Apr 29, 2014 at 23:51 GMT


fade in/out done,@larz0 please take a look

@njx If you check it on in the Debug menu, it'll show errors immediately from the moment the default extension is loaded, even after Brackets restart - is that what you've meant?

It won't catch errors that happen before the debug extension is loaded, for that to happen we'd need to put the code to a different place, ideally before anything from brackets gets loaded.

@core-ai-bot
Copy link
Member Author

Comment by larz0
Wednesday Apr 30, 2014 at 02:10 GMT


@zaggino it's not fading out for me. The flash class persists.

@core-ai-bot
Copy link
Member Author

Comment by zaggino
Wednesday Apr 30, 2014 at 04:11 GMT


That's weird, I've tested it again and it works for me :-/
Can anybody else try/suggest what might be wrong?

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Wednesday Apr 30, 2014 at 04:32 GMT


@larz0@zaggino The flash works correctly for me (Win7).

@core-ai-bot
Copy link
Member Author

Comment by larz0
Wednesday Apr 30, 2014 at 05:21 GMT


@zaggino@redmunds my bad, it works. It was due to one of the extensions I have; haven't identified which extension though.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Wednesday Apr 30, 2014 at 21:47 GMT


This looks good. Just a couple last comments.

@core-ai-bot
Copy link
Member Author

Comment by zaggino
Wednesday Apr 30, 2014 at 22:49 GMT


Fixed@redmunds

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Wednesday Apr 30, 2014 at 23:23 GMT


Thanks! Merging.

@core-ai-bot
Copy link
Member Author

Comment by sixertoy
Sunday Aug 31, 2014 at 17:49 GMT


screenshot
Hello :)

I'm looking for Menus.getMenu
But i found this issue, so... i've finished a logger panel based on brackets-console (see readme details) wich doesn't seems to be maintained anymore like another extension wich on is completly broken and unsable, so what i grab opportunity to share my own dev

https://github.com/malas34/brackets-console-plus

not yet in brackets repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant