Skip to content

Rename plugin to ai_compose to follow Roundcube naming conventions#141

Draft
maniaba with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-directory-name-case-mismatch
Draft

Rename plugin to ai_compose to follow Roundcube naming conventions#141
maniaba with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-directory-name-case-mismatch

Conversation

Copilot AI commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

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 as aicomposeplugin (lowercase). The fix is to adopt the Roundcube-standard snake_case naming (ai_compose) across the board.

Changes

  • Main entry point: AIComposePlugin.phpai_compose.php, class renamed to ai_compose
  • composer.json: extra.installer-name set to "ai_compose" (was "AIComposePlugin")
  • Roundcube plugin-name identifiers updated throughout (PHP namespace HercegDoo\AIComposePlugin left unchanged):
    • TranslationTrait: text domain "AIComposePlugin.""ai_compose."
    • AbstractAction, MailTask: action slug prefix plugin.AIComposePlugin_plugin.ai_compose_
    • SettingsTask, AddInstruction: template/label references updated
    • All skins/elastic/templates/*.html: roundcube:label name="AIComposePlugin.*""ai_compose.*"
    • JS sources (utils.js, sendPostRequest.js, settings.js): gettext/action slug strings updated; bundles rebuilt
  • README.md: install instructions updated to reference ai_compose

Config change required for existing users

// Before
$config['plugins'] = ['AIComposePlugin'];

// After
$config['plugins'] = ['ai_compose'];

Copilot AI linked an issue Apr 29, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix case-sensitivity mismatch between directory name and main plugin file Rename plugin to ai_compose to follow Roundcube naming conventions Apr 29, 2026
Copilot AI requested a review from maniaba April 29, 2026 10:33
@maniaba
maniaba requested a review from Copilot April 29, 2026 10:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_compose and updated Composer installer name.
  • Updated translation domains, template identifiers, and action slug prefixes from AIComposePlugin to ai_compose across 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>

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<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>

Copilot uses AI. Check for mistakes.
<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"/>

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<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"/>

Copilot uses AI. Check for mistakes.
@maniaba
maniaba marked this pull request as ready for review April 29, 2026 18:59
@maniaba
maniaba marked this pull request as draft April 29, 2026 18:59
@maniaba
maniaba force-pushed the copilot/fix-directory-name-case-mismatch branch from 722a5c0 to 3536ec2 Compare April 29, 2026 19:00
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.

Case-sensitivity mismatch between directory name and main plugin file

3 participants