Skip to content

Conversation

MusikschuleFroehlich
Copy link

Summary

  • Use NodeBB’s alerts module instead of app.alert/app.removeAlert/app.alertError.
  • Bind “picture” and “upload” toolbar handlers to the active composer container to ensure file input opens in the correct instance.
  • Remove Quill-side upload toasts to avoid duplicate notifications (global uploadHelpers already shows them).
    Problem
  • Upload toasts were using app.alert, which is not available in recent NodeBB.
  • Upload/picture handlers could be bound outside the active composer, causing file input to target the wrong container.
  • Duplicate upload toasts (Quill + global uploadHelpers).
    Solution
  • Replace app.alert* with alerts.alert/alerts.remove/alerts.error.
  • Execute toolbar handlers in the context of the current postContainer (composer instance).
  • Do not emit Quill-specific upload toasts; rely on global uploadHelpers.
    Changes
  • static/lib/quill-nbb.js only (client-side).
    Compatibility
  • Tested on NodeBB 4.4.6, default theme.
    Test plan
  • Start NodeBB in development mode with unminified assets.
  • Open composer (new topic and reply), verify:
  • Drag & drop and button-initiated upload both succeed (2xx on POST /api/post/upload).
  • No duplicate toasts
  • Uploaded images embed at cursor, files insert as links.
  • Open two composers in parallel; verify each upload targets the correct instance.
    Related issues
  • Fixes Upload and Picture handlers should be bound to the current editor #71
  • Relates to general upload UX consistency (duplicate toasts).

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.

Upload and Picture handlers should be bound to the current editor
1 participant