Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove blinking placeholder #176

Closed
wants to merge 4 commits into from
Closed

Conversation

charlesroddie
Copy link
Collaborator

@charlesroddie charlesroddie commented Oct 23, 2020

Word, MathQuill, and LyX don't have blinking placeholders.

They are visually unattractive and not useful UX because a large block blinks which is already easy to identify, unlike the cursor where a small line blinks which is harder to identify.

@charlesroddie
Copy link
Collaborator Author

We have too many tests

@Happypig375
Copy link
Collaborator

Yes, obviously we should have zero tests.

@charlesroddie
Copy link
Collaborator Author

Zero is too few

@charlesroddie
Copy link
Collaborator Author

We shouldn't test things that aren't required for correctness

@charlesroddie
Copy link
Collaborator Author

Current tests take a lot of current behavior and test for them. So the only thing they do is to make making changes slower.

@Happypig375
Copy link
Collaborator

Tests catch unintentional changes in behaviour, i.e. bugs. Therefore, correctness is maintained.

@Happypig375
Copy link
Collaborator

Change tests to ensure the new behaviour is maintained

@Happypig375
Copy link
Collaborator

I don't want to be Xamarin.Forms where regressions happen all the time

@charlesroddie
Copy link
Collaborator Author

Tests catch unintentional changes in behaviour, i.e. bugs.

It's not possible to test for intentionality in the changes. For example tests failed here but I intended the changes. So this psychological aspect of testing is not valid.

As far as possible tests should test for correct behaviour and it should be clear why it should pass.

@Happypig375
Copy link
Collaborator

If it's intentional, then change tests to match the new behaviour. Any code can cause action at a distance by e.g. mutating global variables, and tests ensure that this does not happen.

@charlesroddie
Copy link
Collaborator Author

charlesroddie commented Oct 23, 2020

The tests here were easy to adjust (partly because I know that tests tend to be deletable in this repo and shouldn't be given too much respect) but in other places they place significant obstacles to doing PRs.

Someone making a PR encouters a failed test, and then it's not clear whether the test indicates a problem in the PR's logic. And it's not clear whether it's his responsibility to get the tests to pass by changing the logic, or his responsibility to get the tests to pass by changing the tests, or @Happypig375 's responsibility to get the tests to pass by changing the tests.

@Happypig375
Copy link
Collaborator

Refactors which produce the same output won't need test changes.

You are asking for a change in behaviour. Any PR that ask for changes in behaviour must also change tests to match the new behaviour.

@charlesroddie charlesroddie linked an issue Oct 23, 2020 that may be closed by this pull request
@Happypig375
Copy link
Collaborator

And I am under no obligation to accept any pull request that potentially introduces a regression by deleting tests.

@SymboLinker
Copy link
Contributor

SymboLinker commented Oct 23, 2020

You can make the appearance of the placeholder's 2 states equal via Atom.LaTeXSettings by customizing the so called "active" and "passive" placeholder nuclues. (Assuming you use the default color black, you don't need to do anything with the color.)
Changes to the CSharpMath repo are not needed for achieving the goal "Remove blinking placeholder".

@charlesroddie
Copy link
Collaborator Author

@SymboLinker no changing PlaceholderRestingNucleus also changes how an unselected placeholder looks.

@FoggyFinder
Copy link
Collaborator

If some users like blinking placeholder let allow them to use it.
Why not add additional option to the settings to disable blinking for placeholder? Then, everyone would be happy.

@charlesroddie
Copy link
Collaborator Author

Does one of us need blinking placeholders? The fact that the main latex editors out there don't have it suggest that it shouldn't be there even as a setting, but if there is strong demand from one of us here we could have a setting. If the only reason is that someone in future might possibly use it, that's too weak.

@SymboLinker
Copy link
Contributor

If the only reason is that someone in future might possibly use it, that's too weak.

I am a user of it. Within a month or so I will publish an update for my app that includes a math keyboard with blinking placeholder. (I won't name the app, as I think it's unappropriate to advertise it this way.)

@charlesroddie
Copy link
Collaborator Author

charlesroddie commented Oct 23, 2020

I added a setting PlaceholderBlinks for you @SymboLinker . But now it wouldn't be invalid to have tests (testing correct application of application the setting). Not essential as the logic is extremely trivial but @Happypig375 might require. I don't like the complexity but can I leave the testing part of this feature to you (possibly having to write tests) and @Happypig375 (possibly requiring them)? Otherwise we can have this without the PlaceholderBlinks setting (since it improves the default), and add an issue to add the setting which should be doable in the timeframe you give.

@codecov-io
Copy link

codecov-io commented Oct 23, 2020

Codecov Report

Merging #176 into master will decrease coverage by 0.03%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #176      +/-   ##
==========================================
- Coverage   87.33%   87.29%   -0.04%     
==========================================
  Files         156      156              
  Lines       11312    11280      -32     
==========================================
- Hits         9879     9847      -32     
  Misses       1433     1433              
Impacted Files Coverage Δ
CSharpMath.Editor.Tests/CaretTests.cs 100.00% <ø> (ø)
CSharpMath/Atom/LaTeXSettings.cs 98.66% <0.00%> (-0.09%) ⬇️
CSharpMath.Editor/MathKeyboard.cs 89.49% <100.00%> (+0.18%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed72190...ab05e8f. Read the comment docs.

@charlesroddie
Copy link
Collaborator Author

charlesroddie commented Oct 23, 2020

I've reverted the PlaceholderBlinks so that this is in an I think mergeable state.

@Happypig375 can you indicate what tests if any you would need to have a PlaceholderBlinks setting and then @SymboLinker if it's worth doing those tests to get this setting in? If tests are needed, and it's worth writing them, then revert the revert and do the tests. Thanks.

@charlesroddie
Copy link
Collaborator Author

Superseded by #177

@Happypig375 Happypig375 added Resolution/Superceded The described announcement or pull request has been superceded. Type/Enhancement labels Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution/Superceded The described announcement or pull request has been superceded. Type/Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to stop blinking placeholder?
5 participants