{"action":"created","issue":{"url":"https://api.github.com/repos/catapult-project/catapult/issues/728","labels_url":"https://api.github.com/repos/catapult-project/catapult/issues/728/labels{/name}","comments_url":"https://api.github.com/repos/catapult-project/catapult/issues/728/comments","events_url":"https://api.github.com/repos/catapult-project/catapult/issues/728/events","html_url":"https://github.com/catapult-project/catapult/issues/728","id":98609191,"number":728,"title":"Implement nav by find box functionality","user":{"login":"catapult-bot","id":13457154,"avatar_url":"https://avatars.githubusercontent.com/u/13457154?v=3","gravatar_id":"","url":"https://api.github.com/users/catapult-bot","html_url":"https://github.com/catapult-bot","followers_url":"https://api.github.com/users/catapult-bot/followers","following_url":"https://api.github.com/users/catapult-bot/following{/other_user}","gists_url":"https://api.github.com/users/catapult-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/catapult-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catapult-bot/subscriptions","organizations_url":"https://api.github.com/users/catapult-bot/orgs","repos_url":"https://api.github.com/users/catapult-bot/repos","events_url":"https://api.github.com/users/catapult-bot/events{/privacy}","received_events_url":"https://api.github.com/users/catapult-bot/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-02T13:35:00Z","updated_at":"2015-08-02T13:35:37Z","closed_at":"2015-08-02T13:35:05Z","body":"<a href=\"https://github.com/jackjyang\"><img src=\"https://avatars.githubusercontent.com/u/3513806?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [jackjyang](https://github.com/jackjyang)**\n_Wednesday Jan 21, 2015 at 15:59 GMT_\n_Originally opened as https://github.com/google/trace-viewer/pull/728_\n\n----\n\nThis allows navigating the timeline by entering a string in\r\nthe find input box in the format of (timestamp)@(pid).(tid)x(scaleX).\r\nA line will be drawn at that ts, the pid and tid will be brought into\r\nview, and zoom will be applied.\r\n\r\nThe find string can also be generated by double clicking the timeline\r\nwhile in mousemode=selection. A nav line will be drawn and the nav string\r\nwill be generated in the find box to be copied by the user. Single clicking\r\nanywhere on the timeline dismisses the nav line and removes the string.\r\n\r\nThis will be useful when one would want to refer to a specific point\r\non the timeline in - for example - an email thread.\r\n\n\n----\n\n_**[jackjyang](https://github.com/jackjyang)** included the following code: https://github.com/google/trace-viewer/pull/728/commits_\n"},"comment":{"url":"https://api.github.com/repos/catapult-project/catapult/issues/comments/127024836","html_url":"https://github.com/catapult-project/catapult/issues/728#issuecomment-127024836","issue_url":"https://api.github.com/repos/catapult-project/catapult/issues/728","id":127024836,"user":{"login":"catapult-bot","id":13457154,"avatar_url":"https://avatars.githubusercontent.com/u/13457154?v=3","gravatar_id":"","url":"https://api.github.com/users/catapult-bot","html_url":"https://github.com/catapult-bot","followers_url":"https://api.github.com/users/catapult-bot/followers","following_url":"https://api.github.com/users/catapult-bot/following{/other_user}","gists_url":"https://api.github.com/users/catapult-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/catapult-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catapult-bot/subscriptions","organizations_url":"https://api.github.com/users/catapult-bot/orgs","repos_url":"https://api.github.com/users/catapult-bot/repos","events_url":"https://api.github.com/users/catapult-bot/events{/privacy}","received_events_url":"https://api.github.com/users/catapult-bot/received_events","type":"User","site_admin":false},"created_at":"2015-08-02T13:35:36Z","updated_at":"2015-08-02T13:35:36Z","body":"<a href=\"https://github.com/jackjyang\"><img src=\"https://avatars.githubusercontent.com/u/3513806?v=3\" align=\"left\" width=\"48\" height=\"48\" hspace=\"10\"></img></a> **Comment by [jackjyang](https://github.com/jackjyang)**\n_Tuesday Mar 10, 2015 at 18:11 GMT_\n\n----\n\nHi @natduca, thanks for the review! I've updated this PR with a new fix-up commit because I didn't want to lose your comments. Please take a look. After you lgtm if you want I can squash everything into a single commit before merging.\r\n\r\nAlso since I removed my commit about drawing the line, Github lost our comments on that. I'm copying that here, mainly for my reference when adding annotations:\r\n\r\n>Eek that we're duplicating this code twice here. Gotta find a way to avoid that.\r\nWe should be finding an abstraction here that can capture your use case but not duplicate code.\r\nSuppose we make an annotation class. This is a virtual base class that has draw methods just like tracks do. So its base class is constructed with a viewport argument.\r\nAnd, suppose we have Viewport have a list of annotations. E.g. viewport.addAnnotation, viewport.removeAnnotation. When you add/remove annotations, you call invalidate() like the tracks do, in order to cause a redraw.\r\nWHich is awesome because suppose that the drawing container iterates through the viewport's active annotations every time it draws.\r\nNow you can make a GlobalVerticalXMarker annotation that contains your drawing code that you construct from a single timestamp.\r\nNow you can have the find controller construct a marker, add it to the viewport. The only thing that remains is asking the timeline_view to focus a location. So then al you need on the timeline is a scrollLocationIntoView(location, opt_dontAnimate).\r\nMake sense?\r\n\r\nAnd what I replied:\r\n> Yup, thanks, that makes sense. I'll put off this part of this feature (ie. the marker drawing at timestamp) until we have some sort of annotation drawing capability. In the meantime I'll update this pull request just to commit the first part of the change once I address all your other comments.\r\n\n"}}