Person icon: route to My Profile / My Property views instead of root #137

Closed
opened 2026-06-07 01:29:23 +00:00 by ldraney · 2 comments
Owner

Type

Feature

Lineage

Discovered during PR #136 review (implements #107). The Person icon was given a placeholder root_path link because the destination views don't exist yet.

Repo

ldraney/landscaping-assistant

User Story

As a logged-in user
I want the Person icon to open my profile and property views
So that I can manage my account settings and (if super admin) access platform settings

Context

PR #136 added the 5-slot role-based bottom nav with Person always centered in slot 3. Currently Person links to root_path (work_queue_items#index) — the same destination as the Today tab.

PR #144 (#130) already added the Platform sub-nav under Person for super_admin — a gear icon linking to /platform/feature_flags (lines 69-74 of application.html.erb). That stays. This ticket adds the Person landing page itself.

Current auth state: current_user is a session hash with :username, :email, :roles keys. Use current_user_has_role?() for role checks — there is no ActiveRecord User model.

Person views per docs/user-stories-auth.md:

  • My Profile — all users: username, email, role display. Placeholder crew join request form (two fields: business name + notes).
  • My Property — client role only: placeholder for property view (full implementation is #123).
  • Platform — super_admin only: already exists at /platform/feature_flags (PR #144). Just needs a link from the Person page.

File Targets

Files to create:

  • app/controllers/person_controller.rb — index action showing profile/property/platform sections
  • app/views/person/index.html.erb — Person landing page with role-conditional sections
  • spec/requests/person_spec.rb — route and role visibility specs

Files to modify:

  • app/views/layouts/application.html.erb — update Person icon link from root_path to person_index_path (line 64)
  • config/routes.rb — add resources :person, only: [:index]
  • app/assets/stylesheets/application.css — Person view styles (per ~/ror-css-guide)

Files NOT to touch:

  • app/controllers/platform/feature_flags_controller.rb — already exists and working
  • app/views/platform/feature_flags/index.html.erb — already exists
  • app/controllers/sessions_controller.rb — auth flow is settled
  • app/controllers/application_controller.rb — role helpers already in place

Acceptance Criteria

  • Person icon navigates to /person, not root_path
  • My Profile section shows current_user[:username], current_user[:email], and roles
  • Placeholder crew join form visible to all users (two fields: business name, notes — non-functional for now)
  • My Property placeholder visible only to client role
  • Platform link visible only to super_admin, links to existing /platform/feature_flags
  • Person page accessible to all authenticated users (all 5 roles)
  • Dev mode (no Keycloak) graceful degradation — page renders without crashing

Out of Scope

  • Full My Property client flow (#123)
  • Crew join request backend processing
  • Profile editing (no User model to edit)
  • Platform admin features beyond feature flags

Test Expectations

  • Request spec: all 5 roles can access /person
  • Request spec: super_admin sees Platform link
  • Request spec: non-super_admin does not see Platform link
  • Request spec: client sees My Property section
  • Request spec: non-client does not see My Property section
  • Request spec: unauthenticated gets 302 to Keycloak when configured
  • Run: bundle exec rspec spec/requests/person_spec.rb

Constraints

  • CSS must follow ~/ror-css-guide (design tokens, component comments, no Tailwind, no inline styles)
  • No !important, no #id selectors in CSS
  • current_user is a session hash, NOT ActiveRecord
  • Person is always slot 3 in nav — only the link target changes, not the nav structure
  • The existing Platform sub-nav (gear icon, lines 69-74 of layout) should remain as-is

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • #107 / PR #136 — created 5-slot nav with Person placeholder
  • #130 / PR #144 — Platform feature flags UI (already under Person)
  • #117 — Crew tab (sibling phase:2 work)
  • #123 — Client request UI (My Property detail, future scope)
  • docs/user-stories-auth.md — Person icon views spec
### Type Feature ### Lineage Discovered during PR #136 review (implements #107). The Person icon was given a placeholder `root_path` link because the destination views don't exist yet. ### Repo `ldraney/landscaping-assistant` ### User Story As a logged-in user I want the Person icon to open my profile and property views So that I can manage my account settings and (if super admin) access platform settings ### Context PR #136 added the 5-slot role-based bottom nav with Person always centered in slot 3. Currently Person links to `root_path` (work_queue_items#index) — the same destination as the Today tab. PR #144 (#130) already added the Platform sub-nav under Person for super_admin — a gear icon linking to `/platform/feature_flags` (lines 69-74 of application.html.erb). That stays. This ticket adds the Person landing page itself. **Current auth state:** `current_user` is a session hash with `:username`, `:email`, `:roles` keys. Use `current_user_has_role?()` for role checks — there is no ActiveRecord User model. **Person views per `docs/user-stories-auth.md`:** - **My Profile** — all users: username, email, role display. Placeholder crew join request form (two fields: business name + notes). - **My Property** — client role only: placeholder for property view (full implementation is #123). - **Platform** — super_admin only: already exists at `/platform/feature_flags` (PR #144). Just needs a link from the Person page. ### File Targets Files to create: - `app/controllers/person_controller.rb` — index action showing profile/property/platform sections - `app/views/person/index.html.erb` — Person landing page with role-conditional sections - `spec/requests/person_spec.rb` — route and role visibility specs Files to modify: - `app/views/layouts/application.html.erb` — update Person icon link from `root_path` to `person_index_path` (line 64) - `config/routes.rb` — add `resources :person, only: [:index]` - `app/assets/stylesheets/application.css` — Person view styles (per ~/ror-css-guide) Files NOT to touch: - `app/controllers/platform/feature_flags_controller.rb` — already exists and working - `app/views/platform/feature_flags/index.html.erb` — already exists - `app/controllers/sessions_controller.rb` — auth flow is settled - `app/controllers/application_controller.rb` — role helpers already in place ### Acceptance Criteria - [ ] Person icon navigates to `/person`, not root_path - [ ] My Profile section shows current_user[:username], current_user[:email], and roles - [ ] Placeholder crew join form visible to all users (two fields: business name, notes — non-functional for now) - [ ] My Property placeholder visible only to client role - [ ] Platform link visible only to super_admin, links to existing `/platform/feature_flags` - [ ] Person page accessible to all authenticated users (all 5 roles) - [ ] Dev mode (no Keycloak) graceful degradation — page renders without crashing ### Out of Scope - Full My Property client flow (#123) - Crew join request backend processing - Profile editing (no User model to edit) - Platform admin features beyond feature flags ### Test Expectations - [ ] Request spec: all 5 roles can access /person - [ ] Request spec: super_admin sees Platform link - [ ] Request spec: non-super_admin does not see Platform link - [ ] Request spec: client sees My Property section - [ ] Request spec: non-client does not see My Property section - [ ] Request spec: unauthenticated gets 302 to Keycloak when configured - Run: `bundle exec rspec spec/requests/person_spec.rb` ### Constraints - CSS must follow `~/ror-css-guide` (design tokens, component comments, no Tailwind, no inline styles) - No `!important`, no `#id` selectors in CSS - `current_user` is a session hash, NOT ActiveRecord - Person is always slot 3 in nav — only the link target changes, not the nav structure - The existing Platform sub-nav (gear icon, lines 69-74 of layout) should remain as-is ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - #107 / PR #136 — created 5-slot nav with Person placeholder - #130 / PR #144 — Platform feature flags UI (already under Person) - #117 — Crew tab (sibling phase:2 work) - #123 — Client request UI (My Property detail, future scope) - `docs/user-stories-auth.md` — Person icon views spec
Author
Owner

Issue body rewritten to reflect current codebase state:

  1. #130/PR #144 is DONE — Platform sub-nav already exists under Person (lines 69-74 of layout). This ticket just adds the Person landing page and links to existing Platform route.
  2. Added explicit "Files NOT to touch" section (platform controller/views already exist)
  3. Added current_user session hash context note
  4. Separated My Property placeholder (client only) from My Profile (all users)
  5. Added Out of Scope section
  6. Fixed test expectations to cover all 5 roles
  7. Added constraint about preserving existing Platform sub-nav gear icon
**Issue body rewritten to reflect current codebase state:** 1. #130/PR #144 is DONE — Platform sub-nav already exists under Person (lines 69-74 of layout). This ticket just adds the Person landing page and links to existing Platform route. 2. Added explicit "Files NOT to touch" section (platform controller/views already exist) 3. Added current_user session hash context note 4. Separated My Property placeholder (client only) from My Profile (all users) 5. Added Out of Scope section 6. Fixed test expectations to cover all 5 roles 7. Added constraint about preserving existing Platform sub-nav gear icon
Author
Owner

Scope Review: READY

Review note: review-1363-2026-06-06
Ticket is well-scoped with all template sections complete, all file targets verified, and no blockers. Dependencies (#107, #130) are done. 6 file targets in a single repo, 7 AC -- fits within a single agent pass.

Two known systemic gaps (missing story:auth user story entry, missing arch-rails-app note) are deferred and not blocking.

## Scope Review: READY Review note: `review-1363-2026-06-06` Ticket is well-scoped with all template sections complete, all file targets verified, and no blockers. Dependencies (#107, #130) are done. 6 file targets in a single repo, 7 AC -- fits within a single agent pass. Two known systemic gaps (missing story:auth user story entry, missing arch-rails-app note) are deferred and not blocking.
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#137
No description provided.