Skip to content

Commit a2c0541

Browse files
JohnMcLearclaude
andauthored
docs: address Qodo review on PR #21 (#22)
Two findings, both legit: 1. README settings.json snippet contradicted its preceding comment — comment talked about "disabling the passthrough" but the snippet set the flag to true (enable). Rewrote the prose to be unambiguous: the snippet is an explicit opt-in for older 3.x cores; mention `false` as the disable case in the same comment. 2. pad-select-server.js / pad-toggle-server.js comments framed the warning case as "explicit operator opt-out", but the runtime check is `=== true`, so the false branch also fires when the flag is absent (pre-flip cores, or operators who removed the key). Reworded to cover both cases — "absent on pre-flip cores, or explicitly false on current ones" — so future maintainers debugging padWideSupported off don't chase a phantom opt-out. Behavior unchanged. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0c838ca commit a2c0541

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,13 @@ const state = myToggle.init(); // reads cookie, binds checkbox
184184

185185
Parallel checkboxes in **both** the User Settings panel and the Pad Wide Settings panel — matching how native settings (sticky chat, line numbers, etc.) work. The pad-wide value rides Etherpad's existing `padoptions` broadcast/persist rail, so changes propagate to every connected client and are remembered across reloads. The pad creator can `enforceSettings` to lock the user-side checkbox for everyone.
186186

187-
Requires Etherpad with the `ep_*` padOptions passthrough patch ([PR #7698](https://github.com/ether/etherpad/pull/7698), shipped in `>= 3.0.0`) AND the runtime flag `settings.enablePluginPadOptions` not set to `false` (default `true` on current cores; earlier 3.x releases shipped it default `false` so operators on those versions need to flip it explicitly). When pad-wide is unavailable the column is hidden automatically and the user-side cookie toggle keeps working — plugins built on this helper run everywhere. The console warning logged on degradation names the specific cause so an admin can tell whether to upgrade the core or to flip the runtime flag.
187+
Requires Etherpad with the `ep_*` padOptions passthrough patch ([PR #7698](https://github.com/ether/etherpad/pull/7698), shipped in `>= 3.0.0`) AND `settings.enablePluginPadOptions === true`. Current cores default the flag to `true` (see ether/etherpad#7841); earlier 3.x releases shipped it default `false` so operators on those versions need the explicit opt-in below. When pad-wide is unavailable the column is hidden automatically and the user-side cookie toggle keeps working — plugins built on this helper run everywhere. The console warning logged on degradation names the specific cause so an admin can tell whether to upgrade the core or to flip the runtime flag.
188188

189189
```json
190-
// settings.json — only needed on older 3.x cores that shipped this opt-in,
191-
// or to explicitly disable the passthrough on current cores.
190+
// settings.json — explicit opt-in for older 3.x cores that shipped this
191+
// flag default-false. Omit on current cores (it's already the default).
192+
// To explicitly disable the passthrough on a current core, set it to
193+
// `false` here instead.
192194
{
193195
"enablePluginPadOptions": true
194196
}

pad-select-server.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ const padSelectServer = (rawConfig) => {
114114
padWideSupported: isPadWideActive(),
115115
// Granular flags so the client's degradation warning can
116116
// name the specific cause — missing patch (Etherpad <
117-
// 3.0.0) vs. explicit operator opt-out
118-
// (settings.enablePluginPadOptions = false). See
119-
// pad-toggle-server.js for the same rationale.
117+
// 3.0.0) vs. runtime flag not enabled
118+
// (settings.enablePluginPadOptions !== true; either absent
119+
// on older 3.x cores or explicitly false on current ones).
120+
// See pad-toggle-server.js for the same rationale.
120121
patchPresent: padOptionsPluginPassthrough,
121122
runtimeEnabled: runtimeFlagEnabled,
122123
options,

pad-toggle-server.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ const padToggleServer = (rawConfig) => {
6565
const {pluginName, settingId, l10nId, defaultLabel, defaultEnabled} = validateConfig(rawConfig);
6666
let cachedDefaultEnabled = defaultEnabled;
6767
// Etherpad >= 3.0.0 introduced settings.enablePluginPadOptions as a runtime
68-
// gate on the ep_* passthrough (default true since the flag-flip; older 3.x
68+
// gate on the ep_* passthrough (default true on current cores; older 3.x
6969
// releases shipped with it default false). We grab it from loadSettings so
70-
// eejsBlock_padSettings + clientVars correctly no-op when an admin has
71-
// opted out, even though PluginCapabilities reports the patch is present
72-
// in the core.
70+
// eejsBlock_padSettings + clientVars correctly no-op when the flag isn't
71+
// enabled (absent on pre-flip cores, or explicitly false), even though
72+
// PluginCapabilities reports the patch is present in the core.
7373
let runtimeFlagEnabled = false;
7474

7575
const isPadWideActive = () => padOptionsPluginPassthrough && runtimeFlagEnabled;

0 commit comments

Comments
 (0)