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

Statusbar for Brackets #1717

Merged
merged 8 commits into from
Oct 3, 2012
Merged

Statusbar for Brackets #1717

merged 8 commits into from
Oct 3, 2012

Conversation

jbalsas
Copy link
Contributor

@jbalsas jbalsas commented Sep 25, 2012

Adds a bottom status bar in the content area to show general editor settings and other status indicators. This is inspired by this user story https://trello.com/card/2-status-bar-bottom/4f90a6d98f77505d7940ce88/337

NOTES

I'm creating this pull request because I'm not sure about the right process and maybe I'm going a little over my head here... I think it still needs some work and discussion if you'd want to add it, so maybe it would be best if it could be forked and polished to reach a better state before trying to merge it.

INFORMATION

As suggested in the card, the status bar sits at the bottom of the editor and shows the line and column number, number of lines, mode and current tab setting for the current focused editor.

API

exports.showBusyIndicator = showBusyIndicator;
exports.hideBusyIndicator = hideBusyIndicator;

These APIs are a possible solution (at least partial) for the story in this card https://trello.com/card/ui-for-long-running-operatons/4f90a6d98f77505d7940ce88/551. The status bar includes a busy indicator that any module can show or hide through these methods. Additionally, showBusyIndicator takes one optional parameter to set a busy cursor over Brackets until hideBusyIndicator is called.

In this pull request, the Find in Files module has been updated to show the busy indicator and cursor while waiting for the search operation to complete.

exports.addIndicator = addIndicator;
exports.updateIndicator = updateIndicator;

These APIs allow any module to add an indicator on the status bar and update it at any time.

addIndicator takes an id (module.id could be nice) and other optional parameters such as indicator, visible, style, tooltip and command.

updateIndicator takes the same parameters as the other except indicator. It allows to update the values with new ones to change the status indicator appearance and behavior.

  • If a DOM element indicator is passed, it will be added to the status bar. Otherwise, an empty span will be used.
  • The visible parameter sets the initial indicator visibility
  • The style parameter indicates a class to style the indicator
  • The tooltip parameter is set as the indicator title so that it appears as a tooltip when the mouse is over it
  • The command parameter indicates a function to be called on click over the indicator. (It could be used to show/hide the JSLint errors panel decoupling this from the enable/disable action as outlined in https://groups.google.com/forum/?fromgroups=#!topic/brackets-dev/PqEbuhw7k6c

In this pull request, and just as a test for the API, the JSLintUtils module has been updated to add and update the indicator at the statusbar instead of at the toolbar. Also, the UpdateNotification module has been updated to show the gift icon as a status indicator.

KNOWN ISSUES

  • The style for the status bar and the busy indicator are in serious need of a makeover :)
  • The information fields were not fully working with inline editors, so I didn't take them into account for now. Is it possible that inline editors are not triggering the cursorActivity event?
  • Indicator commands are not implemented waiting further discussion.
  • The addIndicator and updateIndicator APIs could be improved for better flexibility.

Sorry for the long and booring post :)

PS: Although not yet finished, the status bar also comes in a Brackets Extension flavour https://github.com/jbalsas/brackets-statusbar-extension ;)

Add/Update Indicator API in StatusBar
JSLintUtils indicator
UpdateNotificatino indicator
Find in files shows busyIndicator
@njx
Copy link

njx commented Sep 25, 2012

@jbalsas -- this is totally sweet. We literally just got out of our planning meetings for the next sprint, and one of the tasks we added was for a status bar :) We mainly wanted to add it to support adding a simple switcher for spaces vs. tabs, so what you've got could be a great start.

We'll try to do a closer review over the next few days and suggest improvements if any. Thanks!

@njx
Copy link

njx commented Sep 25, 2012

BTW, you can see a mockup that @GarthDB made for the status bar in the Extension UI Guidelines doc on the wiki: https://github.com/adobe/brackets/wiki/Extension-UI-Guidelines (search for the "Status Bar" section). Aside from the internal layout/positioning of the items in the status bar, the main differences are in the background color, font size and vertical padding. Probably worth tweaking those simple visual issues first--the internal layout stuff is probably a bigger question that's worth some discussion.

@GarthDB
Copy link
Member

GarthDB commented Sep 26, 2012

I'll try and take a look at the request and your current UI sometime tonight.

Sent from my iPhone

On Sep 25, 2012, at 4:56 PM, Narciso Jaramillo notifications@github.com wrote:

BTW, you can see a mockup that @GarthDB made for the status bar in the Extension UI Guidelines doc on the wiki: https://github.com/adobe/brackets/wiki/Extension-UI-Guidelines (search for the "Status Bar" section). Aside from the internal layout/positioning of the items in the status bar, the main differences are in the background color, font size and vertical padding. Probably worth tweaking those simple visual issues first--the internal layout stuff is probably a bigger question that's worth some discussion.


Reply to this email directly or view it on GitHub.

@njx
Copy link

njx commented Sep 26, 2012

The busy indicator is cool too. @GarthDB, do we have artwork for a spinner handy? (SVG preferably so we can scale it.) We could add a simple animation to rotate it, and start/stop it when we show/hide it.

@GarthDB
Copy link
Member

GarthDB commented Sep 26, 2012

There is a design done for reflow. I'll look into it.

Sent from my iPhone

On Sep 25, 2012, at 6:19 PM, Narciso Jaramillo notifications@github.com wrote:

The busy indicator is cool too. @GarthDB, do we have artwork for a spinner handy? (SVG preferably so we can scale it.) We could add a simple animation to rotate it, and start/stop it when we show/hide it.


Reply to this email directly or view it on GitHub.


function _updateCursorInfo() {
var cursor = fullEditor.getCursorPos(),
cursorInfo = "Line " + (cursor.line + 1) + ", " + "Column " + (cursor.ch + 1);
Copy link
Member

Choose a reason for hiding this comment

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

Externalize string, Line {0}, Column {1}

Copy link
Member

Choose a reason for hiding this comment

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

It seems like the cursor movement/statusbar updating feels a little laggy on my 2012 macbook air. Especially when scrolling down by holding the down arrow. I tried using webkitRequestAnimationFrame but that only helped slightly. Are you seeing any issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks good to me... I'm on an old Macbook Pro (2007 I think...), with Mac OS X 10.7.4.

I've noticed it lags when I have some other panels such 'Find in Files' with many results opened, but then so does everything else...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe it has something to do with https://github.com/adobe/brackets-shell/issues/61 ?

@ghost ghost assigned jasonsanjose Sep 29, 2012
@jasonsanjose
Copy link
Member

Reviewing

$(fullEditor).off("cursorActivity", _updateCursorInfo);
}

fullEditor = EditorManager.getCurrentFullEditor();
Copy link
Member

Choose a reason for hiding this comment

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

This probably has something to do with #1257, but we should put a comment here about supporting inline editors.

Copy link
Member

Choose a reason for hiding this comment

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

I just saw the note in the description about supporting inline editors. It's still worth putting a comment here in the code as a reminder.

@jasonsanjose
Copy link
Member

Initial review complete. Hopefully this is mostly just cleanup and not a ton of refactoring. Our goal is to merge this in as soon as possible to unblock the tabs/spaces story https://trello.com/c/exOQhrGw. If you're too busy to take on these code review changes, we can also help.

Thanks for the great contribution. The timing couldn't be better.

@jbalsas
Copy link
Contributor Author

jbalsas commented Oct 2, 2012

I'm attending tomorrows hackaton in London. Hopefully I'll be able to go through all the review changes there ;)

@jasonsanjose
Copy link
Member

@jbalsas I'm not going to be in London, but please introduce yourself to the team that's there. Maybe @peterflynn, @njx or @gruehle will pick up the review or I can finish it tomorrow as well.

@gruehle
Copy link
Member

gruehle commented Oct 3, 2012

Looks great! Thanks for the contribution. Merging.

gruehle added a commit that referenced this pull request Oct 3, 2012
@gruehle gruehle merged commit 4c7b775 into adobe:master Oct 3, 2012
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.

5 participants