Profile UX rework: inline property toggle, owner_sub, section reorder #171

Closed
opened 2026-06-08 01:35:44 +00:00 by ldraney · 0 comments
Owner

Type

Feature

Lineage

Standalone — discovered during live-use session observing Profile page UX issues.

Repo

ldraney/landscaping-assistant

User Story

As a client
I want an inline toggle on my Profile page to activate/deactivate my property
So that I can manage my property status without navigating away

Context

The Profile page (renamed from Person in PR #169) had My Property at the bottom, used owner_username for linkage (fragile — usernames can change), and required navigating to a separate page to create a property. Real-use testing showed: (1) property should be the top section since it's the primary action for clients, (2) a toggle switch is more intuitive than a separate creation page, (3) Keycloak sub UUID is the correct stable identifier.

File Targets

Files modified:

  • app/controllers/sessions_controller.rb -- store sub in session
  • app/controllers/profile_controller.rb -- look up by owner_sub
  • app/controllers/properties_controller.rb -- owner_sub linkage, redirect to profile
  • app/models/property.rb -- owned_by scope uses owner_sub
  • app/views/profile/index.html.erb -- reorder sections, inline toggle + form
  • app/assets/stylesheets/application.css -- toggle switch, property card styles
  • app/javascript/controllers/property_toggle_controller.js -- Stimulus toggle
  • db/migrate/20260608012402_rename_owner_username_to_owner_sub.rb
  • spec/requests/profile_spec.rb -- update assertions

Feature Flag

none — this is a UX restructure of an existing page, not a new workflow.

Acceptance Criteria

  • Toggle switch shows/hides property form for new users (no property)
  • Toggle deactivates/reactivates existing property via toggle_active
  • Property linked by Keycloak sub (UUID), not username
  • Profile page order: My Property → My Information → Join a Crew → Platform
  • "My Profile" renamed to "My Information"
  • Any logged-in user can create and own a property
  • Create/toggle_active redirect back to profile when called from profile
  • All 227 specs pass

Test Expectations

  • Profile spec: "My Information" section visible to all roles
  • Profile spec: "My Property" section visible to all roles
  • Profile spec: Platform section still super_admin only
  • Run command: bin/rails spec

Constraints

  • Follow existing Stimulus controller patterns (importmap eager loading)
  • Use existing toggle_active action for deactivation (no new endpoints)
  • Maintain graceful degradation in dev mode (no Keycloak)

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-landscaping-assistant — main project
### Type Feature ### Lineage Standalone — discovered during live-use session observing Profile page UX issues. ### Repo `ldraney/landscaping-assistant` ### User Story As a client I want an inline toggle on my Profile page to activate/deactivate my property So that I can manage my property status without navigating away ### Context The Profile page (renamed from Person in PR #169) had My Property at the bottom, used `owner_username` for linkage (fragile — usernames can change), and required navigating to a separate page to create a property. Real-use testing showed: (1) property should be the top section since it's the primary action for clients, (2) a toggle switch is more intuitive than a separate creation page, (3) Keycloak `sub` UUID is the correct stable identifier. ### File Targets Files modified: - `app/controllers/sessions_controller.rb` -- store `sub` in session - `app/controllers/profile_controller.rb` -- look up by owner_sub - `app/controllers/properties_controller.rb` -- owner_sub linkage, redirect to profile - `app/models/property.rb` -- owned_by scope uses owner_sub - `app/views/profile/index.html.erb` -- reorder sections, inline toggle + form - `app/assets/stylesheets/application.css` -- toggle switch, property card styles - `app/javascript/controllers/property_toggle_controller.js` -- Stimulus toggle - `db/migrate/20260608012402_rename_owner_username_to_owner_sub.rb` - `spec/requests/profile_spec.rb` -- update assertions ### Feature Flag none — this is a UX restructure of an existing page, not a new workflow. ### Acceptance Criteria - [ ] Toggle switch shows/hides property form for new users (no property) - [ ] Toggle deactivates/reactivates existing property via toggle_active - [ ] Property linked by Keycloak sub (UUID), not username - [ ] Profile page order: My Property → My Information → Join a Crew → Platform - [ ] "My Profile" renamed to "My Information" - [ ] Any logged-in user can create and own a property - [ ] Create/toggle_active redirect back to profile when called from profile - [ ] All 227 specs pass ### Test Expectations - [ ] Profile spec: "My Information" section visible to all roles - [ ] Profile spec: "My Property" section visible to all roles - [ ] Profile spec: Platform section still super_admin only - Run command: `bin/rails spec` ### Constraints - Follow existing Stimulus controller patterns (importmap eager loading) - Use existing toggle_active action for deactivation (no new endpoints) - Maintain graceful degradation in dev mode (no Keycloak) ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-landscaping-assistant` — main project
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#171
No description provided.