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

Keep splitted view when coming back from a maximized view #1344

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

QDoussot
Copy link

@QDoussot QDoussot commented Jul 1, 2024

Old behavior

  • Open a splitted view like ("Main + Diff" or "Status + diff" for example)
  • Then open a new maximized window like help
  • Quitting the maximized view does not bring back the splitted view but only the top view ("Main or "Status" for example)

New behavior

  • Open a splitted view like ("Main + Diff" or "Status + diff" for example)
  • Then open a new maximized window like help
  • Quitting the maximized view does bring back the splitted view ("Main + Diff" or "Status + diff" for example)

Example:

From Main view
 :enter      -> Main view | Status view
 :view-help  -> Help view
 :view-close -> Main view               (old behavior) 
 :view-close -> Main view | Status view (new behavior) 

Enable requested behaviors in #336

QDoussot added 3 commits July 1, 2024 15:22
Necessary now that this flow is possible:
Main -> Staged changes -> Help ->
  Main -> Untracked Changes -> Untracked files -> Stage view

To avoid having a message about 'No stage content...'
@koutcher
Copy link
Collaborator

Thanks, unfortunately the PR breaks the auto-close behaviour of the maximized stage view when the last change is staged and this was not covered in the test suite, see below. I didn't check further, I think all views should be rechecked carefully.

diff --git a/test/stage/maximized-unstaged-changes-test b/test/stage/maximized-unstaged-changes-test
index bf571111..a3fee899 100755
--- a/test/stage/maximized-unstaged-changes-test
+++ b/test/stage/maximized-unstaged-changes-test
@@ -18,6 +18,8 @@ steps '
 	:save-display split.screen
 	:view-diff
 	:save-display maximized.screen
+	:status-update
+	:save-display closed.screen
 '
 
 tigrc <<EOF
@@ -56,3 +58,17 @@ index e697dfd..9d8ef3d 100644
 --- a/.j
 [stage] Press '<Enter>' to jump to file diff - line 1 of 107                  9%
 EOF
+
+assert_equals 'closed.screen' <<EOF
+2014-05-25 19:42 +0000 Not Committed Yet o Staged changes
+2009-02-13 23:31 +0000 A. U. Thor        I [master] Initial commit
+
+
+
+
+
+
+
+
+[main] Staged changes                                                       100%
+EOF

@QDoussot
Copy link
Author

Thanks for spotting it.
Here is a fix for this particular behavior breaking, plus an update on the test according to the diff you provided.
Do you have any idea of other specific behaviors to be tested ?

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.

2 participants