-
Notifications
You must be signed in to change notification settings - Fork 86
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
Allows preview while styles disabled, fix #226 #254
base: master
Are you sure you want to change the base?
Conversation
This doesn't work as expected.
I expect previewed styles to always be on, independent of "Turn all styles on/off". That permits me to see the effect of just one style that I'm editing or evaluating, without the previewed style interacting with other, installed styles. |
582761f
to
17fea61
Compare
@hideheader Can you try it again? I fixed the previewed style will remain to be applied, if turn off and just installed. |
OK, now I see Previewing a style in the editor also behaves this way. Good job. |
When I edit and Preview a style, my expectation is that (1) the Preview is not affected at all by 'Turn all styles off (on)' and (2) the Preview is not affected at all if the (saved) version is disabled or enabled from the Stylish popup menu. Given that, I see two more problems. First, while Previewing a style in the Stylish editor, 'Turn all styles on' displays the saved version, not the edited version which was Previewed. Here is a common use case:
The following demonstrates that the problem is with 'Turn all styles on':
Second, while Previewing a style in the editor, disabling the style from the popup menu disables the Previewed style. Here is a use case that demonstrates the behavior:
The odd Enable behavior doesn't depend on the odd Disable behavior:
|
Hi @hideheader, thank you for writing such a detailed test cases. |
I'm not worried that the Preview will be persisted; I never saw that happen. I agree that this could be used as it is, but the Preview button in the editor should be re-enabled on 'Turn all styles on' so that it is consistent with the current display state. Rewriting my test cases,
'Turn all styles on' has the side-effect "Un-preview" in the editor (state 1 vs state 3), which could be a new feature, not a bug, if the UI enables the "Preview" button so that it can be used again. This "Un-Preview" behavior doesn't happen when there is no saved version of the Previewed style. Here is what happens when Previewing a new style in the editor, or Previewing a style from the Install dialog.
(This is the behavior I expected of edited styles, too.) In this case the Preview button need not be re-enabled on 'Turn all styles on', but there is no harm in doing it. (Do you agree, @JasonBarnabe?) |
I mean, preview state may be covered by any operations instead of continuing in the entire session. |
I think a Preview should always be on, but if a Preview is covered by another operation (as happens now) then the "Preview" button should be enabled so I can use it again. I would even be satisfied with the current behavior if the Preview button was always enabled. (But ask Jason before you do it, because my opinion is worth very little here.) Just to be clear, I am using this now. It's not exactly what I expected, but it's good. I have to "type a space+undo" to get my "Preview" button back, though, after 'Turn all styles on'. |
OK, from time to time now I'm seeing an old Previewed revision of a style I'm editing persist in the Stylesheet Service after a newer revision is Previewed ("zombie" styles). I think it may be an existing Preview bug, but I can't tell you yet exactly how to reproduce it. Here's what I know about zombies: |
Without having tested or reviewed the code, I already have two issues with this:
I'm open to being convinced otherwise, but this my current opinion. |
No description provided.