Settings - Plugins: drop the two lines that explain somebody else's decision ("An administrator decided this..." and "Shipped inside Postulo...") #287
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Postulo/postulo#287
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On Settings → Plugins, two of the six sentences under a row explain a decision to somebody who did not make it. Drop both.
Why they read badly today: Postulo is a single-person instance in almost every deployment — running several people on one instance is still an open question (#268) — so the administrator and the person reading the page are the same human. The first sentence tells somebody that an administrator decided something for their account and then names them: the interface explaining you to yourself, in the tone of a permission held over you. The second says the same thing about a plugin nobody has decided anything about.
The second is also simply redundant. Shipped rows appear only when the “Show the plugins Postulo ships” box is ticked, and the sentence beside that box already says it once, for all of them (
settings/plugins.html:29):Having read that to reveal the rows, a person then gets a per-row variant of it on every one.
What to change
plugins/policy.py:83-87— two entries ofDecision.explain():"administrator"— An administrator decided this for your account."shipped"— Shipped inside Postulo. An administrator switches it, for you or for everybody.templates/settings/plugins.html:86-93— the<p id="why-{{ row.name }}">and its Decided by clause:The paragraph should not render at all when there is nothing left to put in it. An empty
<p>carrying an id is worse than no paragraph.The other four
explain()sentences —instance,person,default,infrastructure— are unaffected and stay.Not in scope:
server/person_plugins.html:60, which carries “Decided by {{ who }} on {{ when }}”. That is the administrator's own view of one person's row, where naming who decided is the point of the page. This issue is the person's own page only.The two cases differ, and only one of them is delicate
Shipped rows are safe. A row Postulo ships gets no control at all —
settings/plugins.html:55-57renders a blank<span aria-hidden="true">where the checkbox would be, on the stated grounds that “a control that can never be used is not a control.” Nothing points at the paragraph, so nothing breaks when it goes. The row still says on or off beside its label, so its state is not lost.Administrator rows are not. Where the plugin is installed rather than shipped, the checkbox is rendered
disabledand wired to the paragraph (settings/plugins.html:62):Remove the only sentence that case produces and a disabled control is left pointing at an empty paragraph — a switch somebody cannot use, nothing said about why, and a dangling
aria-describedby. That row still needs a short reason, and the reference still needs a target, or the attribute comes off with it.Something neutral and impersonal does the job without the accusatory framing — “Decided for this instance.”, or the wording already written for the rows nobody decides:
policy.py:89carries “How this instance works, rather than a choice anybody holds.”What this reverses, recorded so it is not rediscovered
This undoes deliberate decisions, and they should be undone knowingly rather than quietly:
Decision.who(policy.py:71-73) is documented as “The administrator who decided, where one did and is still an account. A person is entitled to know who, not merely that somebody did.”shippedstate was given its own sentence by #200, to distinguish a built-in nobody decided from a decision somebody made.settings/plugins.html:34-38: “A row that is not yours to change is shown disabled with the reason beside it rather than hidden. Hiding it would be the quiet version of the very thing this page exists to prevent: an administrator may decide a plugin for your account, and you are entitled to see that they did and who they were.”That comment's argument survives as long as the row is still shown and still disabled — which it is. What is dropped is the attribution, not the visibility. The comment should be reworded to say so, or it will contradict the code underneath it.
The one thing to settle
Drop the attribution always, or only where it is noise? It is pointless when the administrator is the person reading the page, and is exactly what #96 wanted on an instance with several accounts. Suppressing it only when
row.who == request.userkeeps both properties and costs one condition.The request is to drop it outright, so that is what this issue specifies. The narrower version is written down here because it becomes the right answer the moment #268 lands, and somebody will otherwise reopen this.
Notes for whoever takes it
tests/test_settings_plugins.py::65(inside the mark test) —assert "Shipped inside Postulo" in row. That assertion goes; the rest of the test — the row is present, carriesdata-shipped, and has no checkbox — is the real subject and stays.:144 test_a_decided_row_is_shown_locked_rather_than_hidden— asserts the administrator sentence; the row must still be visible, so the assertion changes rather than the test.:157 test_a_decided_installed_row_is_shown_disabled— assertsdisabledand the sentence together. Keep thedisabledhalf; it is the guard for the section above.:167 test_the_person_is_told_who_decided— its entire premise is the clause being removed. Delete it, and let the commit message say which decision it belonged to.scripts/messages.py extractdrops them from all 68 catalogues; runextract, then scope the revert tosrc/postulo/plugins/*/localeand commit the core ones. Any new string goes intofr-fr,pt-ptandpt-brasdraft.PluginPolicy.decided_bykeeps recording who, which is whatperson_plugins.htmlreads. Only the person's own page stops saying it.Settings - Plugins: drop "An administrator decided this for your account. Decided by ..."to Settings - Plugins: drop the two lines that explain somebody else's decision ("An administrator decided this..." and "Shipped inside Postulo...")Widened at the user's request: the
shippedsentence — "Shipped inside Postulo. An administrator switches it, for you or for everybody." — goes with the administrator one.It is the easier of the two: a shipped row carries no control at all (a blank
<span aria-hidden="true">where the checkbox would be), so nothing points at the paragraph and noaria-describedbyis left dangling. It is also redundant — those rows only appear once the Show the plugins Postulo ships box is ticked, and the sentence beside that box already says the same thing for all of them.The delicate half is unchanged: an installed row decided by an administrator has a disabled checkbox wired to that paragraph, and still needs a short reason to point at.
One more test is affected:
tests/test_settings_plugins.py:65asserts the shipped sentence. That assertion goes; the rest of that test is about the row being present with no switch, which stays.