Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Vertical layout scopes pane#1575

Merged
jasonLaster merged 5 commits into
firefox-devtools:masterfrom
wldcordeiro:vertical-layout-scopes-pane
Jan 2, 2017
Merged

Vertical layout scopes pane#1575
jasonLaster merged 5 commits into
firefox-devtools:masterfrom
wldcordeiro:vertical-layout-scopes-pane

Conversation

@wldcordeiro

Copy link
Copy Markdown
Contributor

Associated Issue: #1359

Summary of Changes

  • Rework RightSidebar into an InformationPanes component that renders based on layout type
  • Hide the search hint in Sources when in vertical layout
  • Refactor the collapse button into a component for reuse.

Test Plan

Example test plan:

  • Open the debugger
  • Resize the debugger window to > 700px
  • View that scopes pane is on the right side of the lower pane
  • View that the search hint is gone from the sources sidebar

Screenshots/Videos (OPTIONAL)

screenshot_20161230_172353

…able for vertical layout.

Refactor collapse button code into a PaneCollapseButton component to be reused for vertical layout.

@jasonLaster jasonLaster left a comment

Copy link
Copy Markdown
Contributor

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 jasonLaster left a comment

Copy link
Copy Markdown
Contributor

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!

Comment thread src/components/InformationPanes.js Outdated
const Breakpoints = React.createFactory(require("./Breakpoints"));
const Expressions = React.createFactory(require("./Expressions"));

let { SplitBox } = require("devtools-modules");

Copy link
Copy Markdown
Contributor

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)

Comment thread src/components/InformationPanes.js Outdated

let scopesContent = {
header: L10N.getStr("scopes.header"),
component: Scopes, shouldOpen: isPaused };

Copy link
Copy Markdown
Contributor

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()

Copy link
Copy Markdown
Contributor

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(),
    ]
  })
}

Comment thread src/components/SourceTabs.js Outdated

return dom.div({ className: "source-header" },
this.renderToggleButton("start", !this.props.startPanelCollapsed),
PaneCollapseButton({

Copy link
Copy Markdown
Contributor

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?

@wldcordeiro wldcordeiro Dec 31, 2016

Copy link
Copy Markdown
Contributor Author

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.

Comment thread 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 }),

Copy link
Copy Markdown
Contributor

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

Comment thread 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 }),

Copy link
Copy Markdown
Contributor

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 vertical to be consistent internally
  • we use a default value in the params: PaneCollapseButton({ vertical = false })

Comment thread src/components/PaneCollapseButton.js Outdated
}, Svg("togglePanes"));
}

module.exports = PaneCollapseButton;

Copy link
Copy Markdown
Contributor

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

Comment thread src/components/Sources.js
L10N.getFormatStr("sources.search",
formatKeyShortcut(`CmdOrCtrl+${L10N.getStr("sources.search.key")}`))
);
}

Copy link
Copy Markdown
Contributor

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?

Comment thread src/components/InformationPanes.js Outdated
}

const RightSidebar = React.createClass({
const InformationPanes = React.createClass({

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

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. 👍

Comment thread src/components/InformationPanes.js Outdated
Accordion({
items: this.getItems()
})
paneContents

Copy link
Copy Markdown
Contributor

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

@wldcordeiro
wldcordeiro force-pushed the vertical-layout-scopes-pane branch from 28104a1 to d20d718 Compare December 31, 2016 07:19
@wldcordeiro
wldcordeiro force-pushed the vertical-layout-scopes-pane branch from d20d718 to 0cf4f21 Compare December 31, 2016 07:37

@jasonLaster jasonLaster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 Landing it!

@jasonLaster
jasonLaster merged commit 81048c4 into firefox-devtools:master Jan 2, 2017
@jasonLaster

jasonLaster commented Jan 2, 2017

Copy link
Copy Markdown
Contributor

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

@wldcordeiro

Copy link
Copy Markdown
Contributor Author

@jasonLaster awesome! It's great landing features like this. Glad to work on it.

@wldcordeiro
wldcordeiro deleted the vertical-layout-scopes-pane branch January 2, 2017 05:53
arthur801031 pushed a commit to arthur801031/debugger.html that referenced this pull request Jan 6, 2017
* 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
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.

2 participants