{"action":"created","comment":{"url":"https://api.github.com/repos/luna/luna-studio/pulls/comments/173672108","pull_request_review_id":102898598,"id":173672108,"diff_hunk":"@@ -1,17 +1,85 @@\n import {Component} from 'view/Component'\n import * as basegl from 'basegl'\n+import * as style  from 'style'\n \n \n+searcherRoot = 'searcher-root'\n+\n export class Searcher extends Component\n     updateModel: ({ key: @key = @key\n-                  , matches: @matches = @matches}) =>\n+                  , mode: @mode = @mode\n+                  , input: @input = @input\n+                  , selected: @selected = @selected or 0\n+                  , entries: @entries = @entries or []}) =>\n         unless @def?\n-            div = document.createElement( 'div' );\n-            div.style.width = 100 + 'px';\n-            div.style.height = '200px';\n-            div.style.backgroundColor = '#CCCCCC';\n-            div.id = 'examplebutton'\n-            @def = basegl.symbol div\n+            root = document.createElement 'div'\n+            root.className = ['native-key-bindings'].concat style.luna ['input', 'searcher', 'searcher--node']\n+            root.id = searcherRoot\n+            root.style.width = 100 + 'px'\n+            root.style.height = 200 + 'px'\n+            @def = basegl.symbol root\n \n     updateView: =>\n-        @view.position.xy = @parent.node(@key).position\n+        node = @parent.node(@key)\n+        if node?\n+            @view.position.xy = node.position\n+\n+        @view.domElement.innerHTML = ''\n+\n+        input = document.createElement 'input'\n+        inputClasses = \\\n+            if @selected == 0\n+                ['searcher__input', 'searcher__input-selected']\n+            else\n+                ['searcher__input']\n+        input.className = style.luna inputClasses\n+        @view.domElement.appendChild input\n+\n+        if @entries.length > 0\n+            results = document.createElement 'div'\n+            results.className = style.luna ['searcher__results']\n+\n+            resultsList = document.createElement 'div'\n+            resultsList.className = style.luna ['searcher__results__list']\n+            results.appendChild resultsList\n+\n+            @view.domElement.appendChild results\n+\n+            i = 0\n+            for entry in @entries.slice @selected\n+                resultName = document.createElement 'div'\n+                resultName.className = style.luna ['searcher__results__item__name']\n+\n+                prefixSpan = document.createElement 'span'\n+                prefixSpan.className = style.luna ['searcher__pre']\n+                prefixSpan.innerHTML = entry.className or ''\n+                resultName.appendChild prefixSpan\n+\n+                nameSpan = document.createElement 'span'\n+                resultName.appendChild nameSpan\n+\n+                name = entry.name\n+                last = 0","path":"luna-studio/node-editor-basegl/src/view/Searcher.coffee","position":null,"original_position":70,"commit_id":"1680b3d688f4f7610f9612662fc077264db6f510","original_commit_id":"32bcc193bb6762cf8bf5bdfdbb3af3a052cb4e28","user":{"login":"pmlodawski","id":5347572,"avatar_url":"https://avatars0.githubusercontent.com/u/5347572?v=4","gravatar_id":"","url":"https://api.github.com/users/pmlodawski","html_url":"https://github.com/pmlodawski","followers_url":"https://api.github.com/users/pmlodawski/followers","following_url":"https://api.github.com/users/pmlodawski/following{/other_user}","gists_url":"https://api.github.com/users/pmlodawski/gists{/gist_id}","starred_url":"https://api.github.com/users/pmlodawski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmlodawski/subscriptions","organizations_url":"https://api.github.com/users/pmlodawski/orgs","repos_url":"https://api.github.com/users/pmlodawski/repos","events_url":"https://api.github.com/users/pmlodawski/events{/privacy}","received_events_url":"https://api.github.com/users/pmlodawski/received_events","type":"User","site_admin":false},"body":"You are right, this part was copied from recursive haskell code","created_at":"2018-03-11T22:16:42Z","updated_at":"2018-03-11T22:16:42Z","html_url":"https://github.com/luna/luna-studio/pull/855#discussion_r173672108","pull_request_url":"https://api.github.com/repos/luna/luna-studio/pulls/855","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/luna/luna-studio/pulls/comments/173672108"},"html":{"href":"https://github.com/luna/luna-studio/pull/855#discussion_r173672108"},"pull_request":{"href":"https://api.github.com/repos/luna/luna-studio/pulls/855"}},"in_reply_to_id":173185159},"pull_request":{"url":"https://api.github.com/repos/luna/luna-studio/pulls/855","id":173755050,"html_url":"https://github.com/luna/luna-studio/pull/855","diff_url":"https://github.com/luna/luna-studio/pull/855.diff","patch_url":"https://github.com/luna/luna-studio/pull/855.patch","issue_url":"https://api.github.com/repos/luna/luna-studio/issues/855","number":855,"state":"open","locked":false,"title":"Add searcher to basegl gui","user":{"login":"pmlodawski","id":5347572,"avatar_url":"https://avatars0.githubusercontent.com/u/5347572?v=4","gravatar_id":"","url":"https://api.github.com/users/pmlodawski","html_url":"https://github.com/pmlodawski","followers_url":"https://api.github.com/users/pmlodawski/followers","following_url":"https://api.github.com/users/pmlodawski/following{/other_user}","gists_url":"https://api.github.com/users/pmlodawski/gists{/gist_id}","starred_url":"https://api.github.com/users/pmlodawski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmlodawski/subscriptions","organizations_url":"https://api.github.com/users/pmlodawski/orgs","repos_url":"https://api.github.com/users/pmlodawski/repos","events_url":"https://api.github.com/users/pmlodawski/events{/privacy}","received_events_url":"https://api.github.com/users/pmlodawski/received_events","type":"User","site_admin":false},"body":"It is still missing some features:\r\n- mock node is not displayed\r\n- input is not displaying correctly\r\n- documentation is not displaying\r\n\r\nAdded styles are copied from atom version and should be reviewed.","created_at":"2018-03-08T14:47:37Z","updated_at":"2018-03-11T22:16:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d04b09976e1fd8b97f93b4a36983dee5794ca73c","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mikusp","id":2052578,"avatar_url":"https://avatars2.githubusercontent.com/u/2052578?v=4","gravatar_id":"","url":"https://api.github.com/users/mikusp","html_url":"https://github.com/mikusp","followers_url":"https://api.github.com/users/mikusp/followers","following_url":"https://api.github.com/users/mikusp/following{/other_user}","gists_url":"https://api.github.com/users/mikusp/gists{/gist_id}","starred_url":"https://api.github.com/users/mikusp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikusp/subscriptions","organizations_url":"https://api.github.com/users/mikusp/orgs","repos_url":"https://api.github.com/users/mikusp/repos","events_url":"https://api.github.com/users/mikusp/events{/privacy}","received_events_url":"https://api.github.com/users/mikusp/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/luna/luna-studio/pulls/855/commits","review_comments_url":"https://api.github.com/repos/luna/luna-studio/pulls/855/comments","review_comment_url":"https://api.github.com/repos/luna/luna-studio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/luna/luna-studio/issues/855/comments","statuses_url":"https://api.github.com/repos/luna/luna-studio/statuses/1680b3d688f4f7610f9612662fc077264db6f510","head":{"label":"luna:node-editor-basegl-searcher1","ref":"node-editor-basegl-searcher1","sha":"1680b3d688f4f7610f9612662fc077264db6f510","user":{"login":"luna","id":17415943,"avatar_url":"https://avatars0.githubusercontent.com/u/17415943?v=4","gravatar_id":"","url":"https://api.github.com/users/luna","html_url":"https://github.com/luna","followers_url":"https://api.github.com/users/luna/followers","following_url":"https://api.github.com/users/luna/following{/other_user}","gists_url":"https://api.github.com/users/luna/gists{/gist_id}","starred_url":"https://api.github.com/users/luna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luna/subscriptions","organizations_url":"https://api.github.com/users/luna/orgs","repos_url":"https://api.github.com/users/luna/repos","events_url":"https://api.github.com/users/luna/events{/privacy}","received_events_url":"https://api.github.com/users/luna/received_events","type":"Organization","site_admin":false},"repo":{"id":78853390,"name":"luna-studio","full_name":"luna/luna-studio","owner":{"login":"luna","id":17415943,"avatar_url":"https://avatars0.githubusercontent.com/u/17415943?v=4","gravatar_id":"","url":"https://api.github.com/users/luna","html_url":"https://github.com/luna","followers_url":"https://api.github.com/users/luna/followers","following_url":"https://api.github.com/users/luna/following{/other_user}","gists_url":"https://api.github.com/users/luna/gists{/gist_id}","starred_url":"https://api.github.com/users/luna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luna/subscriptions","organizations_url":"https://api.github.com/users/luna/orgs","repos_url":"https://api.github.com/users/luna/repos","events_url":"https://api.github.com/users/luna/events{/privacy}","received_events_url":"https://api.github.com/users/luna/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/luna/luna-studio","description":null,"fork":false,"url":"https://api.github.com/repos/luna/luna-studio","forks_url":"https://api.github.com/repos/luna/luna-studio/forks","keys_url":"https://api.github.com/repos/luna/luna-studio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luna/luna-studio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luna/luna-studio/teams","hooks_url":"https://api.github.com/repos/luna/luna-studio/hooks","issue_events_url":"https://api.github.com/repos/luna/luna-studio/issues/events{/number}","events_url":"https://api.github.com/repos/luna/luna-studio/events","assignees_url":"https://api.github.com/repos/luna/luna-studio/assignees{/user}","branches_url":"https://api.github.com/repos/luna/luna-studio/branches{/branch}","tags_url":"https://api.github.com/repos/luna/luna-studio/tags","blobs_url":"https://api.github.com/repos/luna/luna-studio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luna/luna-studio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luna/luna-studio/git/refs{/sha}","trees_url":"https://api.github.com/repos/luna/luna-studio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luna/luna-studio/statuses/{sha}","languages_url":"https://api.github.com/repos/luna/luna-studio/languages","stargazers_url":"https://api.github.com/repos/luna/luna-studio/stargazers","contributors_url":"https://api.github.com/repos/luna/luna-studio/contributors","subscribers_url":"https://api.github.com/repos/luna/luna-studio/subscribers","subscription_url":"https://api.github.com/repos/luna/luna-studio/subscription","commits_url":"https://api.github.com/repos/luna/luna-studio/commits{/sha}","git_commits_url":"https://api.github.com/repos/luna/luna-studio/git/commits{/sha}","comments_url":"https://api.github.com/repos/luna/luna-studio/comments{/number}","issue_comment_url":"https://api.github.com/repos/luna/luna-studio/issues/comments{/number}","contents_url":"https://api.github.com/repos/luna/luna-studio/contents/{+path}","compare_url":"https://api.github.com/repos/luna/luna-studio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luna/luna-studio/merges","archive_url":"https://api.github.com/repos/luna/luna-studio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luna/luna-studio/downloads","issues_url":"https://api.github.com/repos/luna/luna-studio/issues{/number}","pulls_url":"https://api.github.com/repos/luna/luna-studio/pulls{/number}","milestones_url":"https://api.github.com/repos/luna/luna-studio/milestones{/number}","notifications_url":"https://api.github.com/repos/luna/luna-studio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luna/luna-studio/labels{/name}","releases_url":"https://api.github.com/repos/luna/luna-studio/releases{/id}","deployments_url":"https://api.github.com/repos/luna/luna-studio/deployments","created_at":"2017-01-13T13:51:54Z","updated_at":"2018-03-09T20:46:11Z","pushed_at":"2018-03-11T21:50:04Z","git_url":"git://github.com/luna/luna-studio.git","ssh_url":"git@github.com:luna/luna-studio.git","clone_url":"https://github.com/luna/luna-studio.git","svn_url":"https://github.com/luna/luna-studio","homepage":null,"size":55738,"stargazers_count":154,"watchers_count":154,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":247,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":9,"open_issues":247,"watchers":154,"default_branch":"master"}},"base":{"label":"luna:node-editor-basegl_master","ref":"node-editor-basegl_master","sha":"73b8789d33dd0624a7aa9c0115ae592507a2d294","user":{"login":"luna","id":17415943,"avatar_url":"https://avatars0.githubusercontent.com/u/17415943?v=4","gravatar_id":"","url":"https://api.github.com/users/luna","html_url":"https://github.com/luna","followers_url":"https://api.github.com/users/luna/followers","following_url":"https://api.github.com/users/luna/following{/other_user}","gists_url":"https://api.github.com/users/luna/gists{/gist_id}","starred_url":"https://api.github.com/users/luna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luna/subscriptions","organizations_url":"https://api.github.com/users/luna/orgs","repos_url":"https://api.github.com/users/luna/repos","events_url":"https://api.github.com/users/luna/events{/privacy}","received_events_url":"https://api.github.com/users/luna/received_events","type":"Organization","site_admin":false},"repo":{"id":78853390,"name":"luna-studio","full_name":"luna/luna-studio","owner":{"login":"luna","id":17415943,"avatar_url":"https://avatars0.githubusercontent.com/u/17415943?v=4","gravatar_id":"","url":"https://api.github.com/users/luna","html_url":"https://github.com/luna","followers_url":"https://api.github.com/users/luna/followers","following_url":"https://api.github.com/users/luna/following{/other_user}","gists_url":"https://api.github.com/users/luna/gists{/gist_id}","starred_url":"https://api.github.com/users/luna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luna/subscriptions","organizations_url":"https://api.github.com/users/luna/orgs","repos_url":"https://api.github.com/users/luna/repos","events_url":"https://api.github.com/users/luna/events{/privacy}","received_events_url":"https://api.github.com/users/luna/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/luna/luna-studio","description":null,"fork":false,"url":"https://api.github.com/repos/luna/luna-studio","forks_url":"https://api.github.com/repos/luna/luna-studio/forks","keys_url":"https://api.github.com/repos/luna/luna-studio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luna/luna-studio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luna/luna-studio/teams","hooks_url":"https://api.github.com/repos/luna/luna-studio/hooks","issue_events_url":"https://api.github.com/repos/luna/luna-studio/issues/events{/number}","events_url":"https://api.github.com/repos/luna/luna-studio/events","assignees_url":"https://api.github.com/repos/luna/luna-studio/assignees{/user}","branches_url":"https://api.github.com/repos/luna/luna-studio/branches{/branch}","tags_url":"https://api.github.com/repos/luna/luna-studio/tags","blobs_url":"https://api.github.com/repos/luna/luna-studio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luna/luna-studio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luna/luna-studio/git/refs{/sha}","trees_url":"https://api.github.com/repos/luna/luna-studio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luna/luna-studio/statuses/{sha}","languages_url":"https://api.github.com/repos/luna/luna-studio/languages","stargazers_url":"https://api.github.com/repos/luna/luna-studio/stargazers","contributors_url":"https://api.github.com/repos/luna/luna-studio/contributors","subscribers_url":"https://api.github.com/repos/luna/luna-studio/subscribers","subscription_url":"https://api.github.com/repos/luna/luna-studio/subscription","commits_url":"https://api.github.com/repos/luna/luna-studio/commits{/sha}","git_commits_url":"https://api.github.com/repos/luna/luna-studio/git/commits{/sha}","comments_url":"https://api.github.com/repos/luna/luna-studio/comments{/number}","issue_comment_url":"https://api.github.com/repos/luna/luna-studio/issues/comments{/number}","contents_url":"https://api.github.com/repos/luna/luna-studio/contents/{+path}","compare_url":"https://api.github.com/repos/luna/luna-studio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luna/luna-studio/merges","archive_url":"https://api.github.com/repos/luna/luna-studio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luna/luna-studio/downloads","issues_url":"https://api.github.com/repos/luna/luna-studio/issues{/number}","pulls_url":"https://api.github.com/repos/luna/luna-studio/pulls{/number}","milestones_url":"https://api.github.com/repos/luna/luna-studio/milestones{/number}","notifications_url":"https://api.github.com/repos/luna/luna-studio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luna/luna-studio/labels{/name}","releases_url":"https://api.github.com/repos/luna/luna-studio/releases{/id}","deployments_url":"https://api.github.com/repos/luna/luna-studio/deployments","created_at":"2017-01-13T13:51:54Z","updated_at":"2018-03-09T20:46:11Z","pushed_at":"2018-03-11T21:50:04Z","git_url":"git://github.com/luna/luna-studio.git","ssh_url":"git@github.com:luna/luna-studio.git","clone_url":"https://github.com/luna/luna-studio.git","svn_url":"https://github.com/luna/luna-studio","homepage":null,"size":55738,"stargazers_count":154,"watchers_count":154,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":247,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":9,"open_issues":247,"watchers":154,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/luna/luna-studio/pulls/855"},"html":{"href":"https://github.com/luna/luna-studio/pull/855"},"issue":{"href":"https://api.github.com/repos/luna/luna-studio/issues/855"},"comments":{"href":"https://api.github.com/repos/luna/luna-studio/issues/855/comments"},"review_comments":{"href":"https://api.github.com/repos/luna/luna-studio/pulls/855/comments"},"review_comment":{"href":"https://api.github.com/repos/luna/luna-studio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/luna/luna-studio/pulls/855/commits"},"statuses":{"href":"https://api.github.com/repos/luna/luna-studio/statuses/1680b3d688f4f7610f9612662fc077264db6f510"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pmlodawski"}}