{"action":"created","comment":{"url":"https://api.github.com/repos/kowainik/summoner/pulls/comments/236076053","pull_request_review_id":178084547,"id":236076053,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjA3NjA1Mw==","diff_hunk":"@@ -89,27 +89,60 @@ appNew dirs = App\n         VtyEvent (V.EvKey V.KEsc []) -> halt s\n         VtyEvent (V.EvKey (V.KChar 'd') [V.MCtrl]) ->\n             withForm ev s (validateForm . ctrlD)\n-        MouseDown n _ _ _ -> case n of\n-            StackField     -> withForm ev s mkNewForm\n-            GitHubEnable   -> withForm ev s mkNewForm\n-            GitHubDisable  -> withForm ev s mkNewForm\n-            GitHubNoUpload -> withForm ev s mkNewForm\n-            _              -> withForm ev s id\n-        _ -> withForm ev s validateForm\n+\n+        -- Handle active/inactive checkboxes\n+        VtyEvent (V.EvKey (V.KChar ' ') []) -> case getCurrentFocus s of\n+            Nothing    -> withFormDef ev s\n+            Just field -> handleCheckboxActivation ev s field\n+        MouseDown n _ _ _ -> handleCheckboxActivation ev s n\n+\n+        -- Handle skip of deactivated checkboxes\n+        VtyEvent (V.EvKey (V.KChar '\\t') []) -> loopWhileInactive ev s\n+        VtyEvent (V.EvKey V.KBackTab     []) -> loopWhileInactive ev s\n+\n+        -- Default action\n+        _ -> withFormDef ev s\n \n     , appChooseCursor = focusRingCursor formFocus\n     , appStartEvent = pure\n     , appAttrMap = const theMap\n     }\n   where\n-    withForm ev s f = handleFormEvent ev s >>= continue . f\n+    withForm  ev s f = handleFormEvent ev s >>= continue . f\n+    withFormDef ev s = withForm ev s validateForm\n \n     validateForm :: KitForm e -> KitForm e\n     validateForm = summonFormValidation dirs\n \n     mkNewForm :: KitForm e -> KitForm e\n     mkNewForm = recreateForm validateForm\n \n+    -- Activate/Deactivate checkboxes depending on current field change\n+    handleCheckboxActivation\n+        :: BrickEvent SummonForm e\n+        -> KitForm e\n+        -> SummonForm\n+        -> EventM SummonForm (Next (KitForm e))\n+    handleCheckboxActivation ev form = \\case\n+        StackField     -> withForm ev form mkNewForm\n+        GitHubEnable   -> withForm ev form mkNewForm\n+        GitHubDisable  -> withForm ev form mkNewForm\n+        GitHubNoUpload -> withForm ev form mkNewForm\n+        _              -> withFormDef ev form\n+\n+    -- Handles form event until current element is active\n+    loopWhileInactive\n+        :: BrickEvent SummonForm e\n+        -> KitForm e\n+        -> EventM SummonForm (Next (KitForm e))\n+    loopWhileInactive ev form = do\n+        newForm <- handleFormEvent ev form\n+        case getCurrentFocus newForm of\n+            Nothing -> continue newForm\n+            Just field -> if not $ isActive (formState newForm) field\n+                then loopWhileInactive ev newForm\n+                else continue newForm","path":"summoner-tui/src/Summoner/Tui.hs","position":82,"original_position":82,"commit_id":"b35e07ea9425a317c6257e100424550d6ba83090","original_commit_id":"b35e07ea9425a317c6257e100424550d6ba83090","user":{"login":"vrom911","id":8126674,"node_id":"MDQ6VXNlcjgxMjY2NzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/8126674?v=4","gravatar_id":"","url":"https://api.github.com/users/vrom911","html_url":"https://github.com/vrom911","followers_url":"https://api.github.com/users/vrom911/followers","following_url":"https://api.github.com/users/vrom911/following{/other_user}","gists_url":"https://api.github.com/users/vrom911/gists{/gist_id}","starred_url":"https://api.github.com/users/vrom911/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vrom911/subscriptions","organizations_url":"https://api.github.com/users/vrom911/orgs","repos_url":"https://api.github.com/users/vrom911/repos","events_url":"https://api.github.com/users/vrom911/events{/privacy}","received_events_url":"https://api.github.com/users/vrom911/received_events","type":"User","site_admin":false},"body":"Cool!","created_at":"2018-11-25T14:48:57Z","updated_at":"2018-11-25T14:50:42Z","html_url":"https://github.com/kowainik/summoner/pull/242#discussion_r236076053","pull_request_url":"https://api.github.com/repos/kowainik/summoner/pulls/242","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/kowainik/summoner/pulls/comments/236076053"},"html":{"href":"https://github.com/kowainik/summoner/pull/242#discussion_r236076053"},"pull_request":{"href":"https://api.github.com/repos/kowainik/summoner/pulls/242"}}},"pull_request":{"url":"https://api.github.com/repos/kowainik/summoner/pulls/242","id":233379466,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMzc5NDY2","html_url":"https://github.com/kowainik/summoner/pull/242","diff_url":"https://github.com/kowainik/summoner/pull/242.diff","patch_url":"https://github.com/kowainik/summoner/pull/242.patch","issue_url":"https://api.github.com/repos/kowainik/summoner/issues/242","number":242,"state":"open","locked":false,"title":"[#208] Handle checkboxes better","user":{"login":"ChShersh","id":4276606,"node_id":"MDQ6VXNlcjQyNzY2MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/4276606?v=4","gravatar_id":"","url":"https://api.github.com/users/ChShersh","html_url":"https://github.com/ChShersh","followers_url":"https://api.github.com/users/ChShersh/followers","following_url":"https://api.github.com/users/ChShersh/following{/other_user}","gists_url":"https://api.github.com/users/ChShersh/gists{/gist_id}","starred_url":"https://api.github.com/users/ChShersh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChShersh/subscriptions","organizations_url":"https://api.github.com/users/ChShersh/orgs","repos_url":"https://api.github.com/users/ChShersh/repos","events_url":"https://api.github.com/users/ChShersh/events{/privacy}","received_events_url":"https://api.github.com/users/ChShersh/received_events","type":"User","site_admin":false},"body":"Resolves :heavy_check_mark: \r\n\r\n* Handles `Space` on activatable checkboxes\r\n* Skips deactivated checkboxes when using `Tab/BackTab`","created_at":"2018-11-25T14:39:38Z","updated_at":"2018-11-25T14:50:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05c4764ee82155f9295516269c5eacb102f574ad","assignee":{"login":"ChShersh","id":4276606,"node_id":"MDQ6VXNlcjQyNzY2MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/4276606?v=4","gravatar_id":"","url":"https://api.github.com/users/ChShersh","html_url":"https://github.com/ChShersh","followers_url":"https://api.github.com/users/ChShersh/followers","following_url":"https://api.github.com/users/ChShersh/following{/other_user}","gists_url":"https://api.github.com/users/ChShersh/gists{/gist_id}","starred_url":"https://api.github.com/users/ChShersh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChShersh/subscriptions","organizations_url":"https://api.github.com/users/ChShersh/orgs","repos_url":"https://api.github.com/users/ChShersh/repos","events_url":"https://api.github.com/users/ChShersh/events{/privacy}","received_events_url":"https://api.github.com/users/ChShersh/received_events","type":"User","site_admin":false},"assignees":[{"login":"ChShersh","id":4276606,"node_id":"MDQ6VXNlcjQyNzY2MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/4276606?v=4","gravatar_id":"","url":"https://api.github.com/users/ChShersh","html_url":"https://github.com/ChShersh","followers_url":"https://api.github.com/users/ChShersh/followers","following_url":"https://api.github.com/users/ChShersh/following{/other_user}","gists_url":"https://api.github.com/users/ChShersh/gists{/gist_id}","starred_url":"https://api.github.com/users/ChShersh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChShersh/subscriptions","organizations_url":"https://api.github.com/users/ChShersh/orgs","repos_url":"https://api.github.com/users/ChShersh/repos","events_url":"https://api.github.com/users/ChShersh/events{/privacy}","received_events_url":"https://api.github.com/users/ChShersh/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"willbasky","id":28530747,"node_id":"MDQ6VXNlcjI4NTMwNzQ3","avatar_url":"https://avatars3.githubusercontent.com/u/28530747?v=4","gravatar_id":"","url":"https://api.github.com/users/willbasky","html_url":"https://github.com/willbasky","followers_url":"https://api.github.com/users/willbasky/followers","following_url":"https://api.github.com/users/willbasky/following{/other_user}","gists_url":"https://api.github.com/users/willbasky/gists{/gist_id}","starred_url":"https://api.github.com/users/willbasky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willbasky/subscriptions","organizations_url":"https://api.github.com/users/willbasky/orgs","repos_url":"https://api.github.com/users/willbasky/repos","events_url":"https://api.github.com/users/willbasky/events{/privacy}","received_events_url":"https://api.github.com/users/willbasky/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1106481405,"node_id":"MDU6TGFiZWwxMTA2NDgxNDA1","url":"https://api.github.com/repos/kowainik/summoner/labels/TUI","name":"TUI","color":"cb4154","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kowainik/summoner/pulls/242/commits","review_comments_url":"https://api.github.com/repos/kowainik/summoner/pulls/242/comments","review_comment_url":"https://api.github.com/repos/kowainik/summoner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kowainik/summoner/issues/242/comments","statuses_url":"https://api.github.com/repos/kowainik/summoner/statuses/b35e07ea9425a317c6257e100424550d6ba83090","head":{"label":"kowainik:chshersh/fix-checkboxes","ref":"chshersh/fix-checkboxes","sha":"b35e07ea9425a317c6257e100424550d6ba83090","user":{"login":"kowainik","id":37126241,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MTI2MjQx","avatar_url":"https://avatars3.githubusercontent.com/u/37126241?v=4","gravatar_id":"","url":"https://api.github.com/users/kowainik","html_url":"https://github.com/kowainik","followers_url":"https://api.github.com/users/kowainik/followers","following_url":"https://api.github.com/users/kowainik/following{/other_user}","gists_url":"https://api.github.com/users/kowainik/gists{/gist_id}","starred_url":"https://api.github.com/users/kowainik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kowainik/subscriptions","organizations_url":"https://api.github.com/users/kowainik/orgs","repos_url":"https://api.github.com/users/kowainik/repos","events_url":"https://api.github.com/users/kowainik/events{/privacy}","received_events_url":"https://api.github.com/users/kowainik/received_events","type":"Organization","site_admin":false},"repo":{"id":100754186,"node_id":"MDEwOlJlcG9zaXRvcnkxMDA3NTQxODY=","name":"summoner","full_name":"kowainik/summoner","private":false,"owner":{"login":"kowainik","id":37126241,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MTI2MjQx","avatar_url":"https://avatars3.githubusercontent.com/u/37126241?v=4","gravatar_id":"","url":"https://api.github.com/users/kowainik","html_url":"https://github.com/kowainik","followers_url":"https://api.github.com/users/kowainik/followers","following_url":"https://api.github.com/users/kowainik/following{/other_user}","gists_url":"https://api.github.com/users/kowainik/gists{/gist_id}","starred_url":"https://api.github.com/users/kowainik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kowainik/subscriptions","organizations_url":"https://api.github.com/users/kowainik/orgs","repos_url":"https://api.github.com/users/kowainik/repos","events_url":"https://api.github.com/users/kowainik/events{/privacy}","received_events_url":"https://api.github.com/users/kowainik/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/kowainik/summoner","description":"🔮 🔧 Tool for scaffolding completely configured production Haskell projects","fork":false,"url":"https://api.github.com/repos/kowainik/summoner","forks_url":"https://api.github.com/repos/kowainik/summoner/forks","keys_url":"https://api.github.com/repos/kowainik/summoner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kowainik/summoner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kowainik/summoner/teams","hooks_url":"https://api.github.com/repos/kowainik/summoner/hooks","issue_events_url":"https://api.github.com/repos/kowainik/summoner/issues/events{/number}","events_url":"https://api.github.com/repos/kowainik/summoner/events","assignees_url":"https://api.github.com/repos/kowainik/summoner/assignees{/user}","branches_url":"https://api.github.com/repos/kowainik/summoner/branches{/branch}","tags_url":"https://api.github.com/repos/kowainik/summoner/tags","blobs_url":"https://api.github.com/repos/kowainik/summoner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kowainik/summoner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kowainik/summoner/git/refs{/sha}","trees_url":"https://api.github.com/repos/kowainik/summoner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kowainik/summoner/statuses/{sha}","languages_url":"https://api.github.com/repos/kowainik/summoner/languages","stargazers_url":"https://api.github.com/repos/kowainik/summoner/stargazers","contributors_url":"https://api.github.com/repos/kowainik/summoner/contributors","subscribers_url":"https://api.github.com/repos/kowainik/summoner/subscribers","subscription_url":"https://api.github.com/repos/kowainik/summoner/subscription","commits_url":"https://api.github.com/repos/kowainik/summoner/commits{/sha}","git_commits_url":"https://api.github.com/repos/kowainik/summoner/git/commits{/sha}","comments_url":"https://api.github.com/repos/kowainik/summoner/comments{/number}","issue_comment_url":"https://api.github.com/repos/kowainik/summoner/issues/comments{/number}","contents_url":"https://api.github.com/repos/kowainik/summoner/contents/{+path}","compare_url":"https://api.github.com/repos/kowainik/summoner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kowainik/summoner/merges","archive_url":"https://api.github.com/repos/kowainik/summoner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kowainik/summoner/downloads","issues_url":"https://api.github.com/repos/kowainik/summoner/issues{/number}","pulls_url":"https://api.github.com/repos/kowainik/summoner/pulls{/number}","milestones_url":"https://api.github.com/repos/kowainik/summoner/milestones{/number}","notifications_url":"https://api.github.com/repos/kowainik/summoner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kowainik/summoner/labels{/name}","releases_url":"https://api.github.com/repos/kowainik/summoner/releases{/id}","deployments_url":"https://api.github.com/repos/kowainik/summoner/deployments","created_at":"2017-08-18T22:18:39Z","updated_at":"2018-11-19T13:28:44Z","pushed_at":"2018-11-25T14:39:38Z","git_url":"git://github.com/kowainik/summoner.git","ssh_url":"git@github.com:kowainik/summoner.git","clone_url":"https://github.com/kowainik/summoner.git","svn_url":"https://github.com/kowainik/summoner","homepage":"https://kowainik.github.io/projects/summoner","size":422,"stargazers_count":170,"watchers_count":170,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":30,"open_issues":25,"watchers":170,"default_branch":"master"}},"base":{"label":"kowainik:develop","ref":"develop","sha":"2bace42b571f138c83cd0d732254f9b3073f1461","user":{"login":"kowainik","id":37126241,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MTI2MjQx","avatar_url":"https://avatars3.githubusercontent.com/u/37126241?v=4","gravatar_id":"","url":"https://api.github.com/users/kowainik","html_url":"https://github.com/kowainik","followers_url":"https://api.github.com/users/kowainik/followers","following_url":"https://api.github.com/users/kowainik/following{/other_user}","gists_url":"https://api.github.com/users/kowainik/gists{/gist_id}","starred_url":"https://api.github.com/users/kowainik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kowainik/subscriptions","organizations_url":"https://api.github.com/users/kowainik/orgs","repos_url":"https://api.github.com/users/kowainik/repos","events_url":"https://api.github.com/users/kowainik/events{/privacy}","received_events_url":"https://api.github.com/users/kowainik/received_events","type":"Organization","site_admin":false},"repo":{"id":100754186,"node_id":"MDEwOlJlcG9zaXRvcnkxMDA3NTQxODY=","name":"summoner","full_name":"kowainik/summoner","private":false,"owner":{"login":"kowainik","id":37126241,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MTI2MjQx","avatar_url":"https://avatars3.githubusercontent.com/u/37126241?v=4","gravatar_id":"","url":"https://api.github.com/users/kowainik","html_url":"https://github.com/kowainik","followers_url":"https://api.github.com/users/kowainik/followers","following_url":"https://api.github.com/users/kowainik/following{/other_user}","gists_url":"https://api.github.com/users/kowainik/gists{/gist_id}","starred_url":"https://api.github.com/users/kowainik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kowainik/subscriptions","organizations_url":"https://api.github.com/users/kowainik/orgs","repos_url":"https://api.github.com/users/kowainik/repos","events_url":"https://api.github.com/users/kowainik/events{/privacy}","received_events_url":"https://api.github.com/users/kowainik/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/kowainik/summoner","description":"🔮 🔧 Tool for scaffolding completely configured production Haskell projects","fork":false,"url":"https://api.github.com/repos/kowainik/summoner","forks_url":"https://api.github.com/repos/kowainik/summoner/forks","keys_url":"https://api.github.com/repos/kowainik/summoner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kowainik/summoner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kowainik/summoner/teams","hooks_url":"https://api.github.com/repos/kowainik/summoner/hooks","issue_events_url":"https://api.github.com/repos/kowainik/summoner/issues/events{/number}","events_url":"https://api.github.com/repos/kowainik/summoner/events","assignees_url":"https://api.github.com/repos/kowainik/summoner/assignees{/user}","branches_url":"https://api.github.com/repos/kowainik/summoner/branches{/branch}","tags_url":"https://api.github.com/repos/kowainik/summoner/tags","blobs_url":"https://api.github.com/repos/kowainik/summoner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kowainik/summoner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kowainik/summoner/git/refs{/sha}","trees_url":"https://api.github.com/repos/kowainik/summoner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kowainik/summoner/statuses/{sha}","languages_url":"https://api.github.com/repos/kowainik/summoner/languages","stargazers_url":"https://api.github.com/repos/kowainik/summoner/stargazers","contributors_url":"https://api.github.com/repos/kowainik/summoner/contributors","subscribers_url":"https://api.github.com/repos/kowainik/summoner/subscribers","subscription_url":"https://api.github.com/repos/kowainik/summoner/subscription","commits_url":"https://api.github.com/repos/kowainik/summoner/commits{/sha}","git_commits_url":"https://api.github.com/repos/kowainik/summoner/git/commits{/sha}","comments_url":"https://api.github.com/repos/kowainik/summoner/comments{/number}","issue_comment_url":"https://api.github.com/repos/kowainik/summoner/issues/comments{/number}","contents_url":"https://api.github.com/repos/kowainik/summoner/contents/{+path}","compare_url":"https://api.github.com/repos/kowainik/summoner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kowainik/summoner/merges","archive_url":"https://api.github.com/repos/kowainik/summoner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kowainik/summoner/downloads","issues_url":"https://api.github.com/repos/kowainik/summoner/issues{/number}","pulls_url":"https://api.github.com/repos/kowainik/summoner/pulls{/number}","milestones_url":"https://api.github.com/repos/kowainik/summoner/milestones{/number}","notifications_url":"https://api.github.com/repos/kowainik/summoner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kowainik/summoner/labels{/name}","releases_url":"https://api.github.com/repos/kowainik/summoner/releases{/id}","deployments_url":"https://api.github.com/repos/kowainik/summoner/deployments","created_at":"2017-08-18T22:18:39Z","updated_at":"2018-11-19T13:28:44Z","pushed_at":"2018-11-25T14:39:38Z","git_url":"git://github.com/kowainik/summoner.git","ssh_url":"git@github.com:kowainik/summoner.git","clone_url":"https://github.com/kowainik/summoner.git","svn_url":"https://github.com/kowainik/summoner","homepage":"https://kowainik.github.io/projects/summoner","size":422,"stargazers_count":170,"watchers_count":170,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":30,"open_issues":25,"watchers":170,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kowainik/summoner/pulls/242"},"html":{"href":"https://github.com/kowainik/summoner/pull/242"},"issue":{"href":"https://api.github.com/repos/kowainik/summoner/issues/242"},"comments":{"href":"https://api.github.com/repos/kowainik/summoner/issues/242/comments"},"review_comments":{"href":"https://api.github.com/repos/kowainik/summoner/pulls/242/comments"},"review_comment":{"href":"https://api.github.com/repos/kowainik/summoner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kowainik/summoner/pulls/242/commits"},"statuses":{"href":"https://api.github.com/repos/kowainik/summoner/statuses/b35e07ea9425a317c6257e100424550d6ba83090"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"vrom911"}}