Rename plugin to ai_compose to follow Roundcube naming conventions#141
ai_compose to follow Roundcube naming conventions#141Conversation
ai_compose to follow Roundcube naming conventions
There was a problem hiding this comment.
Pull request overview
Renames the Roundcube plugin identifier to ai_compose to ensure the plugin directory name, main PHP filename, and plugin class name match exactly (preventing install/load failures on case-sensitive filesystems).
Changes:
- Renamed the plugin entry point/class to
ai_composeand updated Composer installer name. - Updated translation domains, template identifiers, and action slug prefixes from
AIComposePlugintoai_composeacross PHP/HTML/JS. - Updated README install/config instructions to reference
ai_compose.
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Utilities/TranslationTrait.php | Switch gettext domain prefix to ai_compose.*. |
| src/Tasks/SettingsTask.php | Update page title, labels, and template send target to ai_compose.*. |
| src/Tasks/MailTask.php | Update action prefix to plugin.ai_compose_. |
| src/Actions/Settings/AddInstruction.php | Update form action + template send target to ai_compose/plugin.ai_compose_*. |
| src/Actions/AbstractAction.php | Update generated action slug prefix to plugin.ai_compose_. |
| skins/elastic/templates/popup.html | Update label keys to ai_compose.*. |
| skins/elastic/templates/instruction_examples.html | Update label keys to ai_compose.*. |
| skins/elastic/templates/fix_text_tootltip.html | Update label keys to ai_compose.*. |
| skins/elastic/templates/ai_select_fields.html | Update label keys to ai_compose.*. |
| skins/elastic/templates/ai_compose_instruction_field.html | Update label keys to ai_compose.*. |
| composer.json | Add extra.installer-name = ai_compose. |
| assets/src/utils.js | Update JS gettext domain to ai_compose.*. |
| assets/src/settings.js | Update settings actions to plugin.ai_compose_*. |
| assets/src/compose/commands/sendPostRequest.js | Update compose action to plugin.ai_compose_*. |
| assets/dist/settings.bundle.js | Rebuilt bundle with updated ai_compose strings/actions. |
| assets/dist/compose.bundle.js | Rebuilt bundle with updated ai_compose strings/actions. |
| ai_compose.php | Rename plugin class to ai_compose. |
| README.md | Update install/config instructions to ai_compose. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <roundcube:object name="aicinstruction" part="to" class=" form-control" id="aic-instruction" form="form" tabindex="1" aria-required="true" data-recipient-input="true" /> | ||
| <span class="input-group-append"> | ||
| <a href="#" data-popup="predefined-instructions" id="aic-popup" class="input-group-text icon" title="<roundcube:label name="AIComposePlugin.ai_predefined_section_title" />" tabindex="1"><span class="inner"><roundcube:label name="AIComposePlugin.ai_predefined_section_title" /></span></a> | ||
| <a href="#" data-popup="predefined-instructions" id="aic-popup" class="input-group-text icon" title="<roundcube:label name="ai_compose.ai_predefined_section_title" />" tabindex="1"><span class="inner"><roundcube:label name="ai_compose.ai_predefined_section_title" /></span></a> |
There was a problem hiding this comment.
The title attribute wraps a <roundcube:label ...> tag that itself uses double quotes for its name attribute, resulting in nested double quotes inside the HTML attribute value. This makes the template source invalid and can break Roundcube template parsing / HTML parsing. Use single quotes inside the roundcube:label tag (or escape the inner quotes) so the title attribute remains well-formed.
| <a href="#" data-popup="predefined-instructions" id="aic-popup" class="input-group-text icon" title="<roundcube:label name="ai_compose.ai_predefined_section_title" />" tabindex="1"><span class="inner"><roundcube:label name="ai_compose.ai_predefined_section_title" /></span></a> | |
| <a href="#" data-popup="predefined-instructions" id="aic-popup" class="input-group-text icon" title="<roundcube:label name='ai_compose.ai_predefined_section_title' />" tabindex="1"><span class="inner"><roundcube:label name="ai_compose.ai_predefined_section_title" /></span></a> |
| <div class="help-header"> | ||
| <roundcube:button type="button" command="closehelpexamples" class="btn btn-primary" label="AIComposePlugin.ai_help_button_back" class="aic-back-button"/> | ||
| <h3 id="help-title"><roundcube:label name="AIComposePlugin.ai_help_title" /></h3> | ||
| <roundcube:button type="button" command="closehelpexamples" class="btn btn-primary" label="ai_compose.ai_help_button_back" class="aic-back-button"/> |
There was a problem hiding this comment.
This <roundcube:button> tag declares the class attribute twice. In HTML the later attribute wins, so one of the class values will be dropped, and the markup is invalid. Combine both class values into a single class attribute to ensure styling works reliably.
| <roundcube:button type="button" command="closehelpexamples" class="btn btn-primary" label="ai_compose.ai_help_button_back" class="aic-back-button"/> | |
| <roundcube:button type="button" command="closehelpexamples" class="btn btn-primary aic-back-button" label="ai_compose.ai_help_button_back"/> |
Agent-Logs-Url: https://github.com/HercegDoo/AIComposePlugin/sessions/03175459-13ba-40ff-8f5f-07255302d221 Co-authored-by: maniaba <61078470+maniaba@users.noreply.github.com>
Agent-Logs-Url: https://github.com/HercegDoo/AIComposePlugin/sessions/03175459-13ba-40ff-8f5f-07255302d221 Co-authored-by: maniaba <61078470+maniaba@users.noreply.github.com>
722a5c0 to
3536ec2
Compare
Roundcube expects the plugin directory name, main PHP filename, and class name to all match exactly. Using
AIComposePlugin(PascalCase) caused install failures on Linux when Composer created the directory asaicomposeplugin(lowercase). The fix is to adopt the Roundcube-standardsnake_casenaming (ai_compose) across the board.Changes
AIComposePlugin.php→ai_compose.php, class renamed toai_composecomposer.json:extra.installer-nameset to"ai_compose"(was"AIComposePlugin")HercegDoo\AIComposePluginleft unchanged):TranslationTrait: text domain"AIComposePlugin."→"ai_compose."AbstractAction,MailTask: action slug prefixplugin.AIComposePlugin_→plugin.ai_compose_SettingsTask,AddInstruction: template/label references updatedskins/elastic/templates/*.html:roundcube:label name="AIComposePlugin.*"→"ai_compose.*"utils.js,sendPostRequest.js,settings.js):gettext/action slug strings updated; bundles rebuiltREADME.md: install instructions updated to referenceai_composeConfig change required for existing users