Skip to content

Conversation

alessiocappa
Copy link

@alessiocappa alessiocappa commented Sep 29, 2025

Update CSS classes in transactions page to properly display amount column on small displays.

Fixes #166

Summary by CodeRabbit

  • Style
    • Improved responsive layout of the amount column in transaction items. On small screens, the column now spans wider for better readability and spacing, reducing truncation/crowding. Large-screen layout remains unchanged, and right-aligned amounts are preserved. No functional or behavioral changes—purely a visual refinement for better mobile usability.

Copy link

coderabbitai bot commented Sep 29, 2025

Walkthrough

Adjusted the responsive grid classes for the amount column in app/views/transactions/_transaction.html.erb, changing the default small-screen span to col-span-4 while preserving lg:col-span-2; no other logic or template changes.

Changes

Cohort / File(s) Change Summary
View layout adjustment
app/views/transactions/_transaction.html.erb
Modified container classes from col-span-2 ml-auto text-right to col-span-4 lg:col-span-2 ml-auto text-right to change small-screen vs. large-screen column spans.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I hopped through grids with sprightly cheer,
Nudged spans from two to four right here—
Small screens stretch, large screens stay,
Align the coins the tidy way.
With twitching nose and CSS delight,
I balanced columns, left to right. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Adjust column width in transaction page for small displays" accurately describes the main change in the changeset. The code modification updates the responsive grid classes for the amount column container in the transactions view, specifically changing from col-span-2 to col-span-4 lg:col-span-2 to increase the column width on small screens. This directly corresponds to adjusting column width for small displays as stated in the title.
Linked Issues Check ✅ Passed Issue #166 reports that transaction amounts overflow or wrap awkwardly on small phones (iPhone 13 mini) and viewports below 577px width, requiring the amount column to fit on a single line without wrapping. The code changes increase the amount column's span from 2 to 4 columns on small screens (while maintaining 2 columns on large screens via lg:col-span-2), which provides more horizontal space for the amount display on small devices. This responsive grid adjustment directly addresses the reported display issue by allocating additional width to prevent text wrapping on narrow viewports, and it accomplishes this using Tailwind CSS classes as requested in the issue description.
Out of Scope Changes Check ✅ Passed All changes in this pull request are directly related to the linked issue #166. The modification updates only the responsive grid classes for the amount column in the transactions view template, which is exactly what's needed to fix the display issue on small phones. No additional features, refactoring, or unrelated changes are present in the changeset. The change is minimal, focused, and stays within the scope of addressing the transaction amount display problem on narrow viewports.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • 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 094f61c and 6b55042.

📒 Files selected for processing (1)
  • app/views/transactions/_transaction.html.erb (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • 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

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
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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

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: 0

🧹 Nitpick comments (1)
app/views/transactions/_transaction.html.erb (1)

96-96: Consider reordering classes to follow mobile-first convention.

The responsive grid adjustment is correct and properly compensates for the hidden category column on small screens. However, the class order lg:col-span-2 col-span-4 is unconventional. Tailwind convention is to place base classes before responsive modifiers.

Apply this diff to follow the conventional ordering:

-      <div class="lg:col-span-2 col-span-4 ml-auto text-right">
+      <div class="col-span-4 lg:col-span-2 ml-auto text-right">
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7273878 and 094f61c.

📒 Files selected for processing (1)
  • app/views/transactions/_transaction.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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

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.

Bug: Transaction amounts on small phones

1 participant