crosshare-org / crosshare

Crosshare is a free and ad-free community for crossword constructors and solvers
https://crosshare.org
GNU Affero General Public License v3.0
110 stars 28 forks source link

Add ability to change dimensions #468

Open kumar-ish opened 4 months ago

kumar-ish commented 4 months ago

As per title -- increasing the size from current would simply trim the letters / blocked-out spaces inside the crossword, and expanding it should add empty ones. I'm happy to implement this.

mdirolf commented 4 months ago

This gets a bit strange w/ grids that are supposed to have symmetry or that already have completed entries touching the border. But if you'd like to have a go at implementing it I say go for it and we can see what we think about it.

kumar-ish commented 4 months ago

I think people would be more likely to use it when the crossword is not completed -- that's what I found myself wanting it for. It is quite bothersome to copy all the clues over.

Nevertheless, to allay that concern, we can have a modal to warn people that they would lose symmetry, etc.

adamthedog commented 4 months ago

It would definitely be a good amount of extra work but if you do get around to trying out this grid size changing feature, it might be worth eventually adding functionality to interactively place down where all your old text is among the expanded/shrunken grid using arrow keys and hitting enter to accept (or something along those lines). It's a bit involved but could be a nice bit of UI compared to just typing in where the old grid's origin will be placed in the new grid. As for a warning, I think adding a note (in --error color) in a modal about changing size being a dangerous operation right next to whatever button initiates it (probably put it all in a NestedDropDown) is a good idea and would be enough, as I don't think losing symmetry is too much of a concern — it's inherently clear that changing grid size and text position will change the nature of your puzzle, but if you're careful in positioning the old grid it can still work out to allow symmetry to continue as is. JM2¢

mdirolf commented 2 months ago

I think with the selection feature implemented by @legnes recently the UX here becomes a bit more reasonable - to shrink the grid you'd select an area and then More > "Crop grid to selection" or something like that. To resize up we could just add new rows of black squares to the right or bottom of the grid as needed. If the user then wants to move their current fill around it's as simple as a selection and a cut and a paste.