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 736347 - don't forget route
don't forget route
Status: RESOLVED FIXED
Product: gnome-maps
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-maps-maint
gnome-maps-maint
Depends on:
Blocks:
 
 
Reported: 2014-09-09 17:32 UTC by Matthias Clasen
Modified: 2014-09-12 18:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Do not forget route on sidebar hide (2.60 KB, patch)
2014-09-10 05:58 UTC, Jonas Danielsson
needs-work Details | Review
Hide route on invalid query (2.85 KB, patch)
2014-09-10 05:59 UTC, Jonas Danielsson
needs-work Details | Review
Do not forget route on sidebar hide (2.60 KB, patch)
2014-09-10 09:55 UTC, Jonas Danielsson
needs-work Details | Review
Hide route on invalid query (2.82 KB, patch)
2014-09-10 09:56 UTC, Jonas Danielsson
committed Details | Review
Do not forget route on sidebar hide (2.69 KB, patch)
2014-09-11 18:30 UTC, Jonas Danielsson
committed Details | Review

Description Matthias Clasen 2014-09-09 17:32:47 UTC
just hiding and reshowing the side-bar wipes it clean - all my carefully entered route information is lost :-( that shouldn't happen. Even better would be to keep a history of past routes, and letting me go back to previously entered ones.
Comment 1 Damián Nohales 2014-09-09 17:54:12 UTC
Agree, actually this was pointed in [1].

About keep a history of past routes, how would you implement that, in the entry autocompletion or extra UI components exclusive for this? Maybe we need designer's voice on this.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=731068#c312
Comment 2 Mattias Bengtsson 2014-09-09 23:19:11 UTC
Yeah a history of routes would be nice.

Meanwhile, I think the solution is to keep the last route search in memory and when we re-open the route-sidebar just re-show the route.

What do you think?
Comment 3 Jonas Danielsson 2014-09-10 05:58:55 UTC
Created attachment 285790 [details] [review]
Do not forget route on sidebar hide
Comment 4 Jonas Danielsson 2014-09-10 05:59:52 UTC
Created attachment 285791 [details] [review]
Hide route on invalid query

Without this the old route information and route will be present even tho we have removed parts of the route in the entries.
Comment 5 Jonas Danielsson 2014-09-10 06:07:54 UTC
Review of attachment 285790 [details] [review]:

::: src/mapView.js
@@ +65,3 @@
+
+    get routeVisible() {
+        this._routeLayer.visible && this._instructionMarkerLayer.visible;

Should probably be ||
Comment 6 Mattias Bengtsson 2014-09-10 09:28:48 UTC
Review of attachment 285790 [details] [review]:

That was easier than I thought. Nice!

::: src/mapView.js
@@ +62,3 @@
+                                                  GObject.ParamFlags.READWRITE,
+                                                  false)
+    },

I think it's custom to use dash-separated names here, like 'route-visible'. 
If that for some reason doesn't work, make it 'routeVisible' in both places instead. :)

@@ +65,3 @@
+
+    get routeVisible() {
+        this._routeLayer.visible && this._instructionMarkerLayer.visible;

Sure. No strong opinion here. :)
Comment 7 Jonas Danielsson 2014-09-10 09:42:22 UTC
Review of attachment 285790 [details] [review]:

Thanks for review!

::: src/mapView.js
@@ +62,3 @@
+                                                  GObject.ParamFlags.READWRITE,
+                                                  false)
+    },

I was going for routeVisible in both places actually :) The routevisible is a typo.
If I name it 'route-visible' do you think it is still ok to have the getter as routeVisible?

And the notify should be 'route-visible' I guess?
Comment 8 Mattias Bengtsson 2014-09-10 09:54:10 UTC
Review of attachment 285791 [details] [review]:

Nice!

::: src/mapView.js
@@ +141,3 @@
+        query.connect('notify', (function() {
+            if (!query.isValid())
+                this.routeVisible = false;

So many negations that my head spins.

Would 
> this.routeVisible = query.isValid();
work?
Comment 9 Jonas Danielsson 2014-09-10 09:55:59 UTC
Created attachment 285810 [details] [review]
Do not forget route on sidebar hide

Updated after review.
Comment 10 Jonas Danielsson 2014-09-10 09:56:26 UTC
Created attachment 285811 [details] [review]
Hide route on invalid query

Updated after review.
Comment 11 Mattias Bengtsson 2014-09-10 10:42:21 UTC
Review of attachment 285790 [details] [review]:

::: src/mapView.js
@@ +62,3 @@
+                                                  GObject.ParamFlags.READWRITE,
+                                                  false)
+    },

Hm, I don't know actually. I think you could just go with routeVisible then.
Comment 12 Jonas Danielsson 2014-09-10 10:43:32 UTC
(In reply to comment #11)
> Review of attachment 285790 [details] [review]:
> 
> ::: src/mapView.js
> @@ +62,3 @@
> +                                                 
> GObject.ParamFlags.READWRITE,
> +                                                  false)
> +    },
> 
> Hm, I don't know actually. I think you could just go with routeVisible then.

I did in the updated patch. Having the name 'route-visible' means we need a getter called route_visible. And that clashes with our naming style.
Comment 13 Mattias Bengtsson 2014-09-11 03:56:42 UTC
Review of attachment 285810 [details] [review]:

ACK
Comment 14 Mattias Bengtsson 2014-09-11 03:58:58 UTC
Review of attachment 285811 [details] [review]:

ACK (except for tiny issue)

::: src/mapView.js
@@ +140,3 @@
 
+        query.connect('notify', (function() {
+                this.routeVisible = query.isValid();

Indent -4 here.
Comment 15 Damián Nohales 2014-09-11 15:06:48 UTC
Review of attachment 285810 [details] [review]:

::: src/mainWindow.js
@@ +71,3 @@
+        this._sidebar.bind_property('reveal-child',
+                                    this.mapView, 'routeVisible',
+                                    GObject.BindingFlags.DEFAULT);

If your query is invalid, you will show the route anyways, the steps to reproduce this are the following:

1) Startup Maps, open sidebar and search a valid route with, for example, two points.
2) Clear the second route point, so now the query is invalid.
3) Hide the sidebar.
4) Show the sidebar again, the route of item (1) is showed.

Maybe an easy way to fix it is to validate the query in routeVisible setter.
Comment 16 Mattias Bengtsson 2014-09-11 16:15:59 UTC
(In reply to comment #15)
> Review of attachment 285810 [details] [review]:
> 
> ::: src/mainWindow.js
> @@ +71,3 @@
> +        this._sidebar.bind_property('reveal-child',
> +                                    this.mapView, 'routeVisible',
> +                                    GObject.BindingFlags.DEFAULT);
> 
> If your query is invalid, you will show the route anyways, the steps to
> reproduce this are the following:
> 
> 1) Startup Maps, open sidebar and search a valid route with, for example, two
> points.
> 2) Clear the second route point, so now the query is invalid.
> 3) Hide the sidebar.
> 4) Show the sidebar again, the route of item (1) is showed.
> 
> Maybe an easy way to fix it is to validate the query in routeVisible setter.

Good catch, thanks!
Comment 17 Jonas Danielsson 2014-09-11 18:30:54 UTC
Created attachment 285943 [details] [review]
Do not forget route on sidebar hide
Comment 18 Damián Nohales 2014-09-11 22:34:45 UTC
Review of attachment 285943 [details] [review]:

::: src/mapView.js
@@ +65,3 @@
+
+    get routeVisible() {
+        this._routeLayer.visible || this._instructionMarkerLayer.visible;

Missing return?
Comment 19 Jonas Danielsson 2014-09-12 11:52:40 UTC
Review of attachment 285943 [details] [review]:

::: src/mapView.js
@@ +65,3 @@
+
+    get routeVisible() {
+        this._routeLayer.visible || this._instructionMarkerLayer.visible;

Yeah, I will fix it up in commit.
Comment 20 Jonas Danielsson 2014-09-12 18:18:30 UTC
Attachment 285811 [details] pushed as 5ac8c23 - Hide route on invalid query
Attachment 285943 [details] pushed as ddcf913 - Do not forget route on sidebar hide
Comment 21 Zeeshan Ali 2014-09-12 18:23:20 UTC
Cool. Create another bug for the last part of comment#0.

https://bugzilla.gnome.org/show_bug.cgi?id=736582