-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix setting ~~DISCUSSION in page. #215
base: master
Are you sure you want to change the base?
Conversation
From looking at the code, it seems that now weird things will happen when comments are off globally and there is nothing in the page. I think that at least the toggle button will be visible then. I think there should be a check somewhere before the output starts if any non-zero status has been set. |
Happy to tweak this, but I'm not quite sure I undersatnd your concern. When you say "there is nothing in the page," do you mean a page that exists but has no content; or a page that does not exist? Or are you referring to a page that just has no discussions? Also, which "toggle" button are you referring to? The setting on the "discussion moderation" screen, or is there supposed to be a toggle somewhere else? |
I mean no comment syntax in the page, but the page exists. At the end of the show function, there is some function called for a toggle button. Iirc this is the button that allows hiding the comments via JS. This button shouldn't be shown when comments are off. As far as I understood your change, this code might now be executed even if comments are off. |
Hmm. OK, I have discovered a couple edges cases. One is a bug, which I've fixed (not pushed yet): When "automatic" is off, there are no comments, and no in-page directive, _show does run since there's no explicitly false The other edge case is a little more nuanced, and stems from the fact that there are now two potentially conflicting ways to set discussion status per-page; either through the Moderate Discussions screen (which saves the setting directly to .comments) or via the I think perhaps the setting saved in .comment should have an additional status of "default" where it basically does nothing; and then we can remove the syncing between that setting (via moderate page) and editing page content. The current behavior is otherwise complex and non-intuitive. Thoughts? |
Alternatively, we can at least make the non-intuitive obvious; perhaps alongside the 'Last modified' text in the metadata section we can add a very unobtrustive comment explaining what DISCUSSION setting is being used? |
@michitux I'm cleaning up the 'status' stuff overall, trying to centralize the logic to one place and handle the semantics in a straightforward fashion. There's one sticking point, which is that I'm uncertain of what the |
OK. As I said, a bit more invasive, but I think overall everything makes more sense. The pageinfo magic depends on dokuwiki/dokuwiki#1665 though. |
For normal users this message is not that useful, is it? You could just see if it is enabled or not? |
I think you're right that it's not useful, but I think it's unobtrusive and not harmful. The target audience for this is casual users (page editors, or administrators that don't care to delve into the inner workings of a plugin); and for them, having the information somewhere obvious seems very valuable. I could easily add a config option to turn this display off (or enable a restricted version, "enabled/disabled," like you suggest), but even so I'd prefer the default to remain as it is; if someone has gone to the effort to disable the option, they've hopefully done so knowingly, and can be expected to remember to turn it back on if they need the information. The other (better™, imho) option would be to come up with a really solid story about how the three types of settings interact, so that the behavior is simply intuitive and doesn't need explanation. However, I don't feel that I understand well enough the purpose of the moderator panel to be able to create such a story; so for now I've just tried to make the non-intuitive behavior obvious. |
The text is at the far bottom of the page. That is not that visible, but therefore indeed not good visible. I had to search to find it, so I wonder if it would reach the right person. What is the precise use case that needs improvement?
So I think it could make sense to concentrate on the moderator panel. What kind of improvements will make the moderator panel more useful for managing off/on/close? btw, does the moderator panel override always all |
Here's the actual problem: Adding or Changing a Here's what I would expect to happen:
Here's the way it actually works:
...and in addition, setting the page setting changes the moderator setting and vice versa. If "what I think" sounds right, then the moderator panel needs a new "unset" setting, and I can take care of this. It also means removing the two-way sync between the page setting and the comments metadata, which I think is a good simplification. |
The metadata should just resemble the state of the DISCUSSION syntax tag. |
OK, then perhaps admin.php should be updated to add a I still think the semantics of how moderation works are not quite right, if we imagine a separation between "moderator" and "page editor"; because as it is the moderator panel settings do not override the page setting (but instead just update the page setting, which an editor could set back.) |
Ah, I assumed that moderator panel was overriding the page setting. But that was a wrong assumption. If the moderator panel setting is same level as page setting, then it should be two-direction-sync to prevent clutter for the user... About manipulating the page content:
So there are 3 places where settings are stored:
And buffered:
If metadata of page is parsed from syntax instruction, the summary: |
The admin has the function _changeStatus() So an design choice of this plugin is not to bother about false positives... |
Yes, indeed... But, really, I don't think moderator setting and page-level setting should be on the same level. I think it's simpler for users to understand and simpler in code if we just establish a clear hierarchy: Moderator > Page > Global. We can repurpose the 'pageinfo' code I'm using to only add a message if the page setting conflicts with the moderator setting; or maybe instead add a warning on the "edit" view; so that the page editor can understand situations where their own setting is ignored. I think code that changes the raw text (as this does when a change is made from the moderator panel) is dangerous, for example in the situation you mention where it might appear in a code block or, generically, some other context. |
Every editor can enable/disable-policy moderator can overrule enable/disable-policy
I expect that if this new policy is introduced, that the old behavoir will be requested: enabling/disabling via admin by moderator, but still changable by user.... Seeing all these consideration/discussions before, I personally like the wiki-like approach. This makes you as user also less dependent on the moderator. @michitux what are your considerations? |
Of course, an admin could always just remove the discussion plugin, and had to choose to install it; so there's already a hierarchy amongst server admin and wiki user. Anyway, if the intent of the moderator panel is just to make it easier to change target pages, then I think there are just some bugs to be squashed around propagate status everywhere it needs to be. I think the fix is to just introduce fourth state for "status" of "unset", and have removing |
Some thoughts from me:
I'm not sure how to resolve the mess we currently have. In my opinion we should reduce it to one setting per page. We could have it in the page with the syntax and update the syntax through the moderator interface or just have the setting in the comments file and update it with additional elements that can be added to the edit form (similar to the blogtng plugin). I think both has advantages and disadvantages and I'm not sure what we should do to keep backwards compatibility while still making it easier for the user to understand what happens. |
The old semantics were confusing and undocumented. These changes allow the plugin to act as one would expect, where the page-level setting is always used.
Closes #203