Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Conversation

@g-217
Copy link
Contributor

@g-217 g-217 commented Nov 7, 2019

Adding infobar to tell users, if remote debugging is enabled. This is complementary to brackets-shell PR adobe/brackets-shell#668

Screen Shot 2019-11-07 at 6 11 16 PM

@swmitra
Copy link
Collaborator

swmitra commented Nov 7, 2019

@jha-G I guess warning color from bootstrap would suffice instead of error color. Launch the info bar with update mode, first parameter.

@g-217
Copy link
Contributor Author

g-217 commented Nov 7, 2019

This will be the warning color:
Screen Shot 2019-11-07 at 6 44 12 PM 1

@swmitra
Copy link
Collaborator

swmitra commented Nov 7, 2019

Perfect!

});
}
exports.showUpdateBar = showUpdateBar;
exports.RESTART_BTN_CLICKED = RESTART_BTN_CLICKED;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this code has been copied from AutoUpdate.

It would be better to trim down this file for just the relevant features required, or better yet make a generic InfoBar that can be reused later. Remove/rename any auto update related stuff.

@@ -0,0 +1,20 @@
<div id="update-bar" {{#type}}class={{{type}}}{{/type}} tabindex="0">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename auto update related ids to generic ones.

}
});
}
$(window.document).on("keydown.AutoUpdate", function (event) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename event on all other instances.

src/brackets.js Outdated
brackets.app.getRemoteDebuggingPort(function (err, remote_debugging_port){
if (remote_debugging_port && remote_debugging_port > 0) {
var InfoBar = require('widgets/InfoBar');
InfoBar.showUpdateBar({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again this is context of AutoUpdate. InfoBar.show() would be a better name.

@g-217
Copy link
Contributor Author

g-217 commented Nov 8, 2019

@narayani28 @shubhsnov

Copy link
Collaborator

@swmitra swmitra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks OK to me barring some minor comments and questions.

Comment on lines +1 to +10
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<defs>
<style>
.cls-1 {
fill: #fff;
}
</style>
</defs>
<path id="icon-checkmark" class="cls-1" d="M8,16a8,8,0,1,1,8-8A8.009,8.009,0,0,1,8,16ZM3.823,7.833,2.72,9.044l3.071,3.017a1.852,1.852,0,0,0,.919.265,1.463,1.463,0,0,0,1.132-.547c.494-.568,1.131-1.285,1.643-1.861.408-.459.728-.819.77-.873.09-.113,2.462-2.862,2.732-3.175L11.671,4.661c0,.007-.086.1-.222.266C8.679,8.22,7.187,9.976,7.012,10.147c-.084.081-.142.143-.185.188-.115.121-.13.136-.254.151h-.02c-.169,0-.4-.235-.4-.237Z"/>
</svg>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this being used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have retained all three states for InfoBar, Success, Warning, and Error for sake of completion. So infobar-checkmarkcircle.svg will be used if InfoBar.showInfoBar() is called with success state.

Comment on lines +1 to +10
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<defs>
<style>
.cls-1 {
fill: #fff;
}
</style>
</defs>
<path id="icon-info" class="cls-1" d="M8,17a8,8,0,1,1,8-8A8.009,8.009,0,0,1,8,17ZM6.91,7.056V14H8.968V7.056ZM7.932,3.892a1.077,1.077,0,1,0,0,2.142,1.077,1.077,0,1,0,0-2.142Z" transform="translate(0 -1)"/>
</svg>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info icon background.

Comment on lines +1 to +27
/*
* Copyright (c) 2019 - present Adobe Systems Incorporated. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/

/*info Bar*/
#info-bar-template {
display: block;
background-color: #105F9C;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are few unused selectors. Please clean them up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned unused selectors.

InfoBarHtml = require("text!htmlContent/infobar-template.html"),
_ = require("thirdparty/lodash");

//addLinkedStyleSheet('styles/infobar-styles.css');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment on lines +78 to +85
var $infoBar = $('#info-bar-template'),
$infoContent = $infoBar.find('#info-content'),
$contentContainer = $infoBar.find('#content-container'),
$iconContainer = $infoBar.find('#icon-container'),
$closeIconContainer = $infoBar.find('#close-icon-container'),
$heading = $infoBar.find('#heading'),
$description = $infoBar.find('#description'),
$closeIcon = $infoBar.find('#close-icon');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to find all of these UI components for this use case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, all are used.

var MainViewManager = require("view/MainViewManager"),
Mustache = require("thirdparty/mustache/mustache"),
EventDispatcher = require("utils/EventDispatcher"),
InfoBarHtml = require("text!htmlContent/infobar-template.html"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: Indentation looks off in this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed indentation.

};

resizeContentContainer();
$(window).on('resize.AutoInfoBar', _.debounce(resizeContentContainer, 150));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event name resize.AutoInfoBar doesn't look relevant to Debugger enabled warning!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed the label.

MainViewManager.focusActivePane();
});
}
$(window.document).on("keydown.AutoInfo", function (event) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event name keydown.AutoInfo doesn't look relevant to Debugger enabled warning!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed the label.

@@ -0,0 +1,13 @@
<div id="info-bar-template" {{#type}}class={{{type}}}{{/type}} tabindex="0">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please test tabindex conflict with actual Auto Update notification bars. Auto update notifications should get priority.

// In case of an error
_socket.onerror = result.reject;
});
brackets.app.getRemoteDebuggingPort(function (err, port){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious as to why they check for function definition here? Do we lazyload some modules?

Copy link
Collaborator

@shubhsnov shubhsnov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now 👍

Copy link
Collaborator

@swmitra swmitra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants