Skip to content

feat: PWA support, asset editing, reservations UI, and depreciation charts - #1367

Merged
yusuftomilola merged 2 commits into
DistinctCodes:mainfrom
Fahmedo:feature/pwa-editing-reservations-depreciation
Aug 26, 2026
Merged

feat: PWA support, asset editing, reservations UI, and depreciation charts#1367
yusuftomilola merged 2 commits into
DistinctCodes:mainfrom
Fahmedo:feature/pwa-editing-reservations-depreciation

Conversation

@Fahmedo

@Fahmedo Fahmedo commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR implements PWA support, asset editing improvements, reservations UI, and depreciation charts.

Changes

[FE-20] PWA Support and QR Scanning

  • Web manifest (/manifest.json) with app name, icons, theme color
  • Service worker (/sw.js) with cache-first for app shell, network-first for API
  • QRScanner component with camera BarcodeDetector API + manual entry fallback
  • Camera permission denial handled gracefully with manual mode

[FE-21] Asset Editing

  • InlineEdit component for quick-editing fields directly on the detail page
  • Inline edits for condition, current value with save-on-Enter, cancel-on-Escape
  • Existing EditAssetModal for full asset editing with all fields
  • Optimistic updates with rollback on error

[FE-22] Reservations UI

  • New /reservations page with My Reservations and Pending Confirmation tabs
  • Booking modal with asset ID, purpose, date/time pickers
  • Confirm/reject actions for managers, cancel for requesters
  • Status badges with color coding

[FE-23] Depreciation Charts

  • DepreciationSchedule component with book-value-over-time bar chart
  • Expandable period table showing opening, depreciation, closing values
  • Financial stats cards (purchase cost, current value, salvage value)
  • DepreciationFinancialsTab for reports with category breakdown bars

Verification

  • PWA manifest validates correctly
  • Service worker registered and caching app shell
  • Inline edits save on Enter and cancel on Escape
  • Depreciation chart values match schedule table

Closes #1108
Closes #1109
Closes #1110
Closes #1111

- FE-20: PWA support with web manifest, service worker (cache-first for app
  shell, network-first for API), and installability. QR scanner component
  with camera BarcodeDetector API + manual entry fallback
- FE-21: Asset editing with existing edit modal plus new InlineEdit component
  for quick-editing condition, current value, and location directly on the
  detail page with optimistic save/cancel
- FE-22: Reservations page with My Reservations and Pending Confirmation tabs,
  booking modal with date/time picker, confirm/cancel actions, status badges
- FE-23: Depreciation schedule component with book-value-over-time bar chart,
  expandable period table, financial stats cards, and category breakdown;
  DepreciationFinancialsTab for the reports page

Closes DistinctCodes#1108
Closes DistinctCodes#1109
Closes DistinctCodes#1110
Closes DistinctCodes#1111
@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

@Fahmedo is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@Fahmedo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@yusuftomilola yusuftomilola left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. Good work:

  • QR scanner: real camera access via getUserMedia with BarcodeDetector API when available, graceful fallback to manual ID entry on camera-denied or unsupported browsers, parses the scanned URL to extract the asset ID.
  • PWA: manifest + service worker with a sensible network-first-for-API / cache-first-for-shell strategy.
  • Depreciation chart component looks solid (didn't find issues there).

Two things worth a fast follow-up:

  1. InlineEdit's onSave is wired to /* TODO: call API */ at both its call sites in the asset detail page (condition, current value). Clicking the checkmark transitions back to display mode with no error — i.e. it looks like a successful save but nothing is persisted. Same category of issue as the bulk-import wizard flagged in #1359; shouldn't stay reachable without that caveat once real editing lands elsewhere on the page.
  2. The new reservations page's 'New Reservation' modal has un-bound inputs — 'Submit Request' just closes the dialog without reading any of the entered values, so nothing is created and there's no feedback that it didn't work.

Minor: manifest.json references /icons/icon-192.png and /icons/icon-512.png, which don't exist in the repo yet — PWA install prompts will show a missing icon until those are added.

Approving.

Resolve import-line conflict in assets/[id]/page.tsx against DistinctCodes#1359
(PhotoGallery) - both this PR's InlineEdit and DistinctCodes#1359's PhotoGallery
are needed side by side in the overview tab. layout.tsx merged
cleanly (metadata fields vs. theme script, non-overlapping).
@yusuftomilola
yusuftomilola merged commit f77444d into DistinctCodes:main Aug 26, 2026
6 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants