With https://github.com/discourse/discourse-signatures/pull/105 we had an issue where the character count would show NaN when the signature was empty.
For some reason it was not being auto tracked so when you hit the keys now it should update the UI as expected.
* FEATURE: Add decorateCookedSignature plugin API method
Adds a new plugin API method that allows themes and plugins to
decorate signature content, similar to decorateCookedElement for
posts and decorateChatMessage for chat messages.
Usage:
api.decorateCookedSignature((element, helper, post) => {
// modify signature element
});
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-authored-by: Gabriel Grubba <[email protected]>
* FEATURE: Add group, category, and display restrictions for signatures
Adds five new site settings to control signature behavior:
- signatures_allowed_groups: restrict signatures to specific groups
(server-side enforced in both serializers and user update hook)
- signatures_show_in_categories: limit signature display to specific categories
- signatures_first_post_only: only show signatures on the OP
- signatures_max_length: cap advanced mode signature length
- signatures_max_image_height: constrain signature image height
Also hardens URL validation (HTTP/HTTPS only) and reduces
signature_url max_length from 32KB to 2048.
All defaults are backward-compatible (empty/false = no change).
This updates the signature preferences connector to use modern Ember patterns and the new plugin API.
Changes:
- Convert to Glimmer component with `@service` injection
- Replace classic `<Input>` with native `<input>` and `{{on}}` modifier
- Use new `api.addSaveableCustomFields("profile")` API instead of `modifyClass save()` override
- Remove dead `@showUploadModal` argument from `DEditor`
- Add CSS to hide preview panel and match bio editor width
The `modifyClass` pattern for saving `custom_fields` was broken because `saveAttrNames` is now a getter that returns a fresh array on each call, so pushing to it in `save()` had no effect. The new `addSaveableCustomFields` API uses value transformers to properly add "`custom_fields`" to the save attributes.
cf. https://github.com/discourse/discourse/pull/36757
Remove deprecated discourse.post-stream-widget-overrides and associated legacy widget customizations.
This cleanup reduces technical debt, ensures future maintainability, and aligns with the latest framework improvements.
Using an external URL was causing the browser to actually attempt to
connect to it. Sometimes, a response from the external URL will take
more than 30 seconds to return a response causing the page to never fire
the load event before playwright's timeout is reached.
Creating the post ahead of time ensures it's ready when we want to visit it. There's also no need to reload the user as we do a visit which triggers a full page refresh.
register_editable_user_custom_field is "singular" and only access one
"custom field" as a parameter.
the fix was to call register_editable_user_custom_field for each custom
fields this plugin uses.
also added a bunch of system specs to ensure the basics of the plugin
actually works.
Internal ref - t/161823
- Introduces a new `PostSignature` component to handle user signatures, ensuring compatibility with the Glimmer post stream.
- Updates initializers to integrate the new component and maintain compatibility with existing features.