grantm / sudoku-web-app

A Sudoku web app - as used on SudokuExchange.com
GNU Affero General Public License v3.0
50 stars 22 forks source link

Consider defaulting to pencil mark entry if multiple cells selected #19

Closed grantm closed 4 years ago

grantm commented 4 years ago

Exactly which pencil mark mode (inner vs outer) is not clear - perhaps the last one the user used.

domharrington commented 4 years ago

Would love this! Switching between modes on mobile device is a little clunky without it. The Sudoku phone apps from Cracking The Cryptic do this as well.

grantm commented 4 years ago

@domharrington FYI (while you wait for this feature to be implemented), one thing you can do now is select your preferred pencil mark mode and then leave the app in that mode. When you need to enter a full digit, just double-tap the digit button a pencil mark will be entered on the first tap and then it will be 'promoted' to a full digit on the second tap.

baaraak commented 4 years ago

I really liked this idea so tried to implement it In https://github.com/grantm/sudoku-web-app/blob/master/src/components/app/app.js#L156 I first check how many cells are selected

const selectedCells = grid
      .get("cells")
      .toArray()
      .filter((c) => c.get("isSelected"));

And add it to the if statement on line 156 selectedCells.length > 1 It seems to work well, tested it a little bit If you want I can create PR.

grantm commented 4 years ago

Sure, send me a PR