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
    • Refined transactions header for a cleaner, simpler layout with improved spacing.
    • Updated transaction rows: clearer alignment, improved readability, and slightly larger icons.
    • Enhanced transfer match badge with responsive label (“Auto-matched” on larger screens, “A/M” on small) and grouped actions.
    • Tweaked category badge styling and entry group spacing for consistency.
    • Reduced vertical spacing in transaction lists and search filters for a denser, more streamlined view.

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.
Copy link

coderabbitai bot commented Oct 3, 2025

Walkthrough

UI/layout updates across several ERB views: padding and display class tweaks for category badges and entry groups; significant restructuring of the transactions partials and index header layout, including turbo frame wrapping, grid adjustments, responsive text for transfer matches, and spacing refinements in the transactions search filters.

Changes

Cohort / File(s) Summary of changes
Category Badge
app/views/categories/_badge.html.erb
Changed outer span classes: flex → inline-flex; padding px-1.5 → px-2. Presentation-only.
Entry Group Layout
app/views/entries/_entry_group.html.erb
Adjusted padding (py-2 px-4 → py-3 px-2); restructured container to grid with specified columns; formatting of checkbox ERB without logic changes.
Transactions Views
app/views/transactions/_transaction.html.erb, app/views/transactions/_transfer_match.html.erb, app/views/transactions/index.html.erb, app/views/transactions/searches/_search.html.erb
- _transaction: Reworked turbo frame nesting and container structure; grid/flex class updates; icon size sm → md; alignment changes; no business logic changes.
- _transfer_match: Replaced single badge with responsive label ("Auto-matched"/"A/M") and grouped action buttons in one container.
- index: Simplified header to inline grid; removed small-screen header row; adjusted spacing and columns; reduced entries spacing (space-y-6 → space-y-4).
- searches/_search: Removed mb-4 on filters list.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Page as Transactions Index View
  participant Frame as Turbo Frames
  participant UI as UI Components

  User->>Page: Load /transactions
  Page->>Frame: Render entry frame and nested transaction frame
  Frame->>UI: Display responsive header and rows
  UI-->>User: Show updated layout (grid, badges, amounts)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Poem

A bunny taps CSS with gentle paws,
Nudging grids and spans to softer laws.
Turbo frames nest, icons grow—hooray!
Headers slim down, clutter hops away.
With px and py set just right,
The ledger looks delightfully light. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and concisely summarizes the main change by focusing on improving the transactions page for smaller screens, which directly aligns with the PR objectives around mobile usability. It avoids extraneous details and is specific enough to inform a teammate of the primary update at a glance.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

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

📒 Files selected for processing (6)
  • app/views/categories/_badge.html.erb (1 hunks)
  • app/views/entries/_entry_group.html.erb (2 hunks)
  • app/views/transactions/_transaction.html.erb (6 hunks)
  • app/views/transactions/_transfer_match.html.erb (2 hunks)
  • app/views/transactions/index.html.erb (1 hunks)
  • app/views/transactions/searches/_search.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/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.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/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.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/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.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/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.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/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.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/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.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/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.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/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.html.erb
app/{models,controllers,views}/**/*.{rb,erb}

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

Avoid N+1 queries

Files:

  • app/views/transactions/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.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/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.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/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.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/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.html.erb
{app/views/**,app/helpers/**}

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

Always generate semantic HTML

Files:

  • app/views/transactions/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.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/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/transactions/index.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.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/searches/_search.html.erb
  • app/views/categories/_badge.html.erb
  • app/views/entries/_entry_group.html.erb
  • app/views/transactions/_transaction.html.erb
  • app/views/transactions/_transfer_match.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
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: ci / test
🔇 Additional comments (18)
app/views/transactions/searches/_search.html.erb (1)

3-3: LGTM! Spacing reduction aligns with mobile optimization.

Removing mb-4 from the filter list reduces vertical spacing between the search bar and transactions, which improves screen real estate usage on smaller devices as intended by the PR.

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

5-5: LGTM! Badge layout refinement improves consistency.

Changing from flex to inline-flex with adjusted padding (px-2 instead of px-1.5) creates a more consistent inline badge appearance that better integrates with surrounding text and layout elements.

app/views/entries/_entry_group.html.erb (3)

4-4: LGTM! Padding adjustment improves mobile spacing.

Changing from py-2 px-4 to py-3 px-2 reduces horizontal padding while slightly increasing vertical padding, creating a more balanced appearance on smaller screens with tighter horizontal constraints.


6-9: LGTM! Checkbox positioning improves visual hierarchy.

The adjusted indentation and formatting of the checkbox better conveys hierarchy by positioning it further left, aligning with the PR's goal of making visually "heavier" checkboxes appear at the start of the row.


24-24: LGTM! Dynamic grid replaces fixed columns.

Replacing grid-cols-12 with grid-cols-[minmax(0,1fr)_auto] allows column widths to adapt to content dynamically, directly addressing the PR's goal of fixing spacing issues by removing fixed column counts.

app/views/transactions/_transfer_match.html.erb (2)

9-12: LGTM! Responsive badge text saves space on small screens.

The responsive text implementation displays "Auto-matched" on small screens and above, while showing the abbreviated "A/M" on extra-small screens. This directly addresses the PR's goal of preserving space for transaction names on smaller devices.


9-28: LGTM! Badge and buttons grouped in unified container.

Wrapping the badge text and action buttons (confirm/reject) within a single <span> container creates better visual cohesion and maintains logical grouping of related controls.

app/views/transactions/index.html.erb (4)

61-61: LGTM! Simplified header grid improves mobile layout.

Replacing the complex responsive grid with a straightforward grid-cols-[1fr_auto] layout makes the header more predictable across screen sizes. The reduced horizontal padding (px-3 instead of px-5) improves space efficiency on smaller screens.


62-67: LGTM! Header left section layout refinement.

Changing from col-span-8 to flex items-center gap-4 provides explicit control over the checkbox and label alignment, creating more consistent spacing and better visual hierarchy.


69-69: LGTM! Consolidated amount column.

Using a single amount column with justify-self-end simplifies the grid structure while maintaining proper right-alignment, supporting the PR's goal of streamlined layouts.


72-72: LGTM! Reduced vertical spacing improves density.

Changing from space-y-6 to space-y-4 reduces vertical gaps between entry groups, making better use of available screen real estate on smaller devices as intended by the PR.

app/views/transactions/_transaction.html.erb (7)

5-7: LGTM! Nested turbo frame structure with proper grid integration.

Adding class="contents" to the outer frame and grid-cols-[subgrid] col-span-full to the inner frame allows proper grid alignment with the parent container. The conditional opacity for excluded entries is preserved correctly.


9-10: LGTM! Contents wrapper enables proper flex behavior.

The intermediate "contents" wrapper and flex container with min-w-0 properly constrains child elements, enabling text truncation to work correctly when transaction names are long.


20-20: LGTM! Width constraints prevent overflow.

Changing from max-w-full to min-w-0 w-full ensures the container can shrink below its content size, which is essential for proper text truncation in flex layouts.


43-46: LGTM! Improved data hash formatting.

The consistent indentation and trailing commas in the link_to data hashes improve readability without changing functionality.

Also applies to: 53-56


92-94: LGTM! Category always visible as intended.

Moving the category rendering to a flex container positioned at the end ensures categories are always visible across all screen sizes, directly addressing one of the PR's stated goals.


97-101: LGTM! Amount display properly aligned.

The text-right container maintains proper right-alignment of the amount while preserving the conditional rendering logic for transfers vs. regular transactions.


30-30: Manually verify updated icon size matches row height and merchant logos
Confirm that the DS::FilledIcon now set to "md" in the transaction row fills its height correctly and maintains visual balance with adjacent merchant logos.


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

@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?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants