Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spell Checker: minimal support for multiple languages (via settings) #833

Open
wants to merge 77 commits into
base: master
Choose a base branch
from

Conversation

zorgnac
Copy link

@zorgnac zorgnac commented Nov 12, 2021

Demo code for issue #832

- requires to add a .shortcut in menu entries (src/menu.js)
@zorgnac
Copy link
Author

zorgnac commented Nov 13, 2021

Found some info about spell checker in electron

@zorgnac
Copy link
Author

zorgnac commented Jan 4, 2022

Exploring a little further, I've patched my copy of Sabaki to:

  • add a spelling contextual menu, with possible addition to Custom Dictionary
  • define a default set of Romaji go terms in Custom Dictionary

I've found the contextual menu somehow tricky; it's a more in-depth patch, where I'm absolutely convinced I'm out of coding standards.

You've got a demo (together with other customization) in my focal branch.

…an vertex)

* sabaki: clickToolButton dispatches on Ctrl
* MainView: use clickToolButton instead of setState
* setting: board.analysis_probes
* enginesyncer:
  * remind whether a node is already analyzed
  * check whether syncing or not; expose in 'analysis'
  * count analysis probes (except when syncing); expose in 'analysis'
* sabaki:
  * inferredState.analysisEngineStatus reports busy/available/waiting
  * abort analysis when board.analysis_probes is exactly reached
  * togglePauseAnalysis stops current or start deep analysis
* App:
  * relays inferredState.analysisEngineStatus as of analysisEngineStatus
* menu Toggle Analysis:
  * label Start/Pause/Deepen
  * enabled on analysisEngineStatus
  * calls togglePauseAnalysis
Would require 'engine-ready' event, which is defined in another branch
The 'context-menu' is apparently global to
webContents. We assume here this is actually the case.
Thus, some triage has to be done before
either to prevent it, or to advertise sabaki
which context we're talking about, and let
him perform the triage.

sabaki implements 'context-menu' as of openContextMenu. This
redirects either to the play menu or the edit menu
depending on mode. We've transferred the play menu from
PlayBar to sabaki

App puts a tiny phantom image in an anchor on top of layers, which
does not preventDefault, and thus promotes 'contextmenu'
to 'context-menu'. sabaki.openContextMenu is thus
the response to the Menu keyboard when focus is on the
body element.

Comment box also does not preventDefault (via stopPropagation), and
thus its context menu gets to sabaki.openContextMenu.
The 'context-menu' is apparently global to
webContents. We assume here this is actually the case.
Thus, some triage has to be done before
either to prevent it, or to advertise sabaki
which context we're talking about, and let
him perform the triage.

sabaki implements 'context-menu' as of openContextMenu. This
redirects either to the play menu or the edit menu
depending on mode. We've transferred the play menu from
PlayBar to sabaki

App puts a tiny phantom image in an anchor on top of layers, which
does not preventDefault, and thus promotes 'contextmenu'
to 'context-menu'. sabaki.openContextMenu is thus
the response to the Menu keyboard when focus is on the
body element.

Comment box also does not preventDefault (via stopPropagation), and
thus its context menu gets to sabaki.openContextMenu.
* new field 'boot' in engine's properties (array of symbols)
* enginesyncer emits 'commands' when engine has answered 'list_commands'
* at startup, sabaki attaches engines that have 'autoload' among
  'boot' symbols
* when receiving 'commands' and affects engine roles according
  to symbols 'white', 'black', or 'analyze' in 'boot'
There is probably an issue when identifying button 2 as context
menu button (how many buttons has your mouse?). Let
this issue be a TODO

* sabaki:
  * split clickVertex into click/contextmenu and a common onVertex
  * contextmenu is always a context menu; thus, in stone edit tool:
    * button 2 opens a context menu
    * previous button 2 behavior is now on Shift+Click
    * Ctrl+Shift+Click adds an extra functionality, i.e.
      use alternate stone tool and toggle stone tool color
  * merge context menus when applicable; thus, split
    some open*Menu into get*Menu open*Menu
* Goban: use onVertexContextMenu if button is 2
* MainView: relay vertex context menu
Put this is tooltip, though it seems useless.
# Conflicts:
#	src/modules/sabaki.js
* analysis menu is not related to edit mode
* wrong merge helper.popupMenu in getVariationMenu
This avoids blank transitions in map while navigating
# Conflicts:
#	CHANGELOG.md
#	src/modules/enginesyncer.js
#	src/modules/sabaki.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants