Namespace Stimulus controllers with coplan-- prefix#40
Merged
HamptonMakes merged 2 commits intomainfrom Mar 6, 2026
Merged
Conversation
The engine's importmap pins controllers under controllers/coplan, which registers them as coplan--text-selection, coplan--tabs, etc. in Stimulus. The views were referencing non-namespaced identifiers (text-selection, tabs, dropdown) which only worked in the main coplan app because it had duplicate copies of the controllers at the non-namespaced path. Host apps like coplan-square that rely solely on the engine's importmap never loaded the controllers. Update all data-controller, data-*-target, and data-action attributes to use the coplan-- namespace prefix. Amp-Thread-ID: https://ampcode.com/threads/T-019cbf49-a8fa-739b-9d02-f3f3eab982f4 Co-authored-by: Amp <amp@ampcode.com>
These were duplicates of the engine controllers at the non-namespaced path. Now that views use coplan-- prefixed identifiers, the engine's importmap (controllers/coplan/*) provides the controllers directly. Amp-Thread-ID: https://ampcode.com/threads/T-019cbf49-a8fa-739b-9d02-f3f3eab982f4 Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Update all engine view templates to use the
coplan--namespace prefix for Stimulus controller identifiers (e.g.,coplan--text-selection,coplan--tabs,coplan--dropdown).Why
The engine's importmap pins controllers under
controllers/coplan, which Stimulus registers with thecoplan--prefix. But the views were referencing non-namespaced identifiers (text-selection,tabs,dropdown), which only worked in the main coplan app because it had duplicate copies at the non-namespaced path.Host apps like coplan-square that rely solely on the engine's importmap never loaded the controllers — text selection popover, Open/Resolved tabs, and the dropdown menu were all silently broken.
Changes
show.html.erb—text-selection→coplan--text-selection,tabs→coplan--tabs_header.html.erb—dropdown→coplan--dropdown_new_comment_form.html.erb— alltext-selectiontargets/actions →coplan--text-selection_reply_form.html.erb—text-selectionaction →coplan--text-selection_thread.html.erb—text-selectionaction →coplan--text-selection