feat: add edit dialogs for units and leases#69
Conversation
- Add useUpdateUnit and useUpdateLease mutation hooks with proper cache invalidation (units, financials, rent-roll, leases) - Create EditUnitDialog mirroring AddUnitDialog pattern with useEffect re-seed on open - Create EditLeaseDialog with status field (active/expired/terminated) - Wire edit buttons into PropertyDetail overview tab: pencil icon per unit row, clickable tenant name opens lease editor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@coderabbitai review Please evaluate:
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds editing capabilities for property units and leases by introducing two modal dialog components ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
chittyfinance | 3f8b6fa | Mar 26 2026, 05:06 AM |
Code Review — PR #69: Edit dialogs for units and leasesOverall this is clean, well-structured work that follows the existing patterns in the codebase. The cache invalidation strategy is correct and complete. A few issues worth addressing before merge: Bug: No date range validation in
|
There was a problem hiding this comment.
Pull request overview
Adds frontend editing capabilities for property units and leases, completing the UI CRUD flow by introducing edit dialogs and update mutation hooks with cache invalidation so overview/rent-roll/financial metrics stay in sync.
Changes:
- Added
useUpdateUnitanduseUpdateLeasemutation hooks with targeted query invalidation. - Introduced
EditUnitDialogandEditLeaseDialogcomponents to edit unit/lease fields. - Wired edit entry points into
PropertyDetailoverview (unit row pencil icon; tenant name opens lease editor).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| client/src/pages/PropertyDetail.tsx | Adds edit entry points in the Units table and mounts the new edit dialogs. |
| client/src/hooks/use-property.ts | Adds update mutation hooks for units and leases with cache invalidation. |
| client/src/components/property/EditUnitDialog.tsx | New dialog UI for updating unit details via PATCH. |
| client/src/components/property/EditLeaseDialog.tsx | New dialog UI for updating lease terms/status via PATCH. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </Badge> | ||
| </TableCell> | ||
| <TableCell> | ||
| <Button variant="ghost" size="icon" className="h-7 w-7" |
There was a problem hiding this comment.
Icon-only edit button (Pencil) has no accessible name. Add an aria-label (e.g. "Edit unit") or include a visually-hidden <span className="sr-only">Edit unit</span> inside the button so screen readers can identify the action.
| <Button variant="ghost" size="icon" className="h-7 w-7" | |
| <Button | |
| variant="ghost" | |
| size="icon" | |
| className="h-7 w-7" | |
| aria-label="Edit unit" |
| <TableHead className="text-right">Rent</TableHead> | ||
| <TableHead>Tenant</TableHead> | ||
| <TableHead>Status</TableHead> | ||
| <TableHead className="w-[70px]"></TableHead> |
There was a problem hiding this comment.
The new actions column header is empty. For accessibility, add a label (can be visually hidden with sr-only) so screen readers can announce the column purpose (e.g. "Actions").
| <TableHead className="w-[70px]"></TableHead> | |
| <TableHead className="w-[70px]"> | |
| <span className="sr-only">Actions</span> | |
| </TableHead> |
Summary
useUpdateUnitanduseUpdateLeasemutation hooks with cache invalidation for units, financials, and rent-rollEditUnitDialog— edit unit number, bed/bath, sqft, monthly rentEditLeaseDialog— edit tenant info, dates, rent, status (active/expired/terminated)Context
Backend PATCH endpoints for units and leases already exist but had no frontend counterparts. This closes the CRUD gap for the property management UI.
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes