feat: migrate to ep_plugin_helpers padToggle for User + Pad Wide settings#386
Merged
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. |
…ings The hand-rolled User Settings checkbox only let each user toggle the comments pane 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 templates/settings.ejs, manual click wiring, and direct padcookie plumbing are all gone — the helper owns checkbox rendering, cookie persistence, broadcast sync, enforce, and i18n. 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>
cd89087 to
5a23e20
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
ep_plugin_helperspadToggleso the same toggle now appears in both the User Settings panel and the Pad Wide Settings panel — matching how native Etherpad toggles (sticky chat, line numbers, etc.) work.padoptionsCOLLABROOM rail (broadcast to every connected client, persisted, honored byenforceSettings).templates/settings.ejs, manual click wiring, and directpadcookieplumbing are gone.Compatibility
ep_plugin_helpers^0.3.0 (already published to npm).Changes
index.js— registerpadToggleserver hooks (loadSettings,eejsBlock_mySettings,eejsBlock_padSettings); merge helper'sclientVarsinto existingclientVarssodisplayCommentAsIcon/highlightSelectedTextand the helper'sep_plugin_helpers.padToggle.ep_comments_pageblock both ship to the client.static/js/index.js— replace thepadcookie.getPref('comments')+ manual#options-commentschange handler withcommentsToggle.init({onChange: applyVisibility}). Re-exporthandleClientMessage_CLIENT_MESSAGEso the helper refreshes when another user toggles the pad-wide checkbox.ep.json— registerloadSettings,eejsBlock_padSettings, andclient_hooks.handleClientMessage_CLIENT_MESSAGE.package.json— add"ep_plugin_helpers": "^0.3.0"dep, bump11.0.30 → 11.1.0.templates/settings.ejs— deleted (only contained the migrated<input>+<label>).Sub-path imports used per the helper's docs: server
ep_plugin_helpers/pad-toggle-server, clientep_plugin_helpers/pad-toggle. Importing the top-levelep_plugin_helpersfrom client code dragssettings/toggle(which reacheejs/Settings) into the esbuild bundle and breaks it.Test plan
l10n.js,padCopy.js,padRemove.js,readOnlyPad.js,relative_time.js).enforceSettings.🤖 Generated with Claude Code