unsee icon indicating copy to clipboard operation
unsee copied to clipboard

Support undo/redo actions for query editing

Open ferringb opened this issue 7 years ago • 1 comments

This is a fairly minor request, but when manually editing the query field- say to add alertname=My_Stupid_Alert, due to the JS manipulations that occur undo/redo logic isn't possible. Specifically since the text is converted to a different object, the browser cannot 'undo' that action.

When one screws up and removes long parts of the query, this is a bit annoying.

I only have a surface understanding of the DOM/events involved in this, but http://mattjmattj.github.io/simple-undo/ is an example that can likely be examined for which hooks we'd need to file. From there something like https://github.com/ArthurClemens/Javascript-Undo-Manager/blob/master/lib/undomanager.js gives an object approach for managing the queue of changes, and providing a 'history' that the undo/redo can act upon.

ferringb avatar Dec 20 '17 19:12 ferringb

Should be doable after #208, current code doesn't make it easy

prymitive avatar Jan 11 '18 00:01 prymitive