feat: migrate to ep_plugin_helpers padToggle for User + Pad Wide settings#191
Merged
JohnMcLear merged 4 commits intomasterfrom May 7, 2026
Merged
feat: migrate to ep_plugin_helpers padToggle for User + Pad Wide settings#191JohnMcLear merged 4 commits intomasterfrom
JohnMcLear merged 4 commits intomasterfrom
Conversation
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
Member
Author
CI status note
This is the dependency I called out in the PR description: this PR can't go green until the helper publishes 0.3.0. Nothing to fix on this branch; will re-run CI once the helper is on npm. 🤖 Generated with Claude Code |
…ings The hand-rolled User Settings checkbox only let each user toggle the TOC for themselves — there was no way for the pad creator to set a pad-wide default and there was no entry in the Pad Wide Settings panel, so this plugin lived in only half of Etherpad's native settings model. Switch to padToggle: same single checkbox in User Settings, plus a parallel checkbox in Pad Wide Settings that broadcasts to every connected client and is honored by enforceSettings. The hand-rolled toc_entry.ejs template, manual click wiring, and stale settings.ep_toc.disable_by_default plumbing are all gone — the helper owns checkbox rendering, cookie persistence, broadcast sync, enforce, and i18n. The ?toc= URL override keeps working as a hard override on top. ep_plugin_helpers ^0.3.0 introduces padToggle. Pad-wide column degrades to a no-op on Etherpad cores without the ep_* padOptions passthrough patch (< 2.7.4); user-side toggle is unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Importing the top-level `ep_plugin_helpers` from client code (postAceInit.js)
made esbuild crawl every getter in index.js and try to bundle settings-toggle
+ eejs for the browser, which fails because those are server-only. The
helper now ships separate sub-paths and we use them explicitly:
// server (this file)
const {padToggle} = require('ep_plugin_helpers/pad-toggle-server');
// client (postAceInit)
const {padToggle} = require('ep_plugin_helpers/pad-toggle');
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ep_plugin_helpers padToggle now requires defaultLabel so the rendered <label> contains text screen readers can announce before html10n loads or if the translation fetch fails. Bump to 0.4.0 to signal the ep_plugin_helpers ^0.3.0 peer requirement and the padToggle migration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cb7241d to
81deb39
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
eejsBlock_mySettingscheckbox topadTogglefromep_plugin_helpers ^0.3.0.enforceSettings) — instead of just the user-side one. Matches every native Etherpad toggle.data-l10n-id, and screen-reader fallback inside<label>.templates/toc_entry.ejsdeleted;?toc=URL override still works as a hard override on top.Dependencies
Test plan
🤖 Generated with Claude Code