The personal finance app for everyone (by everyone)
Ruby
Revert "Add print stylesheet for reports page (#499)" (#609)
Juan José Mata38f4c2222c6b
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erbindex 3f19d50edd..5741ff2410 100644--- a/app/views/layouts/application.html.erb+++ b/app/views/layouts/application.html.erb@@ -19,8 +19,7 @@data-app-layout-user-id-value="<%= Current.user.id %>"><divclass="hidden fixed inset-0 bg-surface z-20 h-full w-full pt-[calc(env(safe-area-inset-top)+0.75rem)] pr-3 pb-[calc(env(safe-area-inset-bottom)+0.75rem)] pl-3 overflow-y-auto transition-all duration-300"- data-app-layout-target="mobileSidebar"- data-print="hide">+ data-app-layout-target="mobileSidebar"><div class="mb-2"><%= icon("x", as_button: true, data: { action: "app-layout#closeMobileSidebar" }) %></div>@@ -34,7 +33,7 @@</div><%# MOBILE - Top nav %>- <nav class="lg:hidden flex justify-between items-center p-3" data-print="hide">+ <nav class="lg:hidden flex justify-between items-center p-3"><%= icon("panel-left", as_button: true, data: { action: "app-layout#openMobileSidebar"}) %><%= link_to root_path, class: "block" do %>@@ -45,7 +44,7 @@</nav><%# DESKTOP - Left navbar %>- <div class="hidden lg:block" data-print="hide">+ <div class="hidden lg:block"><nav class="h-full flex flex-col shrink-0 w-[84px] py-4 mr-3"><div class="pl-2 mb-3"><%= link_to root_path, class: "block" do %>@@ -79,7 +78,7 @@"hidden lg:block py-4 overflow-y-auto shrink-0 max-w-[320px] transition-all duration-300",Current.user.show_sidebar? ? expanded_sidebar_class : collapsed_sidebar_class,),- data: { app_layout_target: "leftSidebar", print: "hide" } do %>+ data: { app_layout_target: "leftSidebar" } do %><% if content_for?(:sidebar) %><%= yield :sidebar %><% else %>@@ -139,7 +138,7 @@"hidden lg:block h-full overflow-y-auto shrink-0 max-w-[400px] transition-all duration-300",Current.user.show_ai_sidebar? ? expanded_sidebar_class : collapsed_sidebar_class,),- data: { app_layout_target: "rightSidebar", print: "hide" } do %>+ data: { app_layout_target: "rightSidebar" } do %><%= tag.div id: "chat-container", class: "relative h-full", data: { controller: "chat hotkey", turbo_permanent: true } do %><div class="flex flex-col h-full justify-between shrink-0"><%= turbo_frame_tag chat_frame, src: chat_view_path(@chat), loading: "lazy", class: "h-full" do %>@@ -158,7 +157,7 @@<% end %><%# MOBILE - Bottom Nav %>- <%= tag.nav class: "lg:hidden fixed bottom-0 left-0 right-0 bg-surface z-10 pb-[env(safe-area-inset-bottom)] border-t border-tertiary flex justify-around", data: { print: "hide" } do %>+ <%= tag.nav class: "lg:hidden fixed bottom-0 left-0 right-0 bg-surface z-10 pb-[env(safe-area-inset-bottom)] border-t border-tertiary flex justify-around" do %><% mobile_nav_items.each do |nav_item| %><%= render "layouts/shared/nav_item", **nav_item %><% end %>diff --git a/app/views/reports/_transactions_breakdown.html.erb b/app/views/reports/_transactions_breakdown.html.erbindex c7c14fffe1..200ff60df0 100644--- a/app/views/reports/_transactions_breakdown.html.erb+++ b/app/views/reports/_transactions_breakdown.html.erb@@ -1,6 +1,6 @@<div><%# Export Controls %>- <div class="reports-print-hide flex items-center justify-end mb-4 flex-wrap gap-3">+ <div class="flex items-center justify-end mb-4 flex-wrap gap-3"><%# Build params hash for linksbase_params = {diff --git a/app/views/reports/index.html.erb b/app/views/reports/index.html.erbindex 032547cf55..57cd109ba2 100644--- a/app/views/reports/index.html.erb+++ b/app/views/reports/index.html.erb@@ -1,103 +1,5 @@-<% content_for :head do %>- <style media="print">- /* Print-specific custom property overrides for values using --alpha() */- :root {- --print-shadow-color: rgba(11, 11, 11, 0.06);- }-- @page {- margin: 0.75in;- }-- body {- background: var(--color-gray-50);- color: var(--color-gray-900);- font-family: var(--font-sans);- }-- #notification-tray,- #cta,- #chat-container,- turbo-frame#modal,- turbo-frame#drawer,- [data-print="hide"] {- display: none !important;- }-- [data-controller="app-layout"] {- height: auto !important;- overflow: visible !important;- display: block !important;- }-- [data-app-layout-target="content"] {- max-width: none !important;- max-height: none !important;- height: auto !important;- padding: 0 !important;- margin: 0 !important;- overflow: visible !important;- }-- body,- html {- height: auto !important;- overflow: visible !important;- }-- main {- overflow: visible !important;- height: auto !important;- max-height: none !important;- }-- [data-app-layout-target="content"] > .hidden.lg\:flex {- display: none !important;- }-- .reports-page {- background: transparent;- padding: 0 !important;- }-- .reports-print-sheet {- background: var(--color-white);- border-radius: 16px;- padding: 0.75in 0.65in;- box-shadow: 0 10px 25px var(--print-shadow-color);- }-- .reports-page section {- break-inside: avoid;- page-break-inside: avoid;- }-- .reports-print-hide,- [data-reports-section-target="button"],- [data-reports-sortable-target="handle"] {- display: none !important;- }-- [data-reports-section-target="content"] {- display: block !important;- }-- section[data-section-key="transactions_breakdown"] {- break-before: page;- page-break-before: always;- margin-top: 0 !important;- padding-top: 0 !important;- }-- .reports-page table th,- .reports-page table td {- padding-inline: 0.5rem !important;- }- </style>-<% end %>-<% content_for :page_header do %>- <div class="space-y-4 mb-6 reports-print-hide">+ <div class="space-y-4 mb-6"><div class="space-y-1"><h1 class="text-xl lg:text-3xl font-medium text-primary"><%= t("reports.index.title") %>@@ -115,7 +17,7 @@<% end %><%# Period Navigation Tabs %>- <div class="reports-print-hide flex items-center gap-2 overflow-x-auto pb-2">+ <div class="flex items-center gap-2 overflow-x-auto pb-2"><%= render DS::Link.new(text: t("reports.index.periods.monthly"),variant: @period_type == :monthly ? "secondary" : "ghost",@@ -150,7 +52,7 @@<%# Custom Date Range Picker (only shown when custom is selected) %><% if @period_type == :custom %>- <%= form_with url: reports_path, method: :get, data: { controller: "auto-submit-form" }, class: "reports-print-hide flex items-center gap-3 bg-surface-inset p-3 rounded-lg" do |f| %>+ <%= form_with url: reports_path, method: :get, data: { controller: "auto-submit-form" }, class: "flex items-center gap-3 bg-surface-inset p-3 rounded-lg" do |f| %><%= f.hidden_field :period_type, value: :custom %><div class="flex items-center gap-2">@@ -182,7 +84,7 @@</div><% end %>-<div class="reports-page w-full space-y-6 pb-24 reports-print-sheet">+<div class="w-full space-y-6 pb-24"><% if Current.family.transactions.any? %><%# Summary Dashboard - Always visible, not collapsible %><section>