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

Add setting to view output in dock by default #1022

Merged
merged 5 commits into from
Oct 15, 2017

Conversation

BenRussert
Copy link
Member

In order to do this for #995 I reworked the logic for opening watches/output panes a little bit.

lib/main.js Outdated
if (!atom.config.get("Hydrogen.outputAreaDefault")) return;
openOrShowDock(OUTPUT_AREA_URI);
}
);
Copy link
Member Author

Choose a reason for hiding this comment

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

The string argument here is a "debug name" that will appear in the log when the reaction fires (only in dev mode when mobx-react-devtools enabled.

lib/utils.js Outdated
: atom.workspace.open(URI, {
searchAllPanes: true,
activatePane: false
});
}
Copy link
Member Author

Choose a reason for hiding this comment

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

The show part should be last so it opens if not already opened, then shows the dock workout focusing it. I'll rebase this PR later.

@lgeiger
Copy link
Member

lgeiger commented Oct 3, 2017

Thanks for tackling this.

I just tested it and unfortunately it doesn't fully work. When first starting a new kernel it opens the dock but the output is still displayed inline.

Do we really need the when statement at top? I think it should be enough to just check the settings here.

@BenRussert
Copy link
Member Author

The reason for the when is that it would only open in the pane when you start up the first kernel. Following that it would work as it does now where you can switch to either inline or pane output.

The very first output is displaying inline, trying to fix that.

I'll try your suggestion, I guess we would toggle the setting when the pane disposes? Otherwise you could never use inline if the setting is still checked.

Thanks for the feedback!

lib/main.js Outdated
const globalOutputStore = atom.workspace
.getPaneItems()
.find(item => item instanceof OutputPane)
const globalOutputStore = atom.config.get("Hydrogen.outputAreaDefault")
? kernel.outputStore
: null;
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be

const globalOutputStore =
  atom.config.get("Hydrogen.outputAreaDefault") ||
  atom.workspace.getPaneItems().find(item => item instanceof OutputPane)
    ? kernel.outputStore
    : null;

since we still want to have the possibility of just opening the output pane and using it until it's completely closed.

@@ -15,6 +15,8 @@ export default class OutputPane {
constructor(store: store) {
this.element.classList.add("hydrogen");

atom.config.set("Hydrogen.outputAreaDefault", true);
Copy link
Member

Choose a reason for hiding this comment

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

Why are you setting the config value here?

Copy link
Member Author

Choose a reason for hiding this comment

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

With the last commit we don't need to. Originally it was so that if you toggle open the output pane the setting would turn on.

Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

Is there follow up that needs to be done here?

@rgbkrk
Copy link
Member

rgbkrk commented Oct 13, 2017

It looks like all the feedback was addressed, we now need a rebase and then it's time to bring it in.

@BenRussert
Copy link
Member Author

Now I seem to be opening multiple output panes? I might have to look at this again tomorrow.

@BenRussert
Copy link
Member Author

I think this is good now.

  • There is a new setting outputAreaDefault
    • if left unchecked (the default) this will change nothing about the way output area works now
    • if checked output will always go to the output area in the dock

I got caught up wanting an intuitive way to switch back to inline even if you have the setting checked, but that is probably unnecessary or at least can just come back to that if people want it later.

@BenRussert
Copy link
Member Author

Side notes:

#995 also brought up the outputAreaDock (confusingly named setting) which I added in #893 to keep the dock open even if you switch to a tab without a running kernel.

This PR:

  • Fixes the wording of that config title
  • applies the same behavior to the watches pane

Copy link
Member

@lgeiger lgeiger left a comment

Choose a reason for hiding this comment

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

I just gave this a quick spin and haven't found any problems 👍
@BenRussert Thanks for keeping this PR alive over this long period.

@lgeiger lgeiger merged commit f58bbf9 into nteract:master Oct 15, 2017
@lgeiger
Copy link
Member

lgeiger commented Oct 15, 2017

I got caught up wanting an intuitive way to switch back to inline even if you have the setting checked, but that is probably unnecessary or at least can just come back to that if people want it later.

Yeah I think it's unnecessary. People can switch between both views very nicely when the setting is disabled. If it's enabled they'll never see the inline bubbles, which I think is OK.

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

Successfully merging this pull request may close these issues.

4 participants