From 6a1646eb28556c3bebe1bada2af95b730390c742 Mon Sep 17 00:00:00 2001 From: lone Date: Wed, 22 Oct 2025 13:08:17 +0100 Subject: [PATCH 1/4] feat(register): add provider autocomplete via and new setting \n\n- Replace plain domain input with autocomplete component (prefix filter)\n- Expose setting (array of provider domains)\n- Import autocomplete component in register plugin\n- Docs: add configuration section for (with example)\n\nAddresses conversejs/converse.js#2740 (bounty/good-first-issue). --- docs/source/configuration.rst | 23 +++++++++++++++++++ src/plugins/register/index.js | 6 ++++- .../register/templates/choose_provider.js | 13 ++++++----- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index eacff43af5..6a7a2b4950 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -1718,6 +1718,29 @@ providers_link The hyperlink on the registration form which points to a directory of public XMPP servers. +registration_providers +---------------------- + +* Default: ``[]`` + +An optional array of XMPP provider domains to suggest via autocomplete when the user enters the +provider on the registration form. + +For example: + +.. code-block:: javascript + + converse.initialize({ + registration_providers: [ + 'conversejs.org', + 'jabber.org', + 'xmpp.jp', + 'trashserver.net', + ] + }); + +Suggestions are shown via the ```` component and filtered by prefix. + .. _`assets_path`: assets_path diff --git a/src/plugins/register/index.js b/src/plugins/register/index.js index 99e90dc90d..2d9526d3e2 100644 --- a/src/plugins/register/index.js +++ b/src/plugins/register/index.js @@ -10,6 +10,7 @@ import { __ } from 'i18n'; import { routeToForm } from './utils.js'; import RegistrationForm from './form.js'; import RegisterLink from './register_link.js'; +import 'shared/autocomplete/index.js'; // Strophe methods for building stanzas const { Strophe } = converse.env; @@ -43,7 +44,10 @@ converse.plugins.add('converse-register', { allow_registration: true, domain_placeholder: __(' e.g. conversejs.org'), // Placeholder text shown in the domain input on the registration form providers_link: 'https://providers.xmpp.net/', // Link to XMPP providers shown on registration page - registration_domain: '' + registration_domain: '', + // Optional list of known public XMPP providers to suggest during registration + // e.g.: ['conversejs.org', 'jabber.org', 'xmpp.jp'] + registration_providers: [] }); const exports = { RegisterLink, RegistrationForm }; diff --git a/src/plugins/register/templates/choose_provider.js b/src/plugins/register/templates/choose_provider.js index dfdff66c52..99fe5aebb9 100644 --- a/src/plugins/register/templates/choose_provider.js +++ b/src/plugins/register/templates/choose_provider.js @@ -37,15 +37,16 @@ function tplDomainInput(el) { const i18n_providers = __('Tip: A list of public XMPP providers is available'); const i18n_providers_link = __('here'); const href_providers = api.settings.get('providers_link'); + const providers = api.settings.get('registration_providers') || []; return html` - + ?required=${true} + .value=${el.domain || ''} + >

${i18n_providers} ${i18n_providers_link}. From 12f3d2b4d1f7261e7917f7eb49ca54625499aa80 Mon Sep 17 00:00:00 2001 From: lone Date: Wed, 22 Oct 2025 13:35:13 +0100 Subject: [PATCH 2/4] fix(rosterview): correct add-contact autocomplete bindings and include \n\n- Use property bindings for .list and .data (remove quoted strings)\n- Trigger suggestions on '@' with min_chars=1\n- Merge configured into domain list\n\nAddresses #2929 (bounty). --- src/plugins/rosterview/modals/templates/add-contact.js | 9 +++++---- src/plugins/rosterview/utils.js | 7 +++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/plugins/rosterview/modals/templates/add-contact.js b/src/plugins/rosterview/modals/templates/add-contact.js index 6ff57f8e7d..ff4511c5d7 100644 --- a/src/plugins/rosterview/modals/templates/add-contact.js +++ b/src/plugins/rosterview/modals/templates/add-contact.js @@ -35,12 +35,13 @@ export default (el) => { name="jid" >` : html` `${input.slice(0, input.indexOf('@'))}@${text}`} position="below" - min_chars="2" + min_chars="1" filter="startswith" - ?required="${!api.settings.get('xhr_user_search_url')}" + triggers="@" + ?required=${!api.settings.get('xhr_user_search_url')} value="${el.state.get('jid') || ''}" placeholder="${i18n_contact_placeholder}" name="jid" diff --git a/src/plugins/rosterview/utils.js b/src/plugins/rosterview/utils.js index fa2f192a50..91dd96f36f 100644 --- a/src/plugins/rosterview/utils.js +++ b/src/plugins/rosterview/utils.js @@ -340,11 +340,14 @@ export function getGroupsAutoCompleteList() { export function getJIDsAutoCompleteList() { const roster = /** @type {RosterContacts} */ (_converse.state.roster); + const from_roster = roster.map((item) => Strophe.getDomainFromJid(item.get('jid'))); + const from_settings = api.settings.get('registration_providers') || []; return [ ...new Set([ - ...roster.map((item) => Strophe.getDomainFromJid(item.get('jid'))), + ...from_roster, _converse.session.get('domain'), - ]), + ...from_settings, + ].filter(Boolean)), ]; } From 38584f9798eb1779ae99ff1c1ac7c914486aba0a Mon Sep 17 00:00:00 2001 From: lone Date: Wed, 22 Oct 2025 15:03:56 +0100 Subject: [PATCH 3/4] a11y(audio): add ARIA label, group role, and keyboard focus to audio player -

and