Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

fix: transaction UI padding and mobile selection bar position (#847)

Number Eight408bdd678856
diff --git a/app/views/entries/_selection_bar.html.erb b/app/views/entries/_selection_bar.html.erb
index 4db508efb2..45c51d0e4e 100644
--- a/app/views/entries/_selection_bar.html.erb
+++ b/app/views/entries/_selection_bar.html.erb
@@ -1,4 +1,4 @@
-<div class="fixed bottom-30 md:bottom-6 z-10 flex items-center justify-between rounded-xl bg-surface-inset border-secondary shadow-border-xs px-4 text-sm text-primary md:w-[420px] w-[90%] py-1.5">
+<div class="fixed bottom-[calc(5rem_+_env(safe-area-inset-bottom))] md:bottom-6 z-50 flex items-center justify-between rounded-xl bg-surface-inset border-secondary shadow-border-xs px-4 text-sm text-primary md:w-[420px] w-[90%] py-1.5">
<div class="flex items-center gap-2">
<%= check_box_tag "entry_selection", 1, true, class: "checkbox checkbox--light", data: { action: "bulk-select#deselectAll" } %>
diff --git a/app/views/transactions/_selection_bar.html.erb b/app/views/transactions/_selection_bar.html.erb
index 1e29c9d65e..062b442ad5 100644
--- a/app/views/transactions/_selection_bar.html.erb
+++ b/app/views/transactions/_selection_bar.html.erb
@@ -1,4 +1,4 @@
-<div class="fixed bottom-30 md:bottom-6 z-10 flex items-center justify-between rounded-xl bg-surface-inset border-secondary shadow-border-xs px-4 text-sm text-primary md:w-[420px] w-[90%] py-1.5">
+<div class="fixed bottom-[calc(5rem_+_env(safe-area-inset-bottom))] md:bottom-6 z-50 flex items-center justify-between rounded-xl bg-surface-inset border-secondary shadow-border-xs px-4 text-sm text-primary md:w-[420px] w-[90%] py-1.5">
<div class="flex items-center gap-2">
<%= check_box_tag "entry_selection", 1, true, class: "checkbox checkbox--light", data: { action: "bulk-select#deselectAll" } %>
diff --git a/app/views/transactions/bulk_updates/new.html.erb b/app/views/transactions/bulk_updates/new.html.erb
index 11e3bf3ff9..7b6c1e080f 100644
--- a/app/views/transactions/bulk_updates/new.html.erb
+++ b/app/views/transactions/bulk_updates/new.html.erb
@@ -5,9 +5,7 @@
<%= styled_form_with url: transactions_bulk_update_path, scope: "bulk_update", class: "h-full flex flex-col justify-between gap-4", data: { turbo_frame: "_top" } do |form| %>
<div class="space-y-4">
<%= render DS::Disclosure.new(title: "Overview", open: true) do %>
- <div class="pb-6 space-y-2">
- <%= form.date_field :date, label: "Date", max: Date.current %>
- </div>
+ <%= form.date_field :date, label: "Date", max: Date.current %>
<% end %>
<%= render DS::Disclosure.new(title: "Transactions", open: true) do %>
diff --git a/app/views/transactions/show.html.erb b/app/views/transactions/show.html.erb
index 0b875ebc87..f2914d9b82 100644
--- a/app/views/transactions/show.html.erb
+++ b/app/views/transactions/show.html.erb
@@ -48,7 +48,7 @@
<%= render "entries/protection_indicator", entry: @entry, unlock_path: unlock_transaction_path(@entry.transaction) %>
<% dialog.with_section(title: t(".overview"), open: true) do %>
- <div class="pb-4">
+ <div>
<%= styled_form_with model: @entry,
url: transaction_path(@entry),
class: "space-y-2",
@@ -95,49 +95,47 @@
<% end %>
<% dialog.with_section(title: t(".details")) do %>
- <div class="pb-4">
- <%= styled_form_with model: @entry,
- url: transaction_path(@entry),
- class: "space-y-2",
- data: { controller: "auto-submit-form" } do |f| %>
- <% unless @entry.transaction.transfer? %>
- <%= f.select :account,
- options_for_select(
- Current.family.accounts.alphabetically.pluck(:name, :id),
- @entry.account_id
- ),
- { label: t(".account_label") },
- { disabled: true } %>
+ <%= styled_form_with model: @entry,
+ url: transaction_path(@entry),
+ class: "space-y-2",
+ data: { controller: "auto-submit-form" } do |f| %>
+ <% unless @entry.transaction.transfer? %>
+ <%= f.select :account,
+ options_for_select(
+ Current.family.accounts.alphabetically.pluck(:name, :id),
+ @entry.account_id
+ ),
+ { label: t(".account_label") },
+ { disabled: true } %>
- <%= f.fields_for :entryable do |ef| %>
+ <%= f.fields_for :entryable do |ef| %>
- <%= ef.collection_select :merchant_id,
- Current.family.available_merchants.alphabetically,
- :id, :name,
- { include_blank: t(".none"),
- label: t(".merchant_label"),
- class: "text-subdued" },
- "data-auto-submit-form-target": "auto" %>
+ <%= ef.collection_select :merchant_id,
+ Current.family.available_merchants.alphabetically,
+ :id, :name,
+ { include_blank: t(".none"),
+ label: t(".merchant_label"),
+ class: "text-subdued" },
+ "data-auto-submit-form-target": "auto" %>
- <%= ef.select :tag_ids,
- Current.family.tags.alphabetically.pluck(:name, :id),
- {
- include_blank: t(".none"),
- multiple: true,
- label: t(".tags_label")
- },
- { "data-controller": "multi-select", "data-auto-submit-form-target": "auto" } %>
- <% end %>
+ <%= ef.select :tag_ids,
+ Current.family.tags.alphabetically.pluck(:name, :id),
+ {
+ include_blank: t(".none"),
+ multiple: true,
+ label: t(".tags_label")
+ },
+ { "data-controller": "multi-select", "data-auto-submit-form-target": "auto" } %>
<% end %>
+ <% end %>
- <%= f.text_area :notes,
- label: t(".note_label"),
- placeholder: t(".note_placeholder"),
- rows: 5,
- "data-auto-submit-form-target": "auto" %>
+ <%= f.text_area :notes,
+ label: t(".note_label"),
+ placeholder: t(".note_placeholder"),
+ rows: 5,
+ "data-auto-submit-form-target": "auto" %>
- <% end %>
- </div>
+ <% end %>
<% end %>
<% if (details = build_transaction_extra_details(@entry)) %>