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,32 +1,26 @@
<%# locals: (entry:) %>
<div class="flex items-start justify-between gap-4" id="<%= dom_id(entry, :header) %>">
<div>
<h3 class="font-medium flex items-center gap-2">
<span class="text-2xl text-primary">
<%= format_money -entry.amount_money %>
</span>
<span class="text-lg text-secondary">
<%= entry.currency %>
</span>
<% if entry.transaction.transfer? %>
<%= icon "arrow-left-right", size: "sm", class: "text-secondary" %>
<% end %>
<% if entry.linked? %>
<span title="<%= t('transactions.transaction.linked_with_plaid') %>" class="text-secondary">
<%= icon("refresh-ccw", size: "sm") %>
</span>
<% end %>
</h3>
<div class="flex items-center gap-2">
<span class="text-sm text-secondary">
<%= I18n.l(entry.date, format: :long) %>
</span>
<% if entry.transaction.pending? %>
<span class="inline-flex items-center gap-1 text-xs font-medium rounded-full px-1.5 py-0.5 border border-secondary text-secondary" title="<%= t("transactions.transaction.pending_tooltip") %>">
<%= icon "clock", size: "sm", color: "current" %>
@@ -35,6 +29,4 @@
<% end %>
</div>
</div>
<%= render DS::Button.new(variant: "icon", icon: "x", data: { action: "DS--dialog#close" }) %>
</div>