After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 764137 - Keep items visible and selected after renaming or creation
Keep items visible and selected after renaming or creation
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
3.20.x
Other Linux
: Normal normal
: 3.20
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 760623 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-03-24 12:10 UTC by Allan Day
Modified: 2016-04-27 21:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
files-view: reveal file after renaming (6.99 KB, patch)
2016-04-27 12:15 UTC, Carlos Soriano
none Details | Review
files-view: reveal file after renaming or creating (11.34 KB, patch)
2016-04-27 14:11 UTC, Carlos Soriano
none Details | Review
files-view: reveal file after renaming or creating (11.38 KB, patch)
2016-04-27 21:11 UTC, Carlos Soriano
none Details | Review
files-view: reveal file after renaming or creating (11.39 KB, patch)
2016-04-27 21:20 UTC, Carlos Soriano
committed Details | Review

Description Allan Day 2016-03-24 12:10:05 UTC
If you create a folder or rename a file, it can move position in the view. This can be confusing if it moves out of sight - it looks like the item has disappeared.

The current behaviour isn't very helpful, either - you often want to perform actions on items after renaming or creating them, and having to hunt for their new location is extra work.

This is also an argument for keeping items selected after one of these operations - you should be able to press return to open them. After creating a folder, the hamburger menu gets focus rather than the folder - not useful.
Comment 1 Carlos Soriano 2016-03-29 07:41:41 UTC
*** Bug 760623 has been marked as a duplicate of this bug. ***
Comment 2 Carlos Soriano 2016-04-27 12:15:05 UTC
Created attachment 326863 [details] [review]
files-view: reveal file after renaming

We want to reveal the file that was just renamed.
In order to do that, we have to make sure the view has the icon and all
changes were acknowledge, and only then, reveal the file.

In this patch, we implement this connecting to the view signal and
revealing the file if the operation was done.
Comment 3 Carlos Soriano 2016-04-27 14:11:48 UTC
Created attachment 326873 [details] [review]
files-view: reveal file after renaming or creating

We want to reveal the file that was just renamed.
In order to do that, we have to make sure the view has the icon and all
changes were acknowledge, and only then, reveal the file.

In this patch, we implement this creating a hash table that will hold
any file that needs to be revealed when the view acknowledges it.

Functions using this will be the renaming of files, the creation of
folders, and the creation of folders with selection.
Comment 4 Carlos Soriano 2016-04-27 14:12:36 UTC
I like more this second approach, that holds private data on what files should be revealed. So the view has the pending to reveal files as part of the state.
Comment 5 Razvan Chitu 2016-04-27 20:33:07 UTC
Review of attachment 326873 [details] [review]:

::: src/nautilus-files-view.c
@@ +3535,3 @@
+
+        /* Reveal files that were pending to be revealed, only if all of them
+         * were aknowledge by the view

Acknowledged should be used here.

@@ +3540,3 @@
+                GList *keys;
+                GList *l;
+                gboolean all_files_aknowledge = TRUE;

Use acknowledged.

@@ +3542,3 @@
+                gboolean all_files_aknowledge = TRUE;
+
+                keys = g_hash_table_get_keys (view->details->pending_reveal);

The list of keys should be freed.

@@ +3594,1 @@
+                        /* Aknowledge the files that were pending to be revealed */

You forgot the C in acknowledge.
Comment 6 Carlos Soriano 2016-04-27 21:11:21 UTC
Created attachment 326897 [details] [review]
files-view: reveal file after renaming or creating

We want to reveal the file that was just renamed.
In order to do that, we have to make sure the view has the icon and all
changes were acknowledge, and only then, reveal the file.

In this patch, we implement this creating a hash table that will hold
any file that needs to be revealed when the view acknowledges it.

Functions using this will be the renaming of files, the creation of
folders, and the creation of folders with selection.
Comment 7 Carlos Soriano 2016-04-27 21:20:15 UTC
Created attachment 326898 [details] [review]
files-view: reveal file after renaming or creating

We want to reveal the file that was just renamed.
In order to do that, we have to make sure the view has the icon and all
changes were acknowledge, and only then, reveal the file.

In this patch, we implement this creating a hash table that will hold
any file that needs to be revealed when the view acknowledges it.

Functions using this will be the renaming of files, the creation of
folders, and the creation of folders with selection.
Comment 8 Razvan Chitu 2016-04-27 21:27:32 UTC
Review of attachment 326898 [details] [review]:

LGTM!
Comment 9 Carlos Soriano 2016-04-27 21:30:01 UTC
Thanks for review Razvan!

Attachment 326898 [details] pushed as 0a00871 - files-view: reveal file after renaming or creating