TheYuriG / deno-portfolio

This is the repository that later gets rendered as my personal website.
https://www.theyurig.com
3 stars 1 forks source link

Add a simplified version of Expression Visualizer with only 2 fields: before(expression) / after(evaluated) #112

Closed TheYuriG closed 1 year ago

TheYuriG commented 1 year ago

The current version requires you to keep too much on your head at the same time. While it would be great to have for specific use cases, it offers too much power for too little benefit.

Would be nicer if it could, instead, offer an alternative version that only has what the string was before evaluation (expression) and the value after the expression (result), then a diffing algorithm processes what changed between now and then and builds the result based on that.

The diffing algorithm should walk the string backward and forward, checking how many characters were kept from the end and at the start, then everything but those parts can be considered the expression.

For better user experience, editing the expression should also edit the evaluation. That way, not only it helps users from forgetting to copy characters and mess up the diffing algorithm, but it also spares them from copying and pasting the value from the first field into the second field.

While this simplified version is important, we shouldn't remove the advanced version, but leave it as an option for more user control, should they choose to use that version instead.