← Back to Pull requests

feat(mobile): edit rating, notes, quantity and purchase details on the detail screen (#109) #436

Closed
unknown closed this pull request without merging on Oct 23, 2026 06:02 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 05:50 UTC
Author

Summary


  • New Edit details sheet on the Expo polish detail screen (components/edit-details-sheet.tsx, pure helpers in lib/polish-edit.ts): rating stars, notes, bottles (owned only, stepper 1-99; zero stays with the Archive action), purchase price (locale-safe parsing: 12.50, 12,50, 1.234,56, 1,234.56), currency chips (saved currency, else last used, else device locale, else USD), purchase date (validated YYYY-MM-DD + Today button; no date-picker dependency in the project).

  • Save is optimistic with rollback: the detail updates at once, a failure restores the polish, shows an error banner and reopens the sheet with the draft. Only changed fields are sent. Success drops the inventory caches and notifies the Collection to refetch.

  • Detail shows a My details card (stars, "Paid $12.00 · 2026-03-04", notes) for any polish in the user's inventory.

  • Field, FormInput, StarRating, QuantityStepper extracted to components/polish-form-fields.tsx and reused by the manual add form.

  • Docs: mobile README detail row, one clause in CLAUDE.md.
  • Test plan


  • npm run test --workspace=apps/mobile: 194 pass (18 new in polish-edit.test.ts)

  • root build / lint (0 errors) / typecheck; mobile lint + typecheck

  • npx expo export --platform ios

  • Manual walk on a simulator not done overnight
  • Decisions needed


    1. Brand/name/finishes/color are read-only for every shade. The polish response carries no flag saying the shade is the caller's own private user_submitted shade (the API computes ownSubmitted internally), and changing brand/name by id would re-resolve to another shade. Proposed follow-up: expose an ownSubmitted boolean on Polish, then reuse the manual add fields in the sheet.
    2. A saved rating or purchase date can be changed but not removed. upsertInventoryItem treats a missing/null rating/purchaseDate as unchanged (and the DB CHECK forbids rating 0). The sheet blocks clearing them with a message; an unrated polish can still clear a star before saving. Proposed follow-up: let the API accept null for both.
    3. Price clears together with its currency (null/null); notes clear with an empty string.
    4. Date entry is typed YYYY-MM-DD (no dependency-free native picker in SDK 57).

    Refs #109

    🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Added an Edit details sheet for polishes with a status. Update ratings, notes, bottle count for owned polishes, and purchase price, currency, and date. Catalog details remain read-only.
    Polish detail screens now show saved ratings, purchase details, and notes, or an empty state when none are available.
    Changes save optimistically; failed updates restore the previous details and let you retry with your draft.

    Documentation
    Updated mobile app documentation to describe the edit-details experience.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 388 lines (+291 / -97) across 4 files Reviewer: mattmck Review duration: 11m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.43) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 388 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.357
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #436"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.1% (MEDIUM) · Higher = larger blast radius
    43.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.6% · Safe to merge
    18.6%