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

Change layout depending on available space #454

Merged
merged 7 commits into from
Jan 12, 2018

Conversation

crswll
Copy link
Contributor

@crswll crswll commented Nov 12, 2017

Adding the ability to split the panes horizontally or vertically based on the users preference.

@crswll crswll changed the title Allow the user to change layout of panels. Allow the user to change layout of panes. Nov 12, 2017
@anteriovieira
Copy link
Contributor

Hi @crswll , you can provide a gif to demonstrate the behavior?

@crswll
Copy link
Contributor Author

crswll commented Nov 23, 2017

Sure.

2017-11-22 22 33 12

@Akryum
Copy link
Member

Akryum commented Dec 23, 2017

Thanks for your PR @crswll 👍
What if we switch the layout automatically depending on the width of the devtools?

@crswll
Copy link
Contributor Author

crswll commented Dec 23, 2017

No problem! I'm happy to help.

I didn't do it with media queries out of personal preference. There's was too many times in devtools I'd want a wide view but then it'll turn into two columns instead of one before i changed the "Panel Layout" setting.

I wonder if I can read that setting and honor it and use media queries if it's set to auto.

Feel all right about that?

@Akryum
Copy link
Member

Akryum commented Dec 23, 2017

Why not, we can try a 3-state button with h/v/auto then. It would be auto by default.

@crswll
Copy link
Contributor Author

crswll commented Dec 24, 2017

Oh no I meant just getting the setting directly from Chrome devtools so I'd remove the button all together and change a class based on that setting.

If it's auto it's responsive, otherwise fixed in one direction or the other.

@Akryum
Copy link
Member

Akryum commented Dec 24, 2017

Oh okay 👍

@crswll
Copy link
Contributor Author

crswll commented Dec 25, 2017

I gave it a quick look and a long Google but I don't think that setting is exposed like the theme unfortunately.

Any of you know if this setting is exposed?

screen shot 2017-12-24 at 9 51 08 pm

chrome.devtools.panels.themeName exists but chrome.devtools.panels.panelLayout or the like does not seem to.

I'll go with the 3-state button if there's no luck here.

@crswll
Copy link
Contributor Author

crswll commented Dec 29, 2017

I'm finally getting around to this and not digging a three state button. I'm just going to use a media query and have it work "auto" until I figure out how to read that setting and honor that.

@crswll
Copy link
Contributor Author

crswll commented Dec 29, 2017

Ok, now 2 columns when we have over 685px, which is the breakpoint Chrome devtools seems to use. Also using matchMedia API which I've never used before so let me know if anything seems dumb/bad.

@@ -31,11 +31,10 @@
<span class="pane-name">Events</span>
<span class="event-count" v-if="newEventCount > 0">{{ newEventCount }}</span>
</a>
<a class="button refresh"
<a class="button refresh icon-only"
Copy link
Member

Choose a reason for hiding this comment

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

Why setting icon only here?

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 removed the button that toggles the layout and that had it as well. I can change this to a specific class and remove this more utilitarian class.

Copy link
Member

Choose a reason for hiding this comment

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

I mean, we can make the Refresh button normal (by removing this class) now that you removed the other icon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All right. It's been removed along with the extra class.

@crswll crswll changed the title Allow the user to change layout of panes. Change layout depending on available space Dec 30, 2017
@crswll
Copy link
Contributor Author

crswll commented Dec 30, 2017

Quick shot of it working.

2017-12-29 21 12 52

@michalsnik michalsnik added this to the 🎄Holiday Update milestone Jan 3, 2018
@yyx990803 yyx990803 merged commit dbeafb3 into vuejs:master Jan 12, 2018
@crswll crswll deleted the horizontal-layout branch April 4, 2018 17:34
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.

None yet

5 participants