Skip to content

feat: migrate to ep_plugin_helpers padToggle (User + Pad Wide settings)#88

Merged
JohnMcLear merged 1 commit intomainfrom
feat/migrate-to-pad-toggle
May 7, 2026
Merged

feat: migrate to ep_plugin_helpers padToggle (User + Pad Wide settings)#88
JohnMcLear merged 1 commit intomainfrom
feat/migrate-to-pad-toggle

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Summary

  • Migrate the reference-pane visibility checkbox from a hand-rolled User Settings entry to padToggle from ep_plugin_helpers ^0.3.0, so a parallel checkbox now appears in the Pad Wide Settings panel and broadcasts/persists/enforces the way native settings do.
  • Move the server-side hooks out of eejs.js into a top-level index.js (matching the canonical migration in ep_table_of_contents) and add loadSettings, clientVars, and eejsBlock_padSettings exports.
  • Wire handleClientMessage_CLIENT_MESSAGE on the client so pad-wide broadcasts refresh local state, and replace the #options-reference click handler with referenceToggle.init({onChange}).
  • Drop the obsolete templates/referenceSettings.ejs (rendered checkbox is now generated by the helper) and eejs.js.
  • Add an ep_reference.title l10n id with Show Reference / Quote creator as the screen-reader fallback (previously the label had no data-l10n-id at all).

Test plan

  • pnpm run lint passes (no new warnings).
  • Install plugin in Etherpad, verify checkbox appears in both User Settings and Pad Wide Settings, toggling either side shows/hides the reference pane.
  • On Etherpad cores < 2.7.4 the Pad Wide column hides automatically while the user-side toggle still works.
  • enforceSettings set in pad options forces the user-side checkbox to follow the pad-wide value.

DO NOT MERGE.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

…ings

The hand-rolled User Settings checkbox only let each user toggle the
reference pane for themselves — there was no way for the pad creator to
set a pad-wide default, no entry in the Pad Wide Settings panel, and the
existing label had no l10n id.

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
referenceSettings.ejs template, the standalone eejs.js hook module, and
the manual click wiring are gone — the helper owns checkbox rendering,
cookie persistence, broadcast sync, enforce, and i18n. Server hooks now
live in a top-level index.js to match the canonical layout.

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>
@qodo-code-review
Copy link
Copy Markdown

ⓘ 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.

@JohnMcLear JohnMcLear merged commit 7f4d577 into main May 7, 2026
3 checks passed
@JohnMcLear JohnMcLear deleted the feat/migrate-to-pad-toggle branch May 7, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant