Skip to content

Update: Convert templates to JSX (fixes #136) - #137

Open
swashbuck wants to merge 2 commits into
masterfrom
issue/136
Open

swashbuck wants to merge 2 commits into
masterfrom
issue/136

Conversation

@swashbuck

@swashbuck swashbuck commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #136

Update

  • Converted the tutor template and its graphic partial from Handlebars to JSX
  • The close button uses a React onClick prop instead of Backbone events()
  • The view unmounts its React tree on remove()
  • The template is looked up through this.constructor.template, so a subclass can supply its own
  • Overrides of Handlebars.templates.tutor or Handlebars.partials.tutorGraphic in a theme or plugin no longer apply

The notify popup is unaffected: it renders core's notify template, not tutor's.

Fix

  • The feedback graphic's alt is now plain text via a11y.normalize, as in core's image template. A double quote in the alt text could previously break the attribute

The rendered markup is otherwise unchanged, apart from whitespace inside the title, body and attribution wrappers.

Testing

  1. Set up MCQs with tutor _type notify, inline, overlay and none, with feedback graphics in each alignment (left, top, right, bottom) and attribution on one
  2. Submit each correct, partly correct and incorrect: feedback shows with the right title, body, heading level and graphic placement
  3. Notify: focus moves to the popup and returns to the action button on close
  4. Inline: focus moves to the feedback. Reset hides it
  5. Overlay: the feedback button is disabled while open. Close by click and Enter returns focus to it
  6. None: nothing renders
  7. Check the console for errors

Posted via collaboration with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Reviewing

Development

Successfully merging this pull request may close these issues.

Convert templates from Handlebars to JSX

1 participant