Skip to content

Conversation

@ByteBard11
Copy link

@ByteBard11 ByteBard11 commented Oct 3, 2025

This pull request improves mobile usability on the transactions page, with a focus on smaller screens.

Changes

  1. Replaced fixed column counts (e.g. grid-cols-12) with dynamic grid columns per transaction group, so column widths adapt to content.

    • Fixes spacing issues on smaller screens.
    • More flexible than relying on preset widths.
  2. Categories are now always visible across all screen sizes (previously hidden on smaller breakpoints).

  3. Reduced excess spacing between the search bar, header bar, and transactions list for better use of space on small devices.

  4. Updated checkbox alignment, so “heavier” checkboxes appear further left to convey hierarchy.

  5. Adjusted merchant image sizing to align consistently and fill the transaction row height properly.

  6. Refined the auto‑match button:

    • Tidied appearance.
    • Shortens label to “A/M” on smaller screens to preserve space for transaction names.

Addresses:
#166, #181

Together, these changes make the transactions page more consistent, space‑efficient, and readable across all screen sizes, with a particular improvement in usability on smaller devices.

Old vs New:

EXTRA SMALL SCREEN (iPhone SE selected in chrome inspect):
localhost_3000_transactions_page=1 per_page=50(iPhone SE) (2) localhost_3000_transactions_page=1 per_page=50(iPhone SE) (1)

SMALL SCREEN:
localhost_3000_transactions_page=1 per_page=50 localhost_3000_transactions_page=1 per_page=50 (1)

LARGE SCREEN (Limited Changes):
localhost_3000_transactions_page=1 per_page=50 (3) localhost_3000_transactions_page=1 per_page=50 (2)

Summary by CodeRabbit

  • Style
    • Simplified transactions header into a responsive grid and removed the separate category column.
    • Streamlined transaction rows with nested layout changes, improved alignment, avatar/icon sizing, and right-aligned amounts.
    • Entry-group layout adjusted for tighter spacing and grid-based container.
    • Transfer-match badge updated to show “Auto-matched” or “A/M” responsively and group actions.
    • Category badges support icon-only mode with responsive name hiding; menu and transfer views use icon-only.
    • Removed extra spacing from search filters and reduced list vertical spacing.

1. Switches from set number cols (12), to dynamic per group of transactions.
    - This should fix spacing issues on smaller screens, and is more dynamic than changing pre-set widths.
2. Enabled categories to show on all views regarless of screen size.
3. Adjusted spacing between searchbar, headerbar & transactions to remove blank space on smaller screens.
4. Adjusted tick boxes, where higher = more left to signify weight.
5. Adjusted merchant images to fill the transaction row correctly.
6. Tidied automatch button & shortened to 'A/M' on smaller screens to increase usable space for transaction name.
@coderabbitai
Copy link

coderabbitai bot commented Oct 3, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Multiple ERB view updates: adjusted spacing, grid/flex layout and responsive visibility for category badges, entry groups, transactions list and transaction partials; added icon_only local to some badge renders; replaced a transfer badge with responsive labels and grouped action controls. No backend logic changes.

Changes

Cohort / File(s) Summary of changes
Category Badge
app/views/categories/_badge.html.erb
Switched outer span from fixed flex to inline-flex with px-2, conditional min-width/centering when icon_only is true; category name hidden on small screens if icon_only; color/style logic unchanged.
Category Menu / Category Usage
app/views/categories/_menu.html.erb, app/views/transactions/_transaction_category.html.erb
Pass icon_only: true when rendering the badge in menu and non-categorizable transfer branch.
Entry Group Layout
app/views/entries/_entry_group.html.erb
Adjusted header padding (py-2 px-4py-3 px-2), replaced outer wrapper with a two-column grid (grid grid-cols-[minmax(0,1fr)_auto]); ERB formatting/indentation tweaked.
Transaction Partial
app/views/transactions/_transaction.html.erb
Reworked turbo_frame nesting to single outer frame + inner transaction frame; switched wrapper classes to new grid/flex layout, responsive visibility changes (logo/name blocks hidden on small screens), icon size adjusted, category rendering moved into new responsive containers, amount alignment updated.
Transfer Match Badge
app/views/transactions/_transfer_match.html.erb
Replaced static "Auto-matched" badge with responsive labels ("Auto-matched" / "A/M"), grouped action buttons inside the same outer container; corrected span closure.
Transactions Index & Search
app/views/transactions/index.html.erb, app/views/transactions/searches/_search.html.erb
index: simplified header to grid grid-cols-[1fr_auto], reduced padding, removed small-screen TRANSACTION row, removed category column, tightened entry spacing (space-y-6space-y-4). search: removed mb-4 from filters list.

Sequence Diagram(s)

sequenceDiagram
  %% Styling note: primary interactions only
  autonumber
  actor User
  participant Browser
  participant Server
  participant View as Transactions View (index/_transaction/_badge)

  User->>Browser: Request /transactions
  Browser->>Server: GET /transactions
  Server-->>Browser: Rendered HTML (index + entry frames)
  Browser->>View: Render page components
  View->>View: Render entry frames → inner transaction frames
  View->>View: Render badge (with icon_only when applicable)
  Browser-->>User: Display updated layout (responsive badges, revised header, grouped controls)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to: app/views/transactions/_transaction.html.erb (turbo_frame and responsive layout changes), app/views/categories/_badge.html.erb (conditional icon_only behavior and responsive hiding), and places where the badge partial is now called with icon_only: true.

Poem

A rabbit nibbles CSS by moonlight,
Trims paddings, nudges spans just right.
Frames tuck in, badges learn to hide,
Small screens smile, grids breathe wide.
Hop—new views look spry and bright. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Improved Transactions Page For Smaller Screens" directly aligns with the primary objective of this changeset. All modifications across multiple view files—including responsive layout adjustments in _transaction.html.erb, spacing refinements, responsive badge rendering, and column layout changes in index.html.erb—are specifically focused on enhancing mobile usability and adapting the transactions page for smaller screen sizes. The title is concise, clear, and accurately captures the main intent without being vague or misleading. A teammate scanning the commit history would immediately understand this PR addresses responsive design improvements for mobile devices.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ByteBard11
Copy link
Author

@alessiocappa, I know you where working on a similar fix, are you able to please have a look at this solution and let me know your thoughts.

@alessiocappa
Copy link
Collaborator

@ByteBard11 yes, I tried to fix the spacing to align the amounts in the table, but I was also thinking about adding the categories on the transaction page, so thanks for this big improvement!

I did a quick test, not sure if I did something wrong, but in my case the transaction names are almost unreadable due to the category label:

Screenshot 2025-10-03 alle 23 43 48

The screen is from the Chrome inspect, using an iPhone 12 Pro. I tested it also on my device (iPhone 15) and I see it in the same way.

I think the category takes a bit too much space, especially if the name is too long.
Instead of adding it in this way (the label on the right), I was thinking about adding just the text below the transaction name (similarly to the account name in desktop view) and maybe add the category icon/color on the left, replacing the current icon which is only showing the initial of the transaction name, with no real added value. What do you think?

@ByteBard11 ByteBard11 force-pushed the better-transactions-page branch from cd98ab2 to 66709f5 Compare October 25, 2025 04:09
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66709f5 and 0a30e9b.

📒 Files selected for processing (4)
  • app/views/categories/_badge.html.erb (1 hunks)
  • app/views/categories/_menu.html.erb (1 hunks)
  • app/views/transactions/_transaction.html.erb (5 hunks)
  • app/views/transactions/_transaction_category.html.erb (1 hunks)
🧰 Additional context used
📓 Path-based instructions (15)
app/views/**/*.erb

📄 CodeRabbit inference engine (AGENTS.md)

app/views/**/*.erb: Keep heavy logic out of ERB views; prefer helpers/components instead
ERB templates are linted by erb-lint per .erb_lint.yml

Always use the icon helper (icon) for icons; never call lucide_icon directly

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
app/views/**/*.html.*

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

app/views/**/*.html.*: Use partials only for simple, context-specific, mostly static HTML content.
Prefer semantic HTML; use Turbo Frames where possible instead of client-side solutions.
Use query params for state, not localStorage or sessionStorage.
Always perform server-side formatting for currencies, numbers, and dates.

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
**/*.{html,erb,slim,js,jsx,ts,tsx,css,scss}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Always use functional design tokens (e.g., text-primary, bg-container) from the design system; do not use raw colors or ad-hoc classes.

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
**/app/**/*.erb

📄 CodeRabbit inference engine (CLAUDE.md)

Always use the icon helper for icons in templates; never use lucide_icon directly.

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
**/app/views/**/*.erb

📄 CodeRabbit inference engine (CLAUDE.md)

**/app/views/**/*.erb: Keep domain logic OUT of view templates; logic belongs in component files, not templates.
Use partials only for primarily static, simple HTML with minimal logic, and only when not likely to be reused.
Prefer native HTML over JavaScript components for UI elements (e.g., use <dialog>, <details><summary>).
Leverage Turbo frames for page sections over client-side JavaScript solutions.
Use query params (not localStorage/sessions) for client state management.
Perform server-side formatting for currencies, numbers, and dates in templates.

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
**/app/**/*.{rb,erb,js,css}

📄 CodeRabbit inference engine (CLAUDE.md)

Push Rails to its limits before adding new dependencies; a strong technical/business reason is required for new dependencies.

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
**/*.{rb,erb,haml,slim}

📄 CodeRabbit inference engine (.cursor/rules/general-rules.mdc)

**/*.{rb,erb,haml,slim}: Use Current.user for the current user; do not use current_user
Use Current.family for the current family; do not use current_family
Ignore i18n methods; hardcode strings in English for now (do not use I18n.t, t, or similar)

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
app/views/**/*.html.erb

📄 CodeRabbit inference engine (.cursor/rules/project-conventions.mdc)

app/views/**/*.html.erb: Prefer native HTML elements (e.g., ,

) over JS-based components
Leverage Turbo frames to break up pages instead of JS-driven client-side solutions
Prefer native client-side form validation when possible

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
app/{models,controllers,views}/**/*.{rb,erb}

📄 CodeRabbit inference engine (.cursor/rules/project-conventions.mdc)

Avoid N+1 queries

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
{app/javascript/controllers/**/*.{js,ts},app/views/**/*.erb,app/components/**/*.erb}

📄 CodeRabbit inference engine (.cursor/rules/stimulus_conventions.mdc)

Use declarative Stimulus actions in ERB (data-action) instead of imperative event listeners in controller lifecycle (e.g., avoid addEventListener in connect); controllers should just respond to actions

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
{app/components/**/*.{js,ts,erb},app/views/**/*.erb}

📄 CodeRabbit inference engine (.cursor/rules/stimulus_conventions.mdc)

Component-scoped Stimulus controllers in app/components must be used only within their component views, not in app/views

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
{app/views/**,app/helpers/**,app/javascript/controllers/**}

📄 CodeRabbit inference engine (.cursor/rules/ui-ux-design-guidelines.mdc)

{app/views/**,app/helpers/**,app/javascript/controllers/**}: Style UI using TailwindCSS v4.x with the custom design system defined in app/assets/tailwind/maybe-design-system.css
Always start by referencing app/assets/tailwind/maybe-design-system.css to understand available primitives, functional tokens, and component tokens before styling
Prefer functional tokens from the design system over raw Tailwind values (e.g., use text-primary, bg-container, border border-primary instead of text-white, bg-white, border-gray-200)

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
{app/views/**,app/helpers/**}

📄 CodeRabbit inference engine (.cursor/rules/ui-ux-design-guidelines.mdc)

Always generate semantic HTML

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
{app/views,app/components}/**/*.html.erb

📄 CodeRabbit inference engine (.cursor/rules/view_conventions.mdc)

{app/views,app/components}/**/*.html.erb: Keep domain logic out of ERB templates; compute values in component/controller code and reference them in the template
Integrate Stimulus declaratively in ERB: templates declare data-controller/data-action; controllers respond to those declarations
Pass data from Rails to Stimulus via data-*-value attributes, not inline JavaScript

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
app/views/**/_*.html.erb

📄 CodeRabbit inference engine (.cursor/rules/view_conventions.mdc)

Name partials with a leading underscore (e.g., _trend_change.html.erb, _form_errors.html.erb)

Files:

  • app/views/transactions/_transaction_category.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/categories/_menu.html.erb
🧠 Learnings (1)
📚 Learning: 2025-09-23T22:21:06.637Z
Learnt from: CR
PR: we-promise/sure#0
File: .cursor/rules/project-conventions.mdc:0-0
Timestamp: 2025-09-23T22:21:06.637Z
Learning: Applies to app/views/layouts/application.html.erb : Use Turbo frames in the application layout to load controller actions as demonstrated

Applied to files:

  • app/views/transactions/_transaction.html.erb
🔇 Additional comments (9)
app/views/transactions/_transaction_category.html.erb (1)

7-7: LGTM! Consistent icon_only implementation.

The addition of icon_only: true for non-categorizable transfers is consistent with the broader icon_only pattern being introduced across category badges to improve mobile layouts.

app/views/categories/_menu.html.erb (1)

5-5: LGTM! Icon-only badge for menu button.

Rendering the category badge with icon_only: true inside the menu button is appropriate for a compact, icon-based menu trigger.

app/views/categories/_badge.html.erb (3)

1-1: Good addition of icon_only parameter.

The icon_only local with a default of false provides backward compatibility while enabling the new icon-only display mode.


5-10: Inline styles necessary for dynamic colors.

The inline style attributes using color-mix are necessary for dynamic category colors and cannot be replaced with design system tokens in this case.


14-14: Verify screen reader accessibility for hidden category names.

When icon_only is true, the category name is visually hidden on small screens (hidden sm:inline). While the element remains in the DOM for screen readers, verify that this provides adequate context for users relying on assistive technologies, especially when the icon alone may not convey sufficient meaning.

Consider adding an aria-label attribute to the badge container when icon_only is true to ensure screen readers announce the full category name:

  <span
    class="inline-flex items-center gap-1 text-sm font-medium rounded-full px-2 py-1 border truncate focus-visible:outline-none focus-visible:ring-0 <%= 'min-w-[2.5rem] justify-center' if icon_only %>"
+   <%= "aria-label=\"#{category.name}\"" if icon_only %>
    style="background-color: color-mix(in oklab, <%= category.color %> 10%, transparent);
           border-color: color-mix(in oklab, <%= category.color %> 10%, transparent);
           color: <%= category.color %>;"
  >
app/views/transactions/_transaction.html.erb (4)

20-20: Good fix for truncation behavior.

Changing from max-w-full to min-w-0 w-full correctly enables text truncation in flex/grid containers by overriding the default minimum width behavior.


28-34: Icon size increased for better visibility.

Changing the fallback icon from size: "sm" to size: "md" improves visibility and aligns better with the merchant logo dimensions (w-6 h-6).


98-100: Category rendering for larger screens looks good.

The category is appropriately hidden on small screens and displayed in a right-aligned container on larger screens, providing clear visual hierarchy.


22-26: No N+1 query issue exists—merchant association is already preloaded.

The transactions controller's index method already includes :merchant in the eager-load statement via .includes(:merchant, ...), so accessing transaction.merchant&.logo_url in the view will not trigger additional queries.

Comment on lines +5 to +7
<%= turbo_frame_tag dom_id(entry), class: "contents" do %>
<%= turbo_frame_tag dom_id(transaction),
class: "grid grid-cols-[subgrid] col-span-full items-center gap-x-2 md:gap-x-4 text-primary text-sm font-medium p-4 lg:p-4 #{entry.excluded ? 'opacity-50 text-gray-400' : ''}" do %>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Grid subgrid implementation looks correct.

The use of grid-cols-[subgrid] with col-span-full is appropriate for inheriting the parent grid structure while spanning all columns. Ensure the parent container rendering this partial is configured as a grid.

Verify that the parent container (likely in app/views/transactions/index.html.erb or app/views/entries/_entry_group.html.erb) is properly configured as a CSS grid for the subgrid to work correctly:


🏁 Script executed:

#!/bin/bash
# Search for parent containers that render the transaction partial
rg -A 5 -B 5 'render.*transaction' app/views/transactions/index.html.erb app/views/entries/

Length of output: 1252


I need to see more context around where the transaction partial is actually rendered to verify the parent grid structure is correct.

I need to see the complete grid structure to confirm the transaction partial is properly nested within the grid container.


---

🏁 Script executed:

```shell
#!/bin/bash
# Get more context around the grid and transaction rendering
rg -A 20 'grid grid-cols-\[1fr_auto\]' app/views/transactions/index.html.erb

Length of output: 77





🏁 Script executed:

#!/bin/bash
# Search for the complete grid structure and transaction rendering
rg -n 'grid grid-cols' app/views/transactions/index.html.erb

Length of output: 153


🏁 Script executed:

#!/bin/bash
# Find where transaction partial is rendered
rg -n 'render.*_transaction' app/views/

Length of output: 309





🏁 Script executed:

#!/bin/bash
# Get complete context around the grid at line 61
sed -n '55,85p' app/views/transactions/index.html.erb

Length of output: 1090


🏁 Script executed:

#!/bin/bash
# Search for transaction rendering in entries directory
rg -n 'transaction' app/views/entries/ -t erb

Length of output: 214





🏁 Script executed:

#!/bin/bash
# Find the entries partial
rg -n 'app/views/entries/_entry' app/views/entries/

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check if entry template uses or renders transaction
cat app/views/entries/_entry.html.erb

Length of output: 206



---

🏁 Script executed:

```shell
#!/bin/bash
# Get the complete _transaction.html.erb file
cat app/views/transactions/_transaction.html.erb

Length of output: 4620


Remove grid-cols-[subgrid] and restructure the transaction row layout.

The parent container for transaction items is space-y-4 in app/views/transactions/index.html.erb (line 77), which is a vertical flex stack, not a grid. The grid-cols-[subgrid] at line 6 of _transaction.html.erb cannot work because subgrid only functions when the parent is a grid container with defined grid-template-columns. The header grid (grid-cols-[1fr_auto]) is separate and does not apply to the entries below it.

Either restructure the entries container as a grid matching the header columns, or use a different layout approach for transaction rows that doesn't depend on subgrid.

🤖 Prompt for AI Agents
In app/views/transactions/_transaction.html.erb around lines 5 to 7, the
transaction row is using "grid-cols-[subgrid]" which is invalid because its
parent is a vertical stack (space-y-4) not a grid; remove "grid-cols-[subgrid]"
and restructure the row to not rely on subgrid — either change the row container
to a simple two-column grid like "grid grid-cols-[1fr_auto] items-center ..." to
match the header, or use a flex layout "flex justify-between items-center ..."
(and keep the existing spacing/padding and the conditional opacity class). If
you choose to keep subgrid, instead make the parent a grid with matching
grid-template-columns in the index view so subgrid will work.

Comment on lines +22 to +39
<div class="hidden sm:block flex-shrink-0">
<% if transaction.merchant&.logo_url.present? %>
<%= image_tag transaction.merchant.logo_url,
class: "w-6 h-6 rounded-full",
loading: "lazy" %>
<% else %>
<%= render DS::FilledIcon.new(
variant: :text,
text: entry.name,
size: "md",
rounded: true
) %>
<% end %>
</div>

<div class="sm:hidden flex-shrink-0">
<%= render "transactions/transaction_category", transaction: transaction %>
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Consider alternative layout to address mobile readability concerns.

While the responsive visibility logic is technically correct, this implementation places the category badge horizontally before the transaction name on small screens (lines 37-39), which aligns with the feedback from alessiocappa that "transaction names are almost unreadable due to the category label taking too much space."

Even with icon_only: true, the badge still consumes horizontal space (minimum 2.5rem plus padding from line 6 of _badge.html.erb), leaving limited room for the transaction name in the same flex row on narrow screens.

alessiocappa suggested an alternative: place the category text below the transaction name (similar to how account names appear on desktop) and use a category icon/color indicator on the left. This vertical stacking approach would free up horizontal space for the transaction name.

Consider refactoring the small-screen layout to stack vertically:

<!-- Merchant icon/category indicator on left -->
<div class="flex-shrink-0">
  <% if transaction.merchant&.logo_url.present? %>
    <%= image_tag transaction.merchant.logo_url, class: "w-6 h-6 rounded-full", loading: "lazy" %>
  <% else %>
    <!-- Category color indicator or icon instead of transaction initial -->
    <div class="w-6 h-6 rounded-full flex items-center justify-center" style="background-color: <%= transaction.category&.color %>">
      <%= icon transaction.category&.lucide_icon, size: "sm", color: "white" if transaction.category&.lucide_icon.present? %>
    </div>
  <% end %>
</div>

<!-- Transaction name and category stacked vertically -->
<div class="truncate">
  <div class="space-y-0.5">
    <div class="truncate">
      <%= link_to(...) %> <!-- Transaction name with full width -->
    </div>
    <div class="text-xs text-secondary sm:hidden">
      <%= transaction.category&.name %> <!-- Category name below on mobile -->
    </div>
  </div>
</div>
🤖 Prompt for AI Agents
In app/views/transactions/_transaction.html.erb around lines 22 to 39, the
small-screen layout places the category badge before the transaction name which
consumes horizontal space and makes names hard to read; refactor the mobile
markup so the left-side space shows a compact merchant icon or small category
color/icon indicator, and move the category label to a stacked line below the
transaction name (use a vertical layout: left compact indicator + a truncate
container with the transaction name on top and the category name in smaller text
beneath, only visible on sm:hidden). Ensure classes preserve truncation for the
name, keep merchant logo handling unchanged, replace the badge with a fixed 24px
(w-6 h-6) indicator on mobile, and remove the horizontal badge rendering inside
the same flex row.

@ByteBard11 ByteBard11 marked this pull request as draft October 25, 2025 05:32
@ByteBard11
Copy link
Author

@alessiocappa
Sorry for the delay. Good idea. I've had a go at moving the categories onto the left for small devices.
Let me know your thoughts.

@jjmata jjmata added the mobile/PWA Things that don't render well in small screens (PWA only!) label Oct 28, 2025
@alessiocappa
Copy link
Collaborator

alessiocappa commented Nov 4, 2025

@alessiocappa Sorry for the delay. Good idea. I've had a go at moving the categories onto the left for small devices. Let me know your thoughts.

@ByteBard11, I completely missed this update. 😄

I was also trying to improve the transactions and activities pages, this is what I got:

image

To summarise:

  • I moved the category label as an icon on the left, which can be clicked to modify the category if needed.
  • I experimented with merchant detection using AI, and I noticed that the merchant logo was no longer displayed due to this change. To address this, I reduced the size of the merchant logo and placed it next to the category icon.
  • I also added the category name and merchant name below the transaction name, making it easier to read.
  • I slightly modified the display of transaction names to extend to the maximum available width, ensuring they don’t overlap with the amounts.
  • Lastly, I decided to hide the checkboxes, which I believe are rarely used. Instead, I added a button next to the filter to trigger their visibility. When clicked, the checkboxes are displayed as usual, but they are hidden by default to provide more space.

Please let me know your thoughts. If you’d like to review or test these changes, I can open another pull request.

@jjmata
Copy link
Collaborator

jjmata commented Nov 4, 2025

Thoughts, @DeathCamel58? Since you also have #283 about this same issue ...

@ByteBard11
Copy link
Author

@alessiocappa looks great! Would be happy to test.

Does the overlapping merchant logo cause any touch issues?
I'm thinking it should just open the category menu regardless as I feel this is far more used.

And any ideas how we can handle the automatch transfer button better?

@jjmata
Copy link
Collaborator

jjmata commented Nov 4, 2025

Personally I think stuffing those two logo/category icon together are touch-target nightmares. They solve the visual problem elegantly, but create another (bigger?) one?

@alessiocappa
Copy link
Collaborator

@alessiocappa looks great! Would be happy to test.

Does the overlapping merchant logo cause any touch issues? I'm thinking it should just open the category menu regardless as I feel this is far more used.

And any ideas how we can handle the automatch transfer button better?

I haven’t encountered any touch-related issues due to the merchant logo. If you tap the category icon you’ll see the list of categories and can change it if necessary.

Regarding the automatch transfer, I liked your idea of using a shorter "A/M" label and I’ve implemented it in the same way.

Here’s the branch for testing: https://github.com/alessiocappa/sure/tree/FT-TransactionsPageImprovements

Please let me know if you’d like me to create a pull request or if you’d prefer to integrate the changes into this one. I hope I haven’t missed anything as I’ve had to combine several commits. 😄

border-color: color-mix(in oklab, <%= category.color %> 10%, transparent);
color: <%= category.color %>;">
<span
class="inline-flex items-center gap-1 text-sm font-medium rounded-full px-2 py-1 border truncate focus-visible:outline-none focus-visible:ring-0 <%= 'min-w-[2.5rem] justify-center' if icon_only %>"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably display this as a circle that matches size of the merchant icon. Will help with reducing layout shifting if display size changes (note the transactions for the day having different sizes).

Mobile View Larger Display
image image

<p class="justify-self-end">amount</p>
</div>

<% if @transactions.any? %>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving in this if block causes the second transactions header to render on smaller displays. We should probably just remove this whole block.

image

Comment on lines -60 to 70
<div class="grow overflow-y-auto">
<div class="grid-cols-12 bg-container-inset rounded-xl px-5 py-3 text-xs uppercase font-medium text-secondary items-center mb-4 hidden md:grid">
<div class="pl-0.5 col-span-8 flex items-center gap-4">
<div class="grid grid-cols-[1fr_auto] bg-container-inset rounded-xl px-3 py-3 text-xs uppercase font-medium text-secondary items-center mb-4">
<div class="pl-0.5 flex items-center gap-4">
<%= check_box_tag "selection_entry",
class: "checkbox checkbox--light",
data: { action: "bulk-select#togglePageSelection" } %>
class: "checkbox checkbox--light",
data: { action: "bulk-select#togglePageSelection" } %>
<p>transaction</p>
</div>

<p class="col-span-2">category</p>
<p class="col-span-2 justify-self-end">amount</p>
<p class="justify-self-end">amount</p>
</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we wrap this with a <% if @transactions.any? %> like the one on line 72? That would keep the title bar here from rendering if there aren't any transactions.

data-bulk-select-singular-label-value="<%= t(".transaction") %>"
data-bulk-select-plural-label-value="<%= t(".transactions") %>"
class="flex flex-col bg-container rounded-xl shadow-border-xs p-4">
class="flex flex-col bg-container rounded-xl shadow-border-xs p-4 space-y-4">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably look better without space-y-4, as the bottom margin of the search item is getting large.

Display Type With Without
Mobile image image
Desktop image image

I understand the additional spacing, my two cents is that space-y-4 is a bit large. What do you think?

@jjmata jjmata mentioned this pull request Nov 8, 2025
@jjmata
Copy link
Collaborator

jjmata commented Nov 8, 2025

Don't hate me for taking #283 first, guys. 🙏 Just simpler and a net win while we redesign things a little here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mobile/PWA Things that don't render well in small screens (PWA only!)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants