Skip to content

chore: modernize docs, a11y, and adopt template helper#182

Merged
JohnMcLear merged 5 commits intomainfrom
chore/modernize-docs-a11y-helpers
May 8, 2026
Merged

chore: modernize docs, a11y, and adopt template helper#182
JohnMcLear merged 5 commits intomainfrom
chore/modernize-docs-a11y-helpers

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Summary

Pilot for a fleet-wide plugin modernization sweep. Lands five focused commits in ep_align:

  • Rewrite CONTRIBUTING.md for plugin scope (target branch main, plugin install via pnpm run plugins i --path, i18n + a11y are now standing requirements).
  • Add AGENTS.md modeled on etherpad-lite/AGENTS.MD — project structure, helpers used vs skipped (with reasons), test commands, standing rules.
  • Flatten templates/editbarButtons.ejs: remove the <button> nested inside <a> (invalid HTML, screen-reader confusion), promote the <a> to the click target with role="button" and tabindex="0". Remove the hardcoded aria-label="Align Left/..." so etherpad's html10n auto-populates aria-label from the localized string and tags it with data-l10n-aria-label="true" (see etherpad-lite/src/static/js/vendors/html10n.ts:665-678). Adds a Playwright assertion that locks in the structural fix.
  • Add ep_plugin_helpers ^0.5.0 to dependencies.
  • Adopt template helper from ep_plugin_helpers for eejsBlock_editbarMenuLeft. The helper wraps skip() in a try/catch so a transient settings.toolbar=undefined no longer risks crashing pad render.

Out of scope (documented gaps in AGENTS.md)

  • lineAttribute helper adoption — would require migrating from inline style="text-align:..." rendering to a CSS file injected via aceEditorCSS, plus updating the Playwright assertion. Tracked as a follow-up.
  • lineAttributeExport helper — backend export shape (<p style='text-align:X'>...</p>) is enforced by static/tests/backend/specs/exportHTML.ts for back-compat; helper produces a different shape.

Test plan

  • Backend: static/tests/backend/specs/exportHTML.ts (4 alignment cases + heading interaction)
  • Frontend: static/tests/frontend-new/specs/align.spec.ts (4 alignment cases via toolbar click + new structural assertion)
  • Lint passes

Local verification was hampered by my etherpad-lite checkout being on a feature branch with degraded test state — CI is the gate.

JohnMcLear added 5 commits May 8, 2026 11:46
Replaces the etherpad-lite-era boilerplate with a plugin-specific
guide: target branch is main (not develop), local install via
pnpm run plugins i --path, tests run via the etherpad harness,
and i18n/a11y are now standing requirements. Cross-links to
ether/etherpad's CONTRIBUTING.md for shared rules.
Mirrors etherpad-lite/AGENTS.MD's shape but scoped to ep_align:
project structure, helpers used and skipped (with reasons), test
commands, and standing rules for agent edits (i18n, a11y,
export-shape stability).
Removes the <button> nested inside <a> (invalid HTML, screen-reader
confusion) by promoting the <a> to the click target with role=button
and tabindex=0, and moves the buttonicon classes onto it.

Removes the hardcoded aria-label="Align Left/..." which was blocking
html10n from populating aria-label from the localized string. With
no author-supplied aria-label, html10n now sets it from the
translation and tags the element with data-l10n-aria-label="true"
so language changes refresh the accessible name (see
etherpad-lite/src/static/js/vendors/html10n.ts:665-678).

The English title="..." stays as the pre-html10n fallback;
html10n overwrites it via the .title suffix in the data-l10n-id,
unchanged from the previous behavior.

Adds a Playwright assertion that locks in the structural fix
(no <button> children of .ep_align, every button exposes role
and an html10n-populated aria-label).
Prepares for adopting the template helper in the next commit.
Replaces the hand-rolled eejsBlock_editbarMenuLeft with the
template() helper from ep_plugin_helpers, with both the read-only
check and the toolbar-conflict check encoded in the skip callback.
The helper wraps skip() in a try/catch so a transient
settings.toolbar=undefined no longer risks crashing pad render.
@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 c2281c7 into main May 8, 2026
3 checks passed
@JohnMcLear JohnMcLear deleted the chore/modernize-docs-a11y-helpers branch May 8, 2026 11:08
This was referenced May 9, 2026
This was referenced May 9, 2026
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