Enhance file attachment management and improve room filters UI - #445
Merged
Conversation
- Updated the delete_file_attachment method to redirect to the appropriate record page after purging an attachment, improving user experience. - Added attachment_redirect_path and attachment_redirect_parent methods to handle redirection logic for different record types. - Modified the building image removal button in the buildings show view to use button_to for better form handling and confirmation. - Expanded attachment deletion specs to ensure correct redirection for building images and nested floor plans.
- Introduced caching for room characteristic definitions in the ApplicationController to improve performance. - Updated the PagesController to streamline the room filters glossary, utilizing cached definitions and improving the display of categories and filters. - Enhanced the room filters glossary view with improved navigation and layout, including links to definitions and better accessibility features. - Modified the room characteristics partial to conditionally display definitions based on user context. - Updated specs to ensure the glossary page renders correctly with the new features.
…dit view - Corrected the spelling of "availability" in the info panel. - Adjusted formatting for better readability in the list of room management features.
- Fixed list item formatting in the info panel for better readability. - Updated HTML entities for proper display in the room management features list.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves how room characteristic definitions are retrieved and presented across the Rooms UI and the Room Filters Glossary, and makes attachment deletion redirects return users to the most relevant parent page (room/building/nested floor).
Changes:
- Centralized and cached room characteristic definitions via
ApplicationController#room_characteristic_definitions, and used them for tooltips/inline definitions and glossary rendering. - Refactored the Room Filters Glossary UI to group/sort categories and provide anchor-based in-page navigation.
- Updated attachment deletion redirect logic to be context-aware, with expanded request spec coverage.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/requests/pages_spec.rb | Adds assertions for glossary page content rendering. |
| spec/requests/attachment_deletions_spec.rb | Expands redirect coverage for room/building/floor attachment deletions. |
| app/views/rooms/edit.html.erb | Fixes/cleans up instructional copy and HTML structure. |
| app/views/rooms/_room_characteristic.html.erb | Adds optional inline definitions and glossary deep-links for characteristics. |
| app/views/rooms/_checkbox_filters.html.erb | Adds definition tooltips and glossary deep-links to checkbox filters. |
| app/views/rooms/_characteristics.html.erb | Renders characteristics with inline definitions and a distinct cache key variant. |
| app/views/pages/room_filters_glossary.html.erb | Reworks glossary layout with alphabetical nav and anchored sections. |
| app/views/buildings/show.html.erb | Adjusts building image removal UI to use button_to delete flow. |
| app/helpers/application_helper.rb | Adds helper methods for generating glossary anchors. |
| app/controllers/pages_controller.rb | Simplifies glossary action to use prebuilt/cached characteristics data. |
| app/controllers/application_controller.rb | Adds cached definitions helper and context-aware redirect logic for attachment deletions. |
| app/assets/builds/tailwind.css | Updates built Tailwind output to support new/used utility classes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fis typo in not-active Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Updated the delete_file_attachment method to handle ActiveRecord::RecordNotFound separately, improving robustness. - Enhanced redirection logic in attachment_redirect_path to ensure proper fallback to rooms_path when parent record is not found.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements to the handling and display of room characteristic definitions, enhances the glossary experience for users, and refines the file attachment deletion flow. The main changes include caching and centralizing room characteristic definitions, improving the UI and navigation for the Room Filters Glossary, providing better definitions and links throughout the UI, and updating the attachment deletion redirect logic to be context-aware.
Room Characteristic Definitions and Glossary Improvements:
room_characteristic_definitionshelper toApplicationControllerfor efficient, centralized access to room characteristic labels and definitions.Attachment Deletion Flow:
Minor UI and Content Fixes:
Testing: