Skip to content

Commit

Permalink
Added accelerator for board.show_analysis to show/hide analysis resul…
Browse files Browse the repository at this point in the history
…ts handly. (SabakiHQ#752)

* menu.js: added accelerator for board.show_analysis.

* Change analysis accelerators

Ctrl+H toggles the heatmap, and Ctrl+Shift+H cycles through the
different labels on the heatmap.

* Add SabakiHQ#752 to changelog

Co-authored-by: Adrian Petrescu <[email protected]>
  • Loading branch information
k-l-lambda and apetresc authored Jul 5, 2021
1 parent 822c4df commit 939ac2e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ All notable changes to this project will be documented in this file.
(thanks to @ebifrier, #711)
- Failed to load external links in comments (thanks to @baldor-f, #754)

**Changed**

- <kbd>Ctrl+H</kbd> toggles the visibility of the analysis heatmap, and
<kbd>Ctrl+Shift+H</kbd> cycles through the different types of heatmap labels
(#752)

## [Sabaki v0.51.1][v0.51.1] (2020-04-12)

**Added**
Expand Down
17 changes: 15 additions & 2 deletions src/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,25 +634,38 @@ exports.get = function(props = {}) {
label: i18n.t('menu.view', '&Don’t Show'),
type: 'checkbox',
checked: !showAnalysis,
accelerator: 'CmdOrCtrl+H',
click: () => toggleSetting('board.show_analysis')
},
{type: 'separator'},
{
label: i18n.t('menu.view', 'Show &Win Rate'),
type: 'checkbox',
checked: !!showAnalysis && analysisType === 'winrate',
accelerator: 'CmdOrCtrl+Shift+H',
click: () => {
setting.set('board.show_analysis', true)
setting.set('board.analysis_type', 'winrate')
setting.set(
'board.analysis_type',
setting.get('board.analysis_type') === 'winrate'
? 'scoreLead'
: 'winrate'
)
}
},
{
label: i18n.t('menu.view', 'Show &Score Lead'),
type: 'checkbox',
checked: !!showAnalysis && analysisType === 'scoreLead',
accelerator: 'CmdOrCtrl+Shift+H',
click: () => {
setting.set('board.show_analysis', true)
setting.set('board.analysis_type', 'scoreLead')
setting.set(
'board.analysis_type',
setting.get('board.analysis_type') === 'scoreLead'
? 'winrate'
: 'scoreLead'
)
}
}
]
Expand Down

0 comments on commit 939ac2e

Please sign in to comment.