Property detail page CSS refresh #177
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "126-property-detail-css-refresh"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
btn-linkCSS classChanges
app/views/properties/show.html.erb: h1 now rendersclient_name; address line + city/state/zip shown as subtitle; client name removed from definition list; "Go to Location" renamed to "Directions" withbtn btn-outline; "Edit" upgraded frombtn-linktobtn btn-outline; secondary buttons wrapped indetail-actions-secondarydivapp/assets/stylesheets/application.css:detail-actionsswitched from flex to grid; addeddetail-actions-secondaryflex row; removed deadbtn-linkclassspec/requests/properties_spec.rb: updated show page spec to assert client_name renders as h1 headingTest Plan
Review Checklist
Related Notes
landscaping-assistant-- landscaping assistant projectQA Review -- PR #177
Scope: 3 files, +18/-24. CSS and view-only changes with spec update.
View (
show.html.erb)address_line.presence || client_nametoclient_name-- client name is the stable identifierbtn btn-outline-- consistent stylingdetail-actions-secondarywrapper provides clean structural groupingCSS (
application.css)detail-actionsswitched from flex to grid with--spacing-smgap -- uses existing design tokensdetail-actions-secondaryas flex row withflex: 1on child buttons -- equal-width, cleanbtn-linkclass removed -- no remaining references in codebaseSpec (
properties_spec.rb)include("Test Client")toinclude("<h1>Test Client</h1>")-- validates the structural change, not just content presenceFindings
No issues found. The diff is focused, uses existing design tokens, introduces no secrets or unrelated changes.
VERDICT: APPROVE
PR #177 Review
DOMAIN REVIEW
Tech stack: Ruby on Rails (ERB views), vanilla CSS with design tokens, RSpec request specs.
ERB Correctness (show.html.erb)
h1 change is safe.
Propertymodel hasvalidates :client_name, presence: true(line 11 ofapp/models/property.rb), so@property.client_namewill never be nil/blank. The old fallback (address_line.presence || client_name) is correctly removed.Subtitle line is correct. The
address_lineconditional on line 3-6 now renders the full address (address_line — city, state zip) when present, or "No address yet" otherwise. The—entity is valid HTML. All closing tags match.Client name removed from
<dl>without regression. The<dt>Client</dt>/<dd>pair was redundant onceclient_namebecame the h1. No other view references the client row in the definition list.Secondary actions nesting is correct. The
detail-actions-secondarydiv is properly nested insidedetail-actions, and bothlink_tocalls correctly useclass: "btn btn-outline". Theif @property.maps_urlconditional is preserved. All ERB tags balance.CSS Consistency (application.css)
btn-outlineexists at line 1123-1131. It uses design tokens:var(--color-surface),var(--color-accent),var(--color-accent-light). No hardcoded values. This class is already used inuploads/show.html.erbfor the "Edit Caption" button, confirming it is the project's standard outline button pattern.detail-actionsgrid change is sound. Switching fromdisplay: flextodisplay: gridwithgap: var(--spacing-sm)creates a single-column stack: the "Update Address" button on one row, thedetail-actions-secondaryflex row below it. This is a clean mobile-first layout.detail-actions-secondaryuses design tokens only.display: flex,gap: var(--spacing-sm), and.btn { flex: 1 }-- all good. Theflex: 1ensures "Directions" and "Edit" split the row evenly.Dead
btn-linkremoval is safe. I verified every view file:btn-linkwas ONLY used inshow.html.erb(the two links being replaced). No other view, partial, or JS file references it. Clean removal.Mobile Layout Analysis
The layout works on small screens. Key reasoning:
.app-shellconstrains tomax-width: 30remwith auto margins andpadding: var(--spacing-md)-- already mobile-first..detail-actionsisdisplay: grid(single-column by default) so the "Update Address" button stacks above the secondary row..detail-actions-secondaryisdisplay: flexwithflex: 1on children -- "Directions" and "Edit" will share the row equally. On very narrow screens (under 375px), these will shrink proportionally sinceflex: 1allows shrinking. At 375px minus padding (~343px usable), two buttons at ~170px each is comfortable..btnbase class haswidth: 100%andpadding: var(--spacing-md)withfont-size: 1.2rem-- good touch targets for mobile.Regression Check
No regressions:
btn-linkwas only inshow.html.erb-- confirmed by readingmanage.html.erb,edit.html.erb,index.html.erb,uploads/show.html.erb, andprofile/index.html.erb.detail-actions .btn { width: auto; flex: none; }rule is correctly removed sincedetail-actionsis now grid (not flex), and the children that need flex behavior are indetail-actions-secondary.Test Coverage (spec/requests/properties_spec.rb)
The spec change at line 57-59 is appropriate:
expect(response.body).to include("Test Client")-- too loose, would pass even if client_name appeared in a<dd>or elsewhere.expect(response.body).to include("<h1>Test Client</h1>")-- verifies client_name renders as the page heading specifically.The address assertion at line 53-54 (
include("123 Test St")) still passes because the address now appears in the subtitle<p>tag.BLOCKERS
None.
NITS
Consider testing the subtitle format. The spec asserts
"123 Test St"appears somewhere, but does not verify the newaddress_line — city, state zipformat. A spec likeexpect(response.body).to include("123 Test St —")or matching the subtitle<p>would catch layout regressions. Non-blocking since the current test still validates address presence.detail-actions-secondaryremoved the old.detail-actions .btnrule which hadwidth: auto; flex: none;. The "Update Address" button (direct child of.detail-actions, not insidedetail-actions-secondary) now inherits.btn { width: 100% }from the base class, which is correct for grid layout (full-width primary action). Just noting this is intentional and correct.SOP COMPLIANCE
126-property-detail-css-refreshmatches issue #126Closes #126PROCESS OBSERVATIONS
uploads/show.html.erb, improving consistency across the app.VERDICT: APPROVED