Skip to content

Conversation

ericenns
Copy link
Member

@ericenns ericenns commented Sep 16, 2025

What does this PR do and why?

Describe in detail what your merge request does and why.

This PR updates the way broadcasting refreshes when a sample is changed in a group or project. Now, when a sample is changed, the broadcasted change displays an alert dialogue to users who are on the same page:

  1. If the user is modifying something on that page, the message says how many samples have been changed and gives the user the option to manually refresh the page or dismiss.
  2. If the user is not modifying something on the page, the alert has a 10-second countdown that will automatically refresh the page.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other pull requests.

image

Samples were deleted in the window on the right, update was sent to the browser on the left.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Open two browser windows to the same project samples page that the user has the right to make changes.
  2. Delete one or more samples from either window and watch the other window.

PR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

This comment has been minimized.

This comment has been minimized.

@joshsadam joshsadam force-pushed the feat/refresh_controller branch from 3f8c522 to 1419806 Compare September 26, 2025 12:15
@joshsadam joshsadam self-assigned this Sep 26, 2025
@joshsadam joshsadam added the enhancement New feature or request label Sep 26, 2025
@joshsadam joshsadam force-pushed the feat/refresh_controller branch from b02be8b to 1d9bd17 Compare September 26, 2025 14:19
@joshsadam joshsadam marked this pull request as ready for review September 26, 2025 14:30

This comment has been minimized.

@joshsadam joshsadam force-pushed the feat/refresh_controller branch from 61dce43 to 9143691 Compare October 7, 2025 14:59

This comment has been minimized.

@joshsadam joshsadam force-pushed the feat/refresh_controller branch 2 times, most recently from 725ca83 to 03959c0 Compare October 14, 2025 18:25
@joshsadam joshsadam force-pushed the feat/refresh_controller branch from 59d87ad to 612367d Compare October 15, 2025 14:35
@joshsadam joshsadam marked this pull request as draft October 15, 2025 14:48

This comment has been minimized.

Copy link

Code Metrics Report

Coverage Test Execution Time
96.3% 17m12s

Code coverage of files in pull request scope (98.9%)

Files Coverage
app/models/sample.rb 96.0%
app/views/groups/samples/index.html.erb 100.0%
app/views/projects/samples/index.html.erb 100.0%
app/views/shared/samples/_refresh_alert.html.erb 100.0%

Reported by octocov

@ericenns ericenns force-pushed the feat/refresh_controller branch from dc06ca6 to cae7e88 Compare October 15, 2025 17:53
Refactors the refresh controller to handle turbo stream
messages more robustly by checking for the presence of
`action="refresh"` and ensures the event data starts with
"
@joshsadam joshsadam force-pushed the feat/refresh_controller branch 2 times, most recently from 9769c21 to 752c623 Compare October 15, 2025 18:48
Adds a dismiss method to the refresh controller and a refresh method to reload the page. Updates the samples index view to use the new RefreshNoticeComponent for displaying refresh notifications. Localizes refresh notice messages in English and French.
Removes Flowbite-style comment from the refresh notice component. Updates the refresh controller to improve Turbo Stream event handling, including methods for showing and hiding the refresh notice, and checks for refresh actions more robustly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants