-
Notifications
You must be signed in to change notification settings - Fork 750
Vertical layout scopes pane #1575
Vertical layout scopes pane #1575
Conversation
…able for vertical layout. Refactor collapse button code into a PaneCollapseButton component to be reused for vertical layout.
…ent layouts for vertical and horizontal.
jasonLaster
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read this quickly. My first impression is that you came up with many nice naming / components.
I'll study it more later.
jasonLaster
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of comments, but in reality this is a huge step forward. Thanks for doing this. I'd love to formally launch vertical layout.
You and @kdzwinel will get a lot of credit!
src/components/InformationPanes.js
Outdated
| const Breakpoints = React.createFactory(require("./Breakpoints")); | ||
| const Expressions = React.createFactory(require("./Expressions")); | ||
|
|
||
| let { SplitBox } = require("devtools-modules"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: const SplitBox = createFactory(require("devtools-modules").SplitBox)
src/components/InformationPanes.js
Outdated
|
|
||
| let scopesContent = { | ||
| header: L10N.getStr("scopes.header"), | ||
| component: Scopes, shouldOpen: isPaused }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: shouldOpen could be on its own line
|
|
||
| renderHorizontalLayout() { | ||
| return Accordion({ | ||
| items: this.getItems() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be a stretch, but I could see separate pane functions:
renderHorizontalLayout() {
return Accordion({
items: [
this.scopesPane(),
this.framesPane(),
]
})
}
src/components/SourceTabs.js
Outdated
|
|
||
| return dom.div({ className: "source-header" }, | ||
| this.renderToggleButton("start", !this.props.startPanelCollapsed), | ||
| PaneCollapseButton({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be helpful if we added a collapse button for bottom bar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasonLaster Yeah, the button was refactored for that and would go in the CommandBar component for the bottom pane. I had that coded up but with the vertical collapse not yet finished I stashed that till later.
src/components/PaneCollapseButton.js
Outdated
| function PaneCollapseButton({ position, collapsed, horizontal, handleClick }) { | ||
| return React.DOM.div({ | ||
| className: classnames(`toggle-button-${position}`, { | ||
| collapsed, vertical: horizontal != null ? !horizontal : false }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: each field can be on its own line
src/components/PaneCollapseButton.js
Outdated
| function PaneCollapseButton({ position, collapsed, horizontal, handleClick }) { | ||
| return React.DOM.div({ | ||
| className: classnames(`toggle-button-${position}`, { | ||
| collapsed, vertical: horizontal != null ? !horizontal : false }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vertical: horizontal != null ? !horizontal : false can be simplified :)
Perhaps:
- we pass in
verticalto be consistent internally - we use a default value in the params:
PaneCollapseButton({ vertical = false })
src/components/PaneCollapseButton.js
Outdated
| }, Svg("togglePanes")); | ||
| } | ||
|
|
||
| module.exports = PaneCollapseButton; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: PaneCollapseButton could be PaneToggleButton
| L10N.getFormatStr("sources.search", | ||
| formatKeyShortcut(`CmdOrCtrl+${L10N.getStr("sources.search.key")}`)) | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think it would be nice if we had a renderShortcut method to hide this?
src/components/InformationPanes.js
Outdated
| } | ||
|
|
||
| const RightSidebar = React.createClass({ | ||
| const InformationPanes = React.createClass({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, so the more i think about it the more I wonder if InformationPanes is too vague.
My beef with information is largely that it could be applied to anything :)
One thought is that we could refer to the left and right sidebars as primary and secondary panes. At the moment, the left sidebar is just sources, but if I were to bet, it would get other items over time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a particular affinity for the name either, something more descriptive would be good. 👍
src/components/InformationPanes.js
Outdated
| Accordion({ | ||
| items: this.getItems() | ||
| }) | ||
| paneContents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this could be a ternary here
28104a1 to
d20d718
Compare
d20d718 to
0cf4f21
Compare
jasonLaster
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Landing it!
|
added a couple of small stylistic tweaks, but this was so much great work. It was fun to work on this with you, lots of naming and moving things around |
|
@jasonLaster awesome! It's great landing features like this. Glad to work on it. |
* Refactor RightSidebar component into InformationPanes to be more suitable for vertical layout. Refactor collapse button code into a PaneCollapseButton component to be reused for vertical layout. * Rework the RightSidebar into InformationPanes that renders two different layouts for vertical and horizontal. * Code clean-up from review. * Rename InformationPanes to SecondaryPanes * small tweaks
Associated Issue: #1359
Summary of Changes
RightSidebarinto anInformationPanescomponent that renders based on layout typeTest Plan
Example test plan:
Screenshots/Videos (OPTIONAL)