Skip to content

Align superscript/subscript rendering in legacy block editor edit view#35414

Merged
dsilvam merged 6 commits intomainfrom
copilot/fix-superscript-alignment-legacy-editor
Apr 22, 2026
Merged

Align superscript/subscript rendering in legacy block editor edit view#35414
dsilvam merged 6 commits intomainfrom
copilot/fix-superscript-alignment-legacy-editor

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

  • Locate and read the bubble menu component (html + ts + spec)
  • Add toggleSuperscript() and toggleSubscript() methods to dot-bubble-menu.component.ts that unset the opposite mark before toggling
  • Update dot-bubble-menu.component.html to call the new methods
  • Add unit tests to dot-bubble-menu.component.spec.ts verifying both methods enforce mutual exclusion
  • All two new tests pass
  • Build verified clean
  • Run parallel validation (Code Review + CodeQL)

Copilot AI changed the title [WIP] Fix superscript alignment in legacy edit view Align superscript/subscript rendering in legacy block editor edit view Apr 22, 2026
Copilot AI requested a review from fmontes April 22, 2026 00:35
@fmontes fmontes marked this pull request as ready for review April 22, 2026 03:01
…ve in bubble menu

Agent-Logs-Url: https://github.com/dotCMS/core/sessions/b71dcb15-cc56-412e-8a41-d2a471bb2454

Co-authored-by: fmontes <751424+fmontes@users.noreply.github.com>
@fmontes fmontes requested review from rjvelazco and removed request for fmontes April 22, 2026 03:14
@github-actions github-actions Bot added the Area : Frontend PR changes Angular/TypeScript frontend code label Apr 22, 2026
…ion in bubble menu

Agent-Logs-Url: https://github.com/dotCMS/core/sessions/b71dcb15-cc56-412e-8a41-d2a471bb2454

Co-authored-by: fmontes <751424+fmontes@users.noreply.github.com>
Copilot AI requested a review from fmontes April 22, 2026 03:19
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 22, 2026

Claude finished @fmontes's task in 1m 56s —— View job


PR Review

  • Read changed files
  • Analyze code for issues
  • Post review findings

Incomplete mutual-exclusion fix — slash command path is not covered

actions-menu.extension.ts uses setSuperscript() / setSubscript() directly (no mutual exclusion):

// core-web/libs/block-editor/src/lib/extensions/action-button/actions-menu.extension.ts
subscript: () => editor.chain().setSubscript().focus().run(),
superscript: () => editor.chain().setSuperscript().focus().run(),

A user who applies subscript via the bubble menu and then adds superscript via the /superscript slash command will end up with both marks active simultaneously — the exact bug this PR claims to fix. The bubble menu and slash command menu are two paths to the same marks; only one of them enforces exclusion now. Fix this →


CSS is correct but worth documenting why

vertical-align: super/sub are browser defaults; they have to be explicitly set here because ProseMirror's base stylesheet (prosemirror.css) resets sup/sub to baseline. The fix is right, but a comment explaining that would prevent a future reader from deleting them as "redundant."


Test calls protected method via bracket access

component['toggleSuperscript']();

Works at runtime, but if the method is renamed TypeScript won't catch the stale test reference. A small risk in a file that is otherwise well-structured.


Everything else — the chain ordering, the mock design, the afterEach cleanup, the CSS placement — is clean.

@dsilvam dsilvam added this pull request to the merge queue Apr 22, 2026
Merged via the queue into main with commit 88488ea Apr 22, 2026
28 checks passed
@dsilvam dsilvam deleted the copilot/fix-superscript-alignment-legacy-editor branch April 22, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Frontend PR changes Angular/TypeScript frontend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Block editor superscript shows text lower in legacy edit view

4 participants