fix: add the style dropdown to the file menu - #207
Conversation
ep_headings2 only rendered its dropdown into the editbar, so with ep_file_menu_toolbar installed there was no way to set a heading from the Format menu — the plugin never hooked any of the file menu's blocks. Add `templates/fileMenu.ejs` and hook `eejsBlock_dd_format_block`, the paragraph formatting group of the Format menu (right below Outdent), which is where a line level style belongs. The template offers the same options as the editbar dropdown and reuses the existing `ep_headings.*` localization ids. The file menu select is found by class instead of repeating the editbar select's id, and the client now binds and updates `#heading-selection, select.heading-selection` so both dropdowns apply a style and both follow the caret. This is the same shape ep_font_size and ep_font_color already use for their second dropdown. Needs ep_file_menu_toolbar >= the release that adds `dd_format_block` (ether/ep_file_menu_toolbar#121). Fixes #52 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012kA75NPq8nGRidAwhPXeCi
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoAdd heading style dropdown to the file menu
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you |
Fixes #52
Root cause
ep_headings2 renders its dropdown into
eejsBlock_editbarMenuLeftonly. Ithooks none of ep_file_menu_toolbar's menu blocks, so with that plugin
installed the Format menu has no way to set a heading — exactly what
@JohnMcLear said in the issue: "Missing the fileMenu file and relevant
entry in
ep.json".Fix
templates/fileMenu.ejs— the same options as the editbar dropdown,reusing the existing
ep_headings.*localization ids (no new keys)eejsBlock_dd_format_blockinindex.jsandep.json— the paragraphformatting group of the Format menu, right below Outdent, which is where
a line level style belongs (block added in
fix: group the Format menu so plugins land where they belong ep_file_menu_toolbar#121)
class="heading-selection"rather thanrepeating the editbar select's id, and
postAceInit/aceEditEventnowuse
#heading-selection, select.heading-selection, so both dropdownsapply a style and both follow the caret
That combined-selector shape is what ep_font_size (
'#font-size, select.size-selection') and ep_font_color ('.color-selection, #color-selection') already do for their file menu dropdown.Evidence
Etherpad
develop+ ep_file_menu_toolbar#121 + this branch, Format menu:Tests
static/tests/backend/specs/filemenu.js(runs in the existing backend job)and
static/tests/frontend-new/specs/file_menu.spec.ts, which applies aheading from the menu in a browser and skips itself when
ep_file_menu_toolbar is not installed.
With the fix:
Reverted to
masterthe backend suite fails on the missing template(
ENOENT: templates/fileMenu.ejs), which is the bug. The existingheadings.spec.tssuite still passes with the change.🤖 Generated with Claude Code
https://claude.ai/code/session_012kA75NPq8nGRidAwhPXeCi