feat(transfers): Add ability to rename transfers from the drawer #5329
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #5329"
general
weight: 0.35
gariasf
Problem
A transfer's name cannot be currently changed. If the transfer is created manually, it just says "Transfer from"/"Payment to". But if it comes from a transaction, it gets the name of the original transaction, while the other leg says "Transfer from"/"Payment to", or the matching transaction.
What this changes
The transfer drawer now shows each leg's own name and lets a user with write access to
both endpoints rename them inline:
Transfer#display_name: the shared label when both legs are namedidentically (the user or importer spoke of the transfer as one thing), otherwise a
contextual type ("Credit card payment", "Loan payment", "Investment contribution",
"Payment", "Transfer") so neither leg's name is passed off as the name for both.
looks like the row's value, not a boxed form input. Blurring submits via the existing
auto-submit controller; the turbo-stream response replaces both entry rows and the
drawer's name, so the list and the drawer stay in sync without a reload.
Transfer#rename_entries!renames both legs atomically, strips whitespace, and returnsfalse when either name is blank — the controller turns that into an alert and changes
nothing. Only changed legs are written, and each renamed leg locks just its name via
lock_saved_attributes!so a later provider sync cannot overwrite the user's label,without freezing unrelated provider enrichment.
rather than silently leaving the other leg unchanged, and the permission check reuses
the same
require_account_permission!flow as every other transfer mutation. Therename fields are hidden for viewers without write access to both endpoints, so
read-only sharers never see a CTA the controller would reject.
Design system
The inline field is a new primitive,
DS::InlineEdit, with a component preview: aninput styled as the row's value text with a pencil affordance on hover/focus, usable
inside any summary row (currently
DS::DetailRow's value slot). The caller supplies theaccessible name, since the visible label usually lives in a sibling
<dt>.Validation
bin/rails test test/controllers/transfers_controller_test.rb test/models/transfer_test.rb— 120 runs, 433 assertions, 0 failures, 0 errors
bin/rails test test/components/DS/inline_edit_test.rb— 3 runs, 7 assertions, 0 failuresbin/rails test test/system/transfers_test.rb— 3 runs, 14 assertions, 0 failuresrubocop/erb_linton all changed Ruby and ERB files — no offensesThe system test drives the real flow: open the drawer from the transaction list, fill
both name fields, blur to auto-submit, and assert both the drawer's name and the
transaction row update.
Notes
into
transfers/_overviewunchanged apart from the added name rows; the fee andstatus behaviors are untouched.
Screenshots
<img width="652" height="760" alt="image" src="https://github.com/user-attachments/assets/8253536d-77a9-4fbb-9ea6-bc8f7a8b8fe9" />
``
<!-- This is an auto-generated description by cubic. -->
---
Summary by cubic
Adds inline renaming of both transfer legs from the transfer drawer, so transfers created manually or from transactions can get meaningful labels.
renames both legs atomically, strips whitespace, and raisesActiveRecord::RecordInvalidon blank names so the controller surfaces an alert; changed legs lock their names so provider syncs don't overwrite user labels.design-system primitive for inline-editable text values inDS::DetailRow` summary rows.<sup>Written for commit 29c5e17ef93ff843900d31731d4754671a1b3aa1. Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/we-promise/sure/pull/5329?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Added inline editing for transfer transaction names when both accounts are writable. Changes appear in the transfer view and transaction list.
Transfer displays use a shared name when both transactions match, or a contextual, translated label when they differ.
Transfer overviews show source and destination account details, including applicable fees and totals.
Bug Fixes
Blank names are rejected without changing either transaction. Updates that omit names leave existing names unchanged.
* Transaction names for accounts a viewer cannot access are not exposed in the transfer overview.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->