mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-06 14:05:20 +02:00
Since the very first 0.1.0-alpha.1 release, we've been moving quickly to add new features to the Maybe app. In doing so, some parts of the codebase have become outdated, unnecessary, or overly-complex as a natural result of this feature prioritization. Now that "core" Maybe is complete, we're moving into a second phase of development where we'll be working hard to improve the accuracy of existing features and build additional features on top of "core". This PR is a quick overhaul of the existing codebase aimed to: - Establish the brand new and simplified dashboard view (pictured above) - Establish and move towards the conventions introduced in Cursor rules and project design overview #1788 - Consolidate layouts and improve the performance of layout queries - Organize the core models of the Maybe domain (i.e. Account::Entry, Account::Transaction, etc.) and break out specific traits of each model into dedicated concerns for better readability - Remove stale / dead code from codebase - Remove overly complex code paths in favor of simpler ones
37 lines
1.6 KiB
Text
37 lines
1.6 KiB
Text
<%# locals: (headers: [], rows: [], caption: nil) %>
|
|
<div class="overflow-x-auto">
|
|
<div class="border border-secondary rounded-md shadow-border-xs text-sm bg-white w-full">
|
|
<div class="grid border-b border-b-alpha-black-200" style="grid-template-columns: repeat(<%= headers.length %>, minmax(0, 1fr))">
|
|
<% headers.each_with_index do |header, index| %>
|
|
<div class="
|
|
bg-gray-25 px-3 py-2.5 font-medium whitespace-nowrap overflow-x-auto
|
|
first:rounded-tl-md last:rounded-tr-md
|
|
<%= "border-r border-r-alpha-black-200" unless index == headers.length - 1 %>
|
|
">
|
|
<%= header %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% rows.each_with_index do |row, row_index| %>
|
|
<div class="grid <%= "border-b border-b-alpha-black-200" if row_index < rows.length - 1 || caption %>" style="grid-template-columns: repeat(<%= headers.length %>, minmax(0, 1fr))">
|
|
<% row.each_with_index do |(header, value), col_index| %>
|
|
<div class="
|
|
px-3 py-2.5 whitespace-nowrap overflow-x-auto flex items-start
|
|
<%= "border-r border-r-alpha-black-200" unless col_index == row.length - 1 %>
|
|
<%= "rounded-bl-md" if !caption && row_index == rows.length - 1 && col_index == 0 %>
|
|
<%= "rounded-br-md" if !caption && row_index == rows.length - 1 && col_index == row.length - 1 %>
|
|
">
|
|
<%= value %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% if caption %>
|
|
<div class="px-3 py-2.5 text-center text-xs text-primary rounded-b-md italic bg-gray-25 overflow-x-auto">
|
|
<%= caption %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|