brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

[CLOSED] [New feature] Add flip-view and close buttons to pane-headers #10168

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by petetnt Sunday Sep 27, 2015 at 13:45 GMT Originally opened as https://github.com/adobe/brackets/pull/11749


This new feature improves the Splitscreen UX by adding buttons to panel headers that allow user to quickly flip the current view to another pane. It's not a complete solution, but another alternative to dragging the files over to another panel which can be a bit cumbersome, as evidenced in #11308, #11448, #11345 and others.

When Split View is enabled, arrow buttons are added to the panel that indicate flipping

image

Clicking such button flips the view to the other panel, revealing the last used file in the pane it was flipped from

image

If there's no files open in the new other pane, the button obviously isn't there

image

This of course works in vertical split mode too:

image

The first commit doesn't include unit tests because Jasmine Spec Runner won't work for whatever reason: while I am looking at that issue, any feedback, improvements or questions are welcome.

edit: Build failed because the API rate limit exceeded

edit: 2 The panes now contain a close buttons too as similar to what@zaggino suggested.

image

Clicking the x closes the file, or prompts for confirmation if a file is dirty. If pane contains no files, the close button collapses the views by setting the layout scheme to 1x1


petetnt included the following code: https://github.com/adobe/brackets/pull/11749/commits

core-ai-bot commented 3 years ago

Comment by zaggino Sunday Sep 27, 2015 at 22:02 GMT


Love it, gave me an idea -> X mark in the corner to close split view quickly (one click instead of two), would solve my https://github.com/adobe/brackets/issues/11746 problem.

core-ai-bot commented 3 years ago

Comment by petetnt Monday Sep 28, 2015 at 05:34 GMT


@zaggino yeah that is an great idea to me!

core-ai-bot commented 3 years ago

Comment by petetnt Tuesday Oct 06, 2015 at 18:27 GMT


Added an unit test

core-ai-bot commented 3 years ago

Comment by petetnt Sunday Oct 11, 2015 at 10:56 GMT


The panes now contain a close buttons too as similar to what@zaggino suggested.

image

Clicking the x closes the file, or prompts for confirmation if a file is dirty. If pane contains no files, the close button collapses the views by setting the layout scheme to 1x1

core-ai-bot commented 3 years ago

Comment by zaggino Monday Oct 12, 2015 at 04:47 GMT


few comments:

1) i like how the close highlights when hovered, can you make the same with the arrows? right now arrow icon doesn't highlight but some weird border around it highlights

2) the icons doesn't have to be there all the time, maybe they can appear only when I hover over the title area? (i mean the .pane-header element)

3) when i click close icon on the last file in the right panel, it doesn't close but i have to click again to close the empty panel? <- this actually might be a feature, not a problem, just saying

4) if i have one file in the left panel and one file in the right panel, when i close the left file and then close the left pane, the right file disappears (it works fine closing the right panel, left file stays open)

core-ai-bot commented 3 years ago

Comment by petetnt Monday Oct 12, 2015 at 05:26 GMT


Thanks for the comments@zaggino. I'll look into those asap, esp. 4), not sure what's up with that :hammer: It seems that getCurrentlyViewedFile() returns the file in the active pane and just clicking on the x doesn't active the pane itself -> wrong file closes.

I was putting some behavior for 2) and 3) behind some prefs: hover, always and off for the panel buttons (default being hover) and something like CLOSE_PANE_AFTER_LAST for the panes:

core-ai-bot commented 3 years ago

Comment by zaggino Monday Oct 12, 2015 at 06:24 GMT


Ah right, I didn't read the code before testing this so I didn't knew about the various preferences. But show on hover seems to be reasonable default.

core-ai-bot commented 3 years ago

Comment by petetnt Monday Oct 12, 2015 at 07:47 GMT


@zaggino You didn't miss anything, the prefs haven't been implemented yet :)

core-ai-bot commented 3 years ago

Comment by zaggino Monday Oct 12, 2015 at 11:50 GMT


Ah right, keep the work coming then, it'd be great to see this in 1.6 :)

core-ai-bot commented 3 years ago

Comment by petetnt Monday Oct 12, 2015 at 19:26 GMT


Made additions and modifications according to@zaggino 's comments

core-ai-bot commented 3 years ago

Comment by abose Thursday Oct 15, 2015 at 07:40 GMT


@petetnt I can't see the close button when i tested this out. Do I need to do something more to enable close butoon?

core-ai-bot commented 3 years ago

Comment by petetnt Thursday Oct 15, 2015 at 07:45 GMT


@abose good catch, the close button is there but you cannot see it when you are using a light theme such as Brackets default. Didn't test it out on a lighter theme after adding the close button, will fix asap

core-ai-bot commented 3 years ago

Comment by petetnt Thursday Oct 15, 2015 at 07:59 GMT


@abose It's now fixed :hammer:

core-ai-bot commented 3 years ago

Comment by abose Thursday Oct 15, 2015 at 09:49 GMT


works now :sunglasses: image When a pane is empty, the flip button seems to be confused.

core-ai-bot commented 3 years ago

Comment by petetnt Thursday Oct 15, 2015 at 09:59 GMT


@abose fixed that regression (nitpicky CSS inheriting :fire_engine:).

core-ai-bot commented 3 years ago

Comment by abose Thursday Oct 15, 2015 at 10:41 GMT


Thanks for this feature@petetnt . All unit/integration tests passing. LGTM. When this is ok to be merged, Please remove the [review] tag from the title.

core-ai-bot commented 3 years ago

Comment by petetnt Thursday Oct 15, 2015 at 10:51 GMT


Ready to be merged as far as I am concerned unless others have something else to add.

core-ai-bot commented 3 years ago

Comment by abose Thursday Oct 15, 2015 at 11:21 GMT


Thanks@zaggino@sprintr@le717 for reviewing. Merging.

core-ai-bot commented 3 years ago

Comment by petetnt Thursday Oct 15, 2015 at 11:32 GMT


:fireworks: :tada: :+1:

core-ai-bot commented 3 years ago

Comment by zaggino Thursday Oct 15, 2015 at 11:37 GMT


cool stuff, nice work@petetnt ;)

core-ai-bot commented 3 years ago

Comment by arctwelve Wednesday Jan 20, 2016 at 22:37 GMT


@petetnt Congrats on the new feature.