Property comments: timestamped discussion for all roles #180

Open
opened 2026-06-08 04:57:19 +00:00 by ldraney · 0 comments
Owner

Type

Feature

Lineage

Part of Phase 3 (Property Features). Independent of the project/request workflow.

Repo

ldraney/landscaping-assistant

User Story

As any user (admin, lead, member, or client), I want to post comments on a property page with timestamps so the team and client have a shared record of communication about that property.

Context

The property detail page needs a comments section where anyone with access can leave notes. Examples: "Gate code is 1234", "Customer prefers we come before noon", "Sprinkler head broken near front walk — avoid". Comments are timestamped and show the author's name and role. All four roles can read and write comments on properties they have access to.

File Targets

  • db/migrate/*_create_property_comments.rb (new)
  • app/models/property_comment.rb (new)
  • app/models/property.rb (add has_many :property_comments)
  • app/models/crew_member.rb (add has_many :property_comments)
  • app/controllers/property_comments_controller.rb (new — create action)
  • app/views/property_comments/_section.html.erb (new — comment list + form partial)
  • app/views/properties/show.html.erb (render comments partial)
  • app/assets/stylesheets/application.css (add comment styles)
  • config/routes.rb (add property_comments nested under properties)
  • spec/models/property_comment_spec.rb (new)
  • spec/requests/property_comments_spec.rb (new)

Acceptance Criteria

  • PropertyComment model with: property_id (FK), crew_member_id (FK), body (text), created_at
  • Comments section visible on property detail page below the details/actions
  • Any authenticated user can post a comment (text field + submit button)
  • Comments display author name, role badge, timestamp, and body
  • Comments ordered newest-first
  • Empty state when no comments ("No comments yet")
  • Works on mobile (proper spacing, readable text)

Test Expectations

  • spec/models/property_comment_spec.rb: validations, associations
  • spec/requests/property_comments_spec.rb: create, authorization, display on show page
  • Run: bundle exec rspec

Constraints

  • CSS follows ~/ror-css-guide
  • Mobile-first
  • Use Turbo Frames for comment submission (no full page reload)
  • Role badges reuse existing .role-badge-* CSS classes

Feature Flag

None

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • #126 — CSS refresh (property page layout this builds on)
  • #107 — Role-based auth (determines who sees what)
### Type Feature ### Lineage Part of Phase 3 (Property Features). Independent of the project/request workflow. ### Repo `ldraney/landscaping-assistant` ### User Story As any user (admin, lead, member, or client), I want to post comments on a property page with timestamps so the team and client have a shared record of communication about that property. ### Context The property detail page needs a comments section where anyone with access can leave notes. Examples: "Gate code is 1234", "Customer prefers we come before noon", "Sprinkler head broken near front walk — avoid". Comments are timestamped and show the author's name and role. All four roles can read and write comments on properties they have access to. ### File Targets - `db/migrate/*_create_property_comments.rb` (new) - `app/models/property_comment.rb` (new) - `app/models/property.rb` (add has_many :property_comments) - `app/models/crew_member.rb` (add has_many :property_comments) - `app/controllers/property_comments_controller.rb` (new — create action) - `app/views/property_comments/_section.html.erb` (new — comment list + form partial) - `app/views/properties/show.html.erb` (render comments partial) - `app/assets/stylesheets/application.css` (add comment styles) - `config/routes.rb` (add property_comments nested under properties) - `spec/models/property_comment_spec.rb` (new) - `spec/requests/property_comments_spec.rb` (new) ### Acceptance Criteria - [ ] PropertyComment model with: property_id (FK), crew_member_id (FK), body (text), created_at - [ ] Comments section visible on property detail page below the details/actions - [ ] Any authenticated user can post a comment (text field + submit button) - [ ] Comments display author name, role badge, timestamp, and body - [ ] Comments ordered newest-first - [ ] Empty state when no comments ("No comments yet") - [ ] Works on mobile (proper spacing, readable text) ### Test Expectations - `spec/models/property_comment_spec.rb`: validations, associations - `spec/requests/property_comments_spec.rb`: create, authorization, display on show page - Run: `bundle exec rspec` ### Constraints - CSS follows `~/ror-css-guide` - Mobile-first - Use Turbo Frames for comment submission (no full page reload) - Role badges reuse existing `.role-badge-*` CSS classes ### Feature Flag None ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - #126 — CSS refresh (property page layout this builds on) - #107 — Role-based auth (determines who sees what)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/landscaping-assistant#180
No description provided.