Repository: napari/napari

Issue:
Shapes layer: after drawing a shape, the last shape should remain/be selected
## 🧰 Task
Simple enhancement for consistency with Points layers, and well as other graphical tools and PowerPoint.
The last drawn shape should remain selected, to allow the user to easily tweak it's color.

Note: I recognize with our modes (add vs. vertex select vs shape select) this selection will not be fully functional, but at least changing color would work, same as with Points where you also cannot move the Point or interact with it, just change colors. 


Discussion:
Hi there, not totally sure but to keep vertex selected after drawing a shape I think removing this line should be enough?:

https://github.com/napari/napari/blob/70d63868d49b3827b2ad0e838a65e507cc4d919b/napari/layers/shapes/shapes.py#L2573

A preview:

![vertex_selection](https://github.com/napari/napari/assets/16781833/aa4308a8-9421-4f47-9563-7d14727a6a10)

@dalthviz yeah that's what I came up with as well!
Should I do a PR with this little change or do you already have it somewhere and plan to create a PR @psobolewskiPhD ? 

Resolving patch:
diff --git a/napari/layers/shapes/shapes.py b/napari/layers/shapes/shapes.py
--- a/napari/layers/shapes/shapes.py
+++ b/napari/layers/shapes/shapes.py
@@ -2570,7 +2570,6 @@ def _finish_drawing(self, event=None):
         """Reset properties used in shape drawing."""
         index = copy(self._moving_value[0])
         self._is_moving = False
-        self.selected_data = set()
         self._drag_start = None
         self._drag_box = None
         self._is_selecting = False


Test patch:
diff --git a/napari/layers/shapes/_tests/test_shapes_mouse_bindings.py b/napari/layers/shapes/_tests/test_shapes_mouse_bindings.py
--- a/napari/layers/shapes/_tests/test_shapes_mouse_bindings.py
+++ b/napari/layers/shapes/_tests/test_shapes_mouse_bindings.py
@@ -104,6 +104,10 @@ def test_add_simple_shape(shape_type, create_known_shapes_layer):
     np.testing.assert_allclose(new_shape_max, known_non_shape_end)
     assert layer.shape_type[-1] == shape_type
 
+    # Ensure it's selected, accounting for zero-indexing
+    assert len(layer.selected_data) == 1
+    assert layer.selected_data == {n_shapes}
+
 
 def test_polygon_lasso_tablet(create_known_shapes_layer):
     """Draw polygon with tablet simulated by mouse drag event."""
@@ -145,6 +149,10 @@ def test_polygon_lasso_tablet(create_known_shapes_layer):
     assert layer.shape_type[-1] == 'polygon'
     assert not layer._is_creating
 
+    # Ensure it's selected, accounting for zero-indexing
+    assert len(layer.selected_data) == 1
+    assert layer.selected_data == {n_shapes}
+
 
 def test_polygon_lasso_mouse(create_known_shapes_layer):
     """Draw polygon with mouse. Events in sequence are mouse press, release, move, press, release"""
@@ -182,6 +190,10 @@ def test_polygon_lasso_mouse(create_known_shapes_layer):
     assert layer.shape_type[-1] == 'polygon'
     assert not layer._is_creating
 
+    # Ensure it's selected, accounting for zero-indexing
+    assert len(layer.selected_data) == 1
+    assert layer.selected_data == {n_shapes}
+
 
 def test_distance_polygon_creating(create_known_shapes_layer):
     """Test that distance threshold in polygon creating works as intended"""
@@ -249,6 +261,10 @@ def test_add_complex_shape(shape_type, create_known_shapes_layer):
     np.testing.assert_allclose(layer.data[-1], desired_shape)
     assert layer.shape_type[-1] == shape_type
 
+    # Ensure it's selected, accounting for zero-indexing
+    assert len(layer.selected_data) == 1
+    assert layer.selected_data == {n_shapes}
+
 
 def test_vertex_insert(create_known_shapes_layer):
     """Add vertex to shape."""