{"action":"created","comment":{"url":"https://api.github.com/repos/w3c/respec/pulls/comments/176351735","pull_request_review_id":106036567,"id":176351735,"diff_hunk":"@@ -146,50 +170,89 @@ function handleIssues($ins, ghIssues, conf) {\n   }\n }\n \n-async function fetchIssuesFromGithub({ githubAPI }) {\n-  const issues = [];\n-  const issueNumbers = [...document.querySelectorAll(\".issue[data-number]\")]\n-    .map(elem => Number.parseInt(elem.dataset.number, 10))\n-    .filter(number => number);\n-  for (const issueNumber of issueNumbers) {\n-    let issue; // depends on how fetching goes...\n+//derives the text-color-class based on the illumination score of the labelColor\n+function deriveTextColorClass(hexColor) {\n+  const rgb = parseInt(hexColor, 16);\n+  if (isNaN(rgb)) {\n+    throw new TypeError(`Invalid hex color: ${hexColor}`);\n+  }\n+  const red = (rgb >> 16) & 0xff;\n+  const green = (rgb >> 8) & 0xff;\n+  const blue = (rgb >> 0) & 0xff;\n+  const illumination = 0.2126 * red + 0.7152 * green + 0.0722 * blue;\n+  return illumination > 140 ? \"light\" : \"dark\";\n+}\n+\n+function createLabel(label) {\n+  const { color, href, name } = label;\n+  let textColorClass = \"dark\";\n+  try {\n+    textColorClass = deriveTextColorClass(color);\n+  } catch (err) {\n+    console.error(err);\n+  }\n+  const cssClasses = `respec-gh-label respec-label-${textColorClass}`;\n+  const style = `background-color: #${color}`;\n+  return hyperHTML`<a\n+    class=\"${cssClasses}\"\n+    style=\"${style}\"\n+    href=\"${href}\">${name}</a>`;\n+}\n+\n+async function processResponse(response, issueNumber) {\n+  const issue = { title: \"\", number: issueNumber, state: \"\" };\n+  const jsonPromise = response.json();\n+  if (!response.ok) {\n+    const errJson = { message: \"\" };\n+    try {\n+      Object.assign(errJson, await jsonPromise);\n+    } catch (err) {\n+      errJson.message = `Error JSON parsing issue #${issueNumber} from GitHub.`;\n+    } finally {\n+      const msg = `Error fetching issue #${issueNumber} from GitHub. ${issue.message} (HTTP Status ${response.status}).`;","path":"src/core/issues-notes.js","position":92,"original_position":92,"commit_id":"f5e10053f786617743efd97b307fef5b431e4355","original_commit_id":"f5e10053f786617743efd97b307fef5b431e4355","user":{"login":"marcoscaceres","id":870154,"avatar_url":"https://avatars1.githubusercontent.com/u/870154?v=4","gravatar_id":"","url":"https://api.github.com/users/marcoscaceres","html_url":"https://github.com/marcoscaceres","followers_url":"https://api.github.com/users/marcoscaceres/followers","following_url":"https://api.github.com/users/marcoscaceres/following{/other_user}","gists_url":"https://api.github.com/users/marcoscaceres/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoscaceres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoscaceres/subscriptions","organizations_url":"https://api.github.com/users/marcoscaceres/orgs","repos_url":"https://api.github.com/users/marcoscaceres/repos","events_url":"https://api.github.com/users/marcoscaceres/events{/privacy}","received_events_url":"https://api.github.com/users/marcoscaceres/received_events","type":"User","site_admin":false},"body":"Yeah, I hated this too :( ... I was worried that \"message\" would have other semantics in the issue response. ","created_at":"2018-03-22T09:23:47Z","updated_at":"2018-03-22T09:23:47Z","html_url":"https://github.com/w3c/respec/pull/1583#discussion_r176351735","pull_request_url":"https://api.github.com/repos/w3c/respec/pulls/1583","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/w3c/respec/pulls/comments/176351735"},"html":{"href":"https://github.com/w3c/respec/pull/1583#discussion_r176351735"},"pull_request":{"href":"https://api.github.com/repos/w3c/respec/pulls/1583"}},"in_reply_to_id":176320963},"pull_request":{"url":"https://api.github.com/repos/w3c/respec/pulls/1583","id":176422208,"html_url":"https://github.com/w3c/respec/pull/1583","diff_url":"https://github.com/w3c/respec/pull/1583.diff","patch_url":"https://github.com/w3c/respec/pull/1583.patch","issue_url":"https://api.github.com/repos/w3c/respec/issues/1583","number":1583,"state":"open","locked":false,"title":"WIP - refactor to do concurrent fetch","user":{"login":"marcoscaceres","id":870154,"avatar_url":"https://avatars1.githubusercontent.com/u/870154?v=4","gravatar_id":"","url":"https://api.github.com/users/marcoscaceres","html_url":"https://github.com/marcoscaceres","followers_url":"https://api.github.com/users/marcoscaceres/followers","following_url":"https://api.github.com/users/marcoscaceres/following{/other_user}","gists_url":"https://api.github.com/users/marcoscaceres/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoscaceres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoscaceres/subscriptions","organizations_url":"https://api.github.com/users/marcoscaceres/orgs","repos_url":"https://api.github.com/users/marcoscaceres/repos","events_url":"https://api.github.com/users/marcoscaceres/events{/privacy}","received_events_url":"https://api.github.com/users/marcoscaceres/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-21T09:44:31Z","updated_at":"2018-03-22T09:23:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ad36e8c99f7881c8eb710a84facdd5d8e0da75c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/w3c/respec/pulls/1583/commits","review_comments_url":"https://api.github.com/repos/w3c/respec/pulls/1583/comments","review_comment_url":"https://api.github.com/repos/w3c/respec/pulls/comments{/number}","comments_url":"https://api.github.com/repos/w3c/respec/issues/1583/comments","statuses_url":"https://api.github.com/repos/w3c/respec/statuses/f5e10053f786617743efd97b307fef5b431e4355","head":{"label":"w3c:issues_concurrent","ref":"issues_concurrent","sha":"f5e10053f786617743efd97b307fef5b431e4355","user":{"login":"w3c","id":379216,"avatar_url":"https://avatars2.githubusercontent.com/u/379216?v=4","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"repo":{"id":4287066,"name":"respec","full_name":"w3c/respec","owner":{"login":"w3c","id":379216,"avatar_url":"https://avatars2.githubusercontent.com/u/379216?v=4","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/w3c/respec","description":"A tool for creating technical documents and web standards","fork":false,"url":"https://api.github.com/repos/w3c/respec","forks_url":"https://api.github.com/repos/w3c/respec/forks","keys_url":"https://api.github.com/repos/w3c/respec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/w3c/respec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/w3c/respec/teams","hooks_url":"https://api.github.com/repos/w3c/respec/hooks","issue_events_url":"https://api.github.com/repos/w3c/respec/issues/events{/number}","events_url":"https://api.github.com/repos/w3c/respec/events","assignees_url":"https://api.github.com/repos/w3c/respec/assignees{/user}","branches_url":"https://api.github.com/repos/w3c/respec/branches{/branch}","tags_url":"https://api.github.com/repos/w3c/respec/tags","blobs_url":"https://api.github.com/repos/w3c/respec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/w3c/respec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/w3c/respec/git/refs{/sha}","trees_url":"https://api.github.com/repos/w3c/respec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/w3c/respec/statuses/{sha}","languages_url":"https://api.github.com/repos/w3c/respec/languages","stargazers_url":"https://api.github.com/repos/w3c/respec/stargazers","contributors_url":"https://api.github.com/repos/w3c/respec/contributors","subscribers_url":"https://api.github.com/repos/w3c/respec/subscribers","subscription_url":"https://api.github.com/repos/w3c/respec/subscription","commits_url":"https://api.github.com/repos/w3c/respec/commits{/sha}","git_commits_url":"https://api.github.com/repos/w3c/respec/git/commits{/sha}","comments_url":"https://api.github.com/repos/w3c/respec/comments{/number}","issue_comment_url":"https://api.github.com/repos/w3c/respec/issues/comments{/number}","contents_url":"https://api.github.com/repos/w3c/respec/contents/{+path}","compare_url":"https://api.github.com/repos/w3c/respec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/w3c/respec/merges","archive_url":"https://api.github.com/repos/w3c/respec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/w3c/respec/downloads","issues_url":"https://api.github.com/repos/w3c/respec/issues{/number}","pulls_url":"https://api.github.com/repos/w3c/respec/pulls{/number}","milestones_url":"https://api.github.com/repos/w3c/respec/milestones{/number}","notifications_url":"https://api.github.com/repos/w3c/respec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/w3c/respec/labels{/name}","releases_url":"https://api.github.com/repos/w3c/respec/releases{/id}","deployments_url":"https://api.github.com/repos/w3c/respec/deployments","created_at":"2012-05-10T16:39:37Z","updated_at":"2018-03-21T23:49:31Z","pushed_at":"2018-03-22T01:55:32Z","git_url":"git://github.com/w3c/respec.git","ssh_url":"git@github.com:w3c/respec.git","clone_url":"https://github.com/w3c/respec.git","svn_url":"https://github.com/w3c/respec","homepage":"","size":36585,"stargazers_count":229,"watchers_count":229,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":184,"mirror_url":null,"archived":false,"open_issues_count":126,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":184,"open_issues":126,"watchers":229,"default_branch":"develop"}},"base":{"label":"w3c:develop","ref":"develop","sha":"6c6bdbfde811bbd4278ad05b1818c34584346eda","user":{"login":"w3c","id":379216,"avatar_url":"https://avatars2.githubusercontent.com/u/379216?v=4","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"repo":{"id":4287066,"name":"respec","full_name":"w3c/respec","owner":{"login":"w3c","id":379216,"avatar_url":"https://avatars2.githubusercontent.com/u/379216?v=4","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/w3c/respec","description":"A tool for creating technical documents and web standards","fork":false,"url":"https://api.github.com/repos/w3c/respec","forks_url":"https://api.github.com/repos/w3c/respec/forks","keys_url":"https://api.github.com/repos/w3c/respec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/w3c/respec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/w3c/respec/teams","hooks_url":"https://api.github.com/repos/w3c/respec/hooks","issue_events_url":"https://api.github.com/repos/w3c/respec/issues/events{/number}","events_url":"https://api.github.com/repos/w3c/respec/events","assignees_url":"https://api.github.com/repos/w3c/respec/assignees{/user}","branches_url":"https://api.github.com/repos/w3c/respec/branches{/branch}","tags_url":"https://api.github.com/repos/w3c/respec/tags","blobs_url":"https://api.github.com/repos/w3c/respec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/w3c/respec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/w3c/respec/git/refs{/sha}","trees_url":"https://api.github.com/repos/w3c/respec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/w3c/respec/statuses/{sha}","languages_url":"https://api.github.com/repos/w3c/respec/languages","stargazers_url":"https://api.github.com/repos/w3c/respec/stargazers","contributors_url":"https://api.github.com/repos/w3c/respec/contributors","subscribers_url":"https://api.github.com/repos/w3c/respec/subscribers","subscription_url":"https://api.github.com/repos/w3c/respec/subscription","commits_url":"https://api.github.com/repos/w3c/respec/commits{/sha}","git_commits_url":"https://api.github.com/repos/w3c/respec/git/commits{/sha}","comments_url":"https://api.github.com/repos/w3c/respec/comments{/number}","issue_comment_url":"https://api.github.com/repos/w3c/respec/issues/comments{/number}","contents_url":"https://api.github.com/repos/w3c/respec/contents/{+path}","compare_url":"https://api.github.com/repos/w3c/respec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/w3c/respec/merges","archive_url":"https://api.github.com/repos/w3c/respec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/w3c/respec/downloads","issues_url":"https://api.github.com/repos/w3c/respec/issues{/number}","pulls_url":"https://api.github.com/repos/w3c/respec/pulls{/number}","milestones_url":"https://api.github.com/repos/w3c/respec/milestones{/number}","notifications_url":"https://api.github.com/repos/w3c/respec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/w3c/respec/labels{/name}","releases_url":"https://api.github.com/repos/w3c/respec/releases{/id}","deployments_url":"https://api.github.com/repos/w3c/respec/deployments","created_at":"2012-05-10T16:39:37Z","updated_at":"2018-03-21T23:49:31Z","pushed_at":"2018-03-22T01:55:32Z","git_url":"git://github.com/w3c/respec.git","ssh_url":"git@github.com:w3c/respec.git","clone_url":"https://github.com/w3c/respec.git","svn_url":"https://github.com/w3c/respec","homepage":"","size":36585,"stargazers_count":229,"watchers_count":229,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":184,"mirror_url":null,"archived":false,"open_issues_count":126,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":184,"open_issues":126,"watchers":229,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/w3c/respec/pulls/1583"},"html":{"href":"https://github.com/w3c/respec/pull/1583"},"issue":{"href":"https://api.github.com/repos/w3c/respec/issues/1583"},"comments":{"href":"https://api.github.com/repos/w3c/respec/issues/1583/comments"},"review_comments":{"href":"https://api.github.com/repos/w3c/respec/pulls/1583/comments"},"review_comment":{"href":"https://api.github.com/repos/w3c/respec/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/w3c/respec/pulls/1583/commits"},"statuses":{"href":"https://api.github.com/repos/w3c/respec/statuses/f5e10053f786617743efd97b307fef5b431e4355"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"marcoscaceres"}}