Repository navigation
Stop project controller errors on the unshipped ship form - #8
Draft
posthog[bot] wants to merge 1 commit into
Draft
posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
The ship form attaches the project controller but renders no Clippy sprite. connect() now returns early when the sprite target is missing, and disconnect() stops Clippy only if it exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 33586a60-4e5a-4222-a751-3f4e26fbe901
This branch has not been deployed
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.
Problem
ships/show.html.erbputsdata-controller="project"on the page root. Only the "Shipped." branch renders the Clippyspritetarget. The form branch does not.connect()readsthis.spriteTargetwith no guard, so Stimulus throws "Missing target element".this.clippystays unset, sodisconnect()then throws onthis.clippy.stop().Origin
304ba47Changes
projectcontroller now does nothing when the page has no sprite.connect()returns early ifhasSpriteTargetis false, anddisconnect()callsthis.clippy?.stop().#hopneeds no guard of its own: it runs only after Clippy exists, and the clippy and sprite targets always render together.Testing
node --checkon the controllerconnect()anddisconnect()do not throwbin/rails test:system(project_test.rbshipping test)bin/rubocop,brakeman,importmap auditAgent context
data-controller="project"onto the "Shipped." block only. That change also moves theclippy,moodandsoundsvalues. A guard in the controller is smaller and also protects any future page that has no sprite./project/shipand thestopon undefined error) get no new occurrences after deploy.Created with PostHog Desktop from this inbox report.
🤖 Generated with Claude Code