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

Button to append enumeration to all clues #498

Closed mdirolf closed 1 month ago

mdirolf commented 1 month ago
          Another thing that came up when discussing enumerations was adding a button to append them to all clues, and possibly also a button to undo or remove them. Possibly that should be its own issue/feature, but mentioning it here just to make sure it's written down!

Originally posted by @legnes in https://github.com/crosshare-org/crosshare/issues/495#issuecomment-2075905710

Thanks for remembering to track that @legnes! I do think we should make sure to somehow support undo for this just as it chnages every clue and would be a lot of work for the constructor to manually undo.

One option would be to add clue text changes to the history state. I pointed out in Discord that this could get weird if you were undoing clue changes on the grid page w/o realizing it or vice versa. But if we also added mode changes btwn grid+clue view to the history state maybe that is the simplest solution.

legnes commented 1 month ago

As another possibility: do you think it would work to put enumerations in a custom markdown directive? Might make it easier to detect them (for warnings), and to remove them (instead of undoing) if you decide you don't want them?

mdirolf commented 1 month ago

Something like that is an option but since so many folks use enumerations in the (x) syntax I think my preference is to try to support them without making folks learn a new syntax

legnes commented 1 month ago

Re: clue text undo, my two cents is that I feel like it'd be confusing:

What about a "remove enumerations" button? To me it seems more flexible than undo in that you could add enums, edit some clues, and then remove the enums without losing your edits. The downside is that it'd rely on being able to identify enumerations, which is definitely imprecise. This is where a custom markdown directive could be helpful. But I think/hope the current detection is good enough to suffice?

What do you think @mdirolf? Is the auto-enum-detection too brittle to rely on for this?

mdirolf commented 1 month ago

@legnes you've convinced me about the clue text undo stuff!

I think the auto-enum-detection is probably good enough but I honestly can't imagine a "remove enumerations" button being generally useful - it'd likely only get used in this case where somebody hits the Add button not realizing what it does and then wants to undo it. So I kinda feel like it'd be mostly UI clutter and then the feature would only be 95% correct (if it removes any false positives)

I know this is a bit complicated but what about a time-limited undo link in a snackbar that shows up after adding enumerations? If it's cleaner we could store the previous clue state in the "add enumerations" component so we don't need to add it to the reducer. Basically exactly what gmail does for a sent message: image

I think that's my preferred solution at the moment but another option would be to add a modal gate before actually adding the enumerations where we could explain what enumerations are, etc. "Are you sure you want to do this?".

legnes commented 1 month ago

I like both of those options a lot!