From 9c51887024088a30c14b5181a87052c85c6ad1e9 Mon Sep 17 00:00:00 2001 From: cryptogopher Date: Sat, 17 Oct 2026 05:13:39 +0200 Subject: [PATCH] Improve index tables Stretch inputs to column width in place of fixed sizing. Set minimum column widths for columns with form inputs. Simplify table operations by removing `thead` and adding sentinel. Manage empty table display with CSS only. --- app/assets/stylesheets/application.css | 36 +++++++++++++--- app/helpers/application_helper.rb | 6 ++- app/views/measurements/_form.html.erb | 3 +- app/views/quantities/_form.html.erb | 15 +++---- app/views/quantities/create.turbo_stream.erb | 4 +- app/views/quantities/destroy.turbo_stream.erb | 1 - app/views/quantities/edit.turbo_stream.erb | 3 +- app/views/quantities/index.html.erb | 42 +++++++++---------- app/views/quantities/new.turbo_stream.erb | 9 +--- .../quantities/reparent.turbo_stream.erb | 8 ++-- app/views/units/_form.html.erb | 15 +++---- app/views/units/_unit.html.erb | 2 +- app/views/units/create.turbo_stream.erb | 3 +- app/views/units/destroy.turbo_stream.erb | 1 - app/views/units/edit.turbo_stream.erb | 3 +- app/views/units/index.html.erb | 41 +++++++++--------- app/views/units/new.turbo_stream.erb | 9 +--- app/views/units/rebase.turbo_stream.erb | 7 ++-- config/locales/en.yml | 6 +-- 19 files changed, 108 insertions(+), 106 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index a6aa322..28c606b 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -24,6 +24,7 @@ * * NOTE: style in a modular way, similar to how CSS @scope would be used, * to make transition easier once @scope is widely available. */ +/* TODO: change :root -> ? */ :root { --color-focus-gray: #f3f3f3; --color-border-gray: #dddddd; @@ -171,6 +172,7 @@ table svg:not(:only-child) { width: 1.25em; } input:focus-visible, +/* TODO: select:focus-visible is redundant with -within? */ select:focus-visible, select:focus-within, /* TODO: how to achieve `summary:focus-within` for `::details-content`? */ @@ -301,6 +303,7 @@ header { grid-area: header; } +/* TODO: change .navigation ->