From c610b0ba4b2168717f23d68ff973fa8f68e92377 Mon Sep 17 00:00:00 2001 From: Zach Gollwitzer Date: Tue, 25 Feb 2025 17:28:40 -0500 Subject: [PATCH] Dashboard design fixes (#1898) * Dashboard design fixes * Update dashboard greeting * Remove sidebar toggle from settings breadcrumbs * Autofocus and outlines for category dropdowns * Lint fixes --- app/helpers/forms_helper.rb | 2 +- .../controllers/list_filter_controller.js | 4 ++ .../controllers/sidebar_controller.js | 2 +- .../time_series_chart_controller.js | 2 +- .../accountable_sparklines/show.html.erb | 2 +- .../accounts/_account_sidebar_tabs.html.erb | 10 ++--- .../accounts/_accountable_group.html.erb | 8 ++-- app/views/accounts/_logo.html.erb | 4 +- app/views/accounts/chart.html.erb | 2 +- app/views/accounts/new.html.erb | 29 +++++++++----- app/views/accounts/sparkline.html.erb | 2 +- app/views/categories/_color_avatar.html.erb | 2 +- app/views/categories/_form.html.erb | 4 +- app/views/category/dropdowns/_row.html.erb | 7 +++- app/views/layouts/application.html.erb | 23 +++++------ app/views/layouts/settings.html.erb | 6 +-- .../layouts/shared/_breadcrumbs.html.erb | 40 ++++++++++--------- .../layouts/shared/_page_header.html.erb | 2 +- app/views/pages/dashboard.html.erb | 2 +- .../pages/dashboard/_balance_sheet.html.erb | 2 +- .../pages/dashboard/_net_worth_chart.html.erb | 4 +- app/views/settings/_settings_nav.html.erb | 2 +- app/views/shared/_color_avatar.html.erb | 2 +- app/views/shared/_modal.html.erb | 2 +- app/views/shared/_trend_change.html.erb | 4 +- 25 files changed, 95 insertions(+), 74 deletions(-) diff --git a/app/helpers/forms_helper.rb b/app/helpers/forms_helper.rb index 22861eb0..55c8c74c 100644 --- a/app/helpers/forms_helper.rb +++ b/app/helpers/forms_helper.rb @@ -17,7 +17,7 @@ module FormsHelper end end - def period_select(form:, selected:, classes: "border border-tertiary shadow-xs rounded-lg text-sm pr-7 cursor-pointer text-primary focus:outline-hidden focus:ring-0") + def period_select(form:, selected:, classes: "border border-secondary rounded-lg text-sm pr-7 cursor-pointer text-primary focus:outline-hidden focus:ring-0") periods_for_select = Period.all.map { |period| [ period.label_short, period.key ] } form.select(:period, periods_for_select, { selected: selected.key }, class: classes, data: { "auto-submit-form-target": "auto" }) diff --git a/app/javascript/controllers/list_filter_controller.js b/app/javascript/controllers/list_filter_controller.js index dafb214a..279d8b47 100644 --- a/app/javascript/controllers/list_filter_controller.js +++ b/app/javascript/controllers/list_filter_controller.js @@ -4,6 +4,10 @@ import { Controller } from "@hotwired/stimulus"; export default class extends Controller { static targets = ["input", "list", "emptyMessage"]; + connect() { + this.inputTarget.focus(); + } + filter() { const filterValue = this.inputTarget.value.toLowerCase(); const items = this.listTarget.querySelectorAll(".filterable-item"); diff --git a/app/javascript/controllers/sidebar_controller.js b/app/javascript/controllers/sidebar_controller.js index 7ed40418..e0577edf 100644 --- a/app/javascript/controllers/sidebar_controller.js +++ b/app/javascript/controllers/sidebar_controller.js @@ -8,7 +8,7 @@ export default class extends Controller { toggle() { this.panelTarget.classList.toggle("w-0"); this.panelTarget.classList.toggle("opacity-0"); - this.panelTarget.classList.toggle("w-[260px]"); + this.panelTarget.classList.toggle("w-80"); this.panelTarget.classList.toggle("opacity-100"); this.contentTarget.classList.toggle("max-w-4xl"); this.contentTarget.classList.toggle("max-w-5xl"); diff --git a/app/javascript/controllers/time_series_chart_controller.js b/app/javascript/controllers/time_series_chart_controller.js index d3cc05cc..7fc86100 100644 --- a/app/javascript/controllers/time_series_chart_controller.js +++ b/app/javascript/controllers/time_series_chart_controller.js @@ -446,7 +446,7 @@ export default class extends Controller { get _margin() { if (this.useLabelsValue) { - return { top: 20, right: 0, bottom: 30, left: 0 }; + return { top: 20, right: 0, bottom: 10, left: 0 }; } return { top: 0, right: 0, bottom: 0, left: 0 }; } diff --git a/app/views/accountable_sparklines/show.html.erb b/app/views/accountable_sparklines/show.html.erb index b5a479a8..ba915d57 100644 --- a/app/views/accountable_sparklines/show.html.erb +++ b/app/views/accountable_sparklines/show.html.erb @@ -6,6 +6,6 @@ <%= tag.p @series.trend.percent_formatted, style: "color: #{@series.trend.color}", - class: "text-right text-xs font-medium text-primary" %> + class: "font-mono text-right text-xs font-medium text-primary" %> <% end %> diff --git a/app/views/accounts/_account_sidebar_tabs.html.erb b/app/views/accounts/_account_sidebar_tabs.html.erb index 3bf4d64e..d42fab86 100644 --- a/app/views/accounts/_account_sidebar_tabs.html.erb +++ b/app/views/accounts/_account_sidebar_tabs.html.erb @@ -8,21 +8,21 @@ data-tabs-inactive-class="text-secondary" data-tabs-default-tab-value="assets-tab">
- - -
- <%= link_to new_account_path(step: "method_select"), + <%= link_to new_account_path(step: "method_select", classification: "asset"), class: "flex items-center gap-3 btn btn--ghost text-secondary mb-1", data: { turbo_frame: "modal" } do %> <%= icon("plus") %> @@ -37,7 +37,7 @@