fix: Enable and persist notes and tags on split child transactions (#1535) (#1552)

* fix: enable and persist notes on split child transactions (#1535)

* fix: enable tags on split child transactions and new tests for split child notes + tags

* Update app/components/DS/dialog_controller.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Xing Hong <39619359+xingxing21@users.noreply.github.com>

* fix(transactions): only stream notes frame when notes params are submitted

* fix(transactions): address PR review issues in notes stream and tests

---------

Signed-off-by: Xing Hong <39619359+xingxing21@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Xing Hong
2026-04-30 01:17:36 +09:00
committed by GitHub
parent d49250826b
commit 475dbbfb8d
4 changed files with 53 additions and 11 deletions

View File

@@ -134,6 +134,8 @@ class TransactionsController < ApplicationController
@entry.transaction.lock_attr!(:tag_ids) if @entry.transaction.tags.any?
@entry.sync_account_later
notes_changed = @entry.saved_change_to_notes?
# Reload to ensure fresh state for turbo stream rendering
@entry.reload
@@ -151,9 +153,14 @@ class TransactionsController < ApplicationController
partial: "entries/protection_indicator",
locals: { entry: @entry, unlock_path: unlock_transaction_path(@entry.transaction) }
),
(turbo_stream.replace(
dom_id(@entry, :notes),
partial: "transactions/notes",
locals: { entry: @entry, can_annotate: can_annotate_entry? }
) if params[:entry]&.key?(:notes) && notes_changed),
turbo_stream.replace(@entry),
*flash_notification_stream_items
]
].compact
end
end
else