fix: restore drawer positioning for transaction modals on desktop (#857) (#896)

* feat: Add responsive dialog behavior for transaction modals

Add responsive option to DS::Dialog component that switches between:
- Mobile (< 1024px): Modal style (centered) with inline close button
- Desktop (≥ 1024px): Drawer style (right side panel) with header close button
Update transaction, transfer, holding, trade, and valuation views to use
responsive behavior, maintaining mobile experience while reverting desktop
to drawer style like budget categories.

Changes:
- app/components/DS/dialog.rb: Add responsive parameter and helper methods
- app/components/DS/dialog.html.erb: Apply responsive styling
- app/views/*/show.html.erb: Add responsive: true and hide close icons on mobile

* fix: Enhance close button accessibility in dialog components

* fix: Refactor dialog component to improve close button handling and accessibility
This commit is contained in:
StalkerSea
2026-02-10 17:02:15 -06:00
committed by GitHub
parent 28d99a2b0d
commit 4cf25ada63
9 changed files with 71 additions and 136 deletions

View File

@@ -1,17 +1,17 @@
<% entry, account = @entry, @entry.account %>
<%= render DS::Dialog.new(frame: "drawer") do |dialog| %>
<% dialog.with_header(hide_close_icon: true) do %>
<%= render "valuations/header", entry: @entry %>
<%= render DS::Dialog.new(frame: "drawer", responsive: true) do |dialog| %>
<% dialog.with_header(custom_header: true) do %>
<div class="flex items-start justify-between gap-4">
<%= render "valuations/header", entry: @entry %>
<%= dialog.close_button %>
</div>
<% end %>
<% dialog.with_body do %>
<% if @error_message.present? %>
<div class="mb-4">
<%= render DS::Alert.new(message: @error_message, variant: :error) %>
</div>
<% end %>
<% dialog.with_section(title: t(".overview"), open: true) do %>
<div class="pb-4">
<%= styled_form_with model: entry,
@@ -22,11 +22,9 @@
<%= f.date_field :date,
label: t(".date_label"),
max: Date.current %>
<%= f.money_field :amount,
label: "Account value on date",
disable_currency: true %>
<div class="flex justify-end">
<%= render DS::Button.new(
text: "Update value",
@@ -37,7 +35,6 @@
<% end %>
</div>
<% end %>
<% dialog.with_section(title: t(".details")) do %>
<div class="pb-4">
<%= styled_form_with model: entry,
@@ -53,7 +50,6 @@
<% end %>
</div>
<% end %>
<% dialog.with_section(title: t(".settings")) do %>
<div class="pb-4">
<!-- Delete Valuation Form -->
@@ -62,7 +58,6 @@
<h4 class="text-primary"><%= t(".delete_title") %></h4>
<p class="text-secondary"><%= t(".delete_subtitle") %></p>
</div>
<%= button_to t(".delete"),
entry_path(entry),
method: :delete,