[Views] Pass comment, receipt form and HCB code history ivars to partials as strict locals - #15207
Open
Luke-Oldenburg wants to merge 1 commit into
Open
Luke-Oldenburg wants to merge 1 commit into
Luke-Oldenburg wants to merge 1 commit into
Conversation
This was referenced Oct 1, 2026
…ials as strict locals comments/_form and _comments (and the partials that render the form), receipts/_form_v3 (ledger_instance), hcb_codes/_admin_tools, _transaction_history and _pending_transaction_history, and reimbursement/reports/_actions, _conversation and _edit_form. The three receipt_upload_form_config hashes, ReceiptsController's error stream and the reimbursement actions streams pass the new locals too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Luke-Oldenburg
force-pushed
the
strict-locals-ivars-6-event
branch
from
October 1, 2026 07:58
e014e61 to
fc4e42d
Compare
Luke-Oldenburg
force-pushed
the
strict-locals-ivars-7-detail
branch
from
October 1, 2026 07:59
0b5ffb3 to
65b90ed
Compare
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.
Note
This is one PR in a stack split out of #15191. Review and merge them in order. Each PR's base branch is the PR before it, so its diff shows only its own change.
local_assigns@eventand row options through navs and transaction rows as strict localsSummary of the problem
Partials read instance variables that the controller, or the template rendering them, happened to set. Those inputs don't appear in the partial's strict locals declaration from #15191, nothing checks that a caller provides them, and a partial rendered from a page that didn't set the ivar silently gets
nil.This part of the stack turns each ivar a partial reads into a declared local that its callers pass. It was the fourth commit on #15191 (324 files), split by area so each part can be reviewed on its own. With every PR merged, the code is that commit's, except in three partials that got the same object under two names. Those now read the local they already had (in #15205, #15206 and #15208).
Describe your changes
comments/_formtakespopoverand reads itscommentlocal instead of@comment. Only the comment edit page passedcomment:before, and the form read@commenteverywhere else, so every caller now passescomment: @comment.comments/_comments,events/settings/_adminandreimbursement/reports/_conversationpasscommentandpopoveralong to the form.receipts/_form_v3takesledger_instance. Every caller passes it, including the threereceipt_upload_form_confighashes (inReceiptsController,hcb_codes/showandledger/items/show) andReceiptsController's error stream.hcb_codes/_admin_tools,_transaction_historyand_pending_transaction_historytakehcb_code.reimbursement/reports/_actionstakesevent, including from the turbo streams inReceiptsControllerandReimbursement::ExpensesController._conversationand_edit_formtakereport.How each conversion works
x: @x. A partial in between passes its own local along. Where a partial already had a local holding the same object, it reads that local instead of getting a second copy.nil.nil-default ones, so no partial falls back to a default the ivar didn't have.Testing
main.🤖 Generated with Claude Code