Skip to content

Commit 7e2c0be

Browse files
JohnMcLearclaude
andauthored
docs(padToggle, padSelect): reflect default-true flag flip in core (#21)
ether/etherpad#7841 flips settings.enablePluginPadOptions default to true, turning the runtime gate from opt-in into opt-out. Update the helper's README + source comments so the framing matches: - README PadToggle section: requires the patch (3.0.0+) AND the flag not be explicitly false; calls out that older 3.x cores shipped it default false so operators on those versions still need the explicit opt-in. - pad-toggle-server.js / pad-toggle.js / pad-select-server.js comment blocks: remove the "default false per AGENTS.MD §52" framing; describe the post-flip default and explicit operator opt-out as the case where the warning fires. Behavior unchanged — runtime flag detection still reads clientVars.runtimeEnabled and warns when it's false; the warning copy itself ("settings.enablePluginPadOptions is false — set to true …") stays correct for operators who've explicitly disabled. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5bf1470 commit 7e2c0be

4 files changed

Lines changed: 16 additions & 12 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,11 @@ 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 = true` in `settings.json` (default false). When either is missing the pad-wide 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 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.
188188

189189
```json
190-
// settings.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.
191192
{
192193
"enablePluginPadOptions": true
193194
}

pad-select-server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ 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. missing runtime flag (default false). See
117+
// 3.0.0) vs. explicit operator opt-out
118+
// (settings.enablePluginPadOptions = false). See
118119
// pad-toggle-server.js for the same rationale.
119120
patchPresent: padOptionsPluginPassthrough,
120121
runtimeEnabled: runtimeFlagEnabled,

pad-toggle-server.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +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 false per AGENTS.MD §52). We grab
69-
// it from loadSettings so eejsBlock_padSettings + clientVars correctly
70-
// no-op when an admin hasn't opted in, even though PluginCapabilities
71-
// reports the patch is present in the core.
68+
// gate on the ep_* passthrough (default true since the flag-flip; older 3.x
69+
// 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.
7273
let runtimeFlagEnabled = false;
7374

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

pad-toggle.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,12 @@ const padToggleClient = (rawConfig) => {
160160
} else if (!isSupportedClient()) {
161161
if (typeof console !== 'undefined' && !init._warned) {
162162
// The patch shipped in Etherpad 3.0.0 (PR #7698) and is enabled at
163-
// runtime via `settings.enablePluginPadOptions` (default false per
164-
// AGENTS.MD §52). Either condition can flip padWideSupported off
165-
// — surface the specific cause so the admin knows whether to
166-
// upgrade or to flip a settings flag. Falls back to a generic
167-
// line on older servers that don't ship the capability fields.
163+
// runtime via `settings.enablePluginPadOptions` (default true on
164+
// current cores; earlier 3.x releases shipped it default false).
165+
// Either condition can flip padWideSupported off — surface the
166+
// specific cause so the admin knows whether to upgrade or to flip
167+
// a settings flag. Falls back to a generic line on older servers
168+
// that don't ship the capability fields.
168169
const block = getCapabilityBlock();
169170
const patchPresent = block && block.patchPresent === true;
170171
const runtimeEnabled = block && block.runtimeEnabled === true;

0 commit comments

Comments
 (0)