Skip to content

Bosu - Add Smart Defaults, History Preview & UX Enhancements to Tool Status Update Form - #5782

Open
BosuBose132 wants to merge 12 commits into
developmentfrom
Bosu_tool_status_smart_defaults_history_ux
Open

BosuBose132 wants to merge 12 commits into
developmentfrom
Bosu_tool_status_smart_defaults_history_ux

Conversation

@BosuBose132

@BosuBose132 BosuBose132 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Implemented smart defaults, historical update previews, conditional replacement validation, image previews, and improved submission feedback for the Tool/Equipment Status Update Form in the Building Management Dashboard.

These enhancements improve the user experience by reducing repetitive data entry, providing visibility into previous equipment updates, and making the status-update process more reliable.

Screenshot 2026-11-05 at 4 04 09 PM

Related Backend PR

This is related to backend PR #2470

The backend PR includes equipment status-history persistence, server-side validation, and authenticated update handling.

Original Task Requirements

  1. Smart Defaults: Automatically preselect the previous user and usage purpose from available historical records while allowing users to edit these selections.
  2. Last Update Summary: Display the most recent update date, previous equipment condition/status, and last known user.
  3. Conditional Replacement Reason: Display and require a replacement reason when the user selects "Yes" for replacement.
  4. Image Upload Improvements: Provide image thumbnail previews and support multiple images where existing functionality permits.
  5. Success Confirmation: Display clear confirmation feedback summarizing the successfully saved update.

Changes Implemented

  • Implemented automatic population of the previous equipment user and usage purpose using historical checkout and status-update records.
  • Added safeguards to prevent asynchronous responses from overriding user selections.
  • Introduced a Last Update Summary displaying the update date, condition/status, and last known user.
  • Added conditional replacement reason visibility and required-field validation.
  • Improved image selection with thumbnail previews and removal functionality.
  • Added clear messaging indicating that selected images are preview-only and are not saved.
  • Improved submission handling with loading states, duplicate-submission prevention, and persistent success/error feedback.
  • Moved validation messages closer to the form's action buttons.
  • Fixed malformed icons and improved the Update Status button.
  • Normalized frontend status values to match the backend's supported equipment statuses.
  • Fixed the Equipment List's update action to navigate to the working status-update form instead of an empty modal.
  • Corrected the success confirmation link to navigate to the appropriate Equipment Detail Page.
  • Improved dark-mode contrast in the Last Update Summary.
  • Verified responsive behavior on smaller screens without horizontal overflow.
  • Added and expanded automated regression tests covering form behavior, historical defaults, validation, navigation, and file previews.

Testing Performed

Automated Testing

  • Frontend regression tests: 286 passed, 3 skipped, across 35 test files.
  • ESLint: 0 errors; 2 existing no-console warnings.
  • Stylelint: Passed.
  • Frontend production build: Passed.
  • git diff --check: Passed.
  • JS/JSX Prettier checks: Passed.

Manual Testing

  • Verified automatic population of historical user and usage purpose.
  • Tested conditional replacement reason behavior.
  • Verified successful equipment status submission and database persistence through the local application.
  • Confirmed saved updates appear in equipment history after refreshing.
  • Verified the success confirmation and correct Equipment Details navigation.
  • Checked dark-mode readability.
  • Verified mobile responsiveness without horizontal page scrolling.

How to Test

  1. Run the frontend and backend applications locally.
  2. Log in with an authorized account.
  3. Navigate to Building Management Dashboard → Equipment List.
  4. Click the pencil icon under Updates for an equipment record.
  5. Verify that the Last Update Summary shows the available historical information.
  6. Verify that the previous user and usage purpose are automatically selected and remain editable.
  7. Select Yes for replacement and confirm that the replacement reason becomes required. Select No and confirm the field is hidden.
  8. Select an image and verify its thumbnail preview and removal behavior.
  9. Submit a valid equipment status update.
  10. Confirm the success message and navigate to the Equipment Detail Page.
  11. Reopen the form and verify the persisted update and historical defaults.
  12. Test the form in light mode, dark mode, and a narrow mobile viewport.

Known Limitations / Reviewer Notes

  • Image selection is preview-only. Images are not persisted because the existing equipment-update flow does not provide image-storage support.
  • The frontend uses canonical backend status values, which means certain distinct user-facing statuses share the same stored value. This mapping requires confirmation from the project lead before merge.
  • The existing CSS module contains baseline formatting differences inherited from development; unrelated formatting was intentionally left untouched.

Screenshots / Demo

Screenshot 2026-11-05 at 3 56 30 PM

BosuBose132 and others added 12 commits October 28, 2026 16:23
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ent save result

- Replace FA5-only <i class="fas ..."> markup (undefined under the loaded FA4 CSS) with FontAwesomeIcon; plain 'Update Status' button, 'Saving...' state
- Show a single validation summary listing all missing fields directly above Cancel/Update Status
- Show backend/network errors and a persistent save confirmation in the same area; drop duplicate toast.error in updateEquipment
- Add focused tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dropdown keeps its labels but submits Good / Needs Repair / Out of Order, matching the buildingEquipment updateRecord enum. Saved canonical or legacy values preselect the matching label.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@netlify

netlify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit bdf2210
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6aeceff23e3eab7c09d47664
😎 Deploy Preview https://deploy-preview-5782--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@BosuBose132 BosuBose132 changed the title Bosu tool status smart defaults history ux Bosu - Add Smart Defaults, History Preview & UX Enhancements to Tool Status Update Form Nov 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant