Skip to content

Add opt-in default for monitor all and fix monitor all with sorting - #175

Open
tynanford wants to merge 1 commit into
masterfrom
default_monitor_all
Open

tynanford wants to merge 1 commit into
masterfrom
default_monitor_all

Conversation

@tynanford

Copy link
Copy Markdown
Contributor

Add REACT_APP_DEFAULT_MONITOR_ALL (default false) to check the "Monitor All" box in the home page results table after each search and page change. It is shown on the Services page and only applies when PVWS is enabled.

Fix monitor all monitoring the wrong PVs when the table is sorted or filtered. It used the pagination text and row positions in the unsorted results, so after sorting none of the visible PVs were monitored. It now uses the grid's visible page row ids, and while checked it follows sort and filter changes.

Fix PVWS subscriptions leaking when the table is sorted or filtered while monitoring. ValueCheckbox now clears its subscription when its row is removed.

Add tests for monitor all in QueryResults.test.jsx.

This fixes #147 but needs testing

Add REACT_APP_DEFAULT_MONITOR_ALL (default false) to check the "Monitor All"
box in the home page results table after each search and page change. It is
shown on the Services page and only applies when PVWS is enabled. Fixes #147.

Fix monitor all monitoring the wrong PVs when the table is sorted or filtered.
It used the pagination text and row positions in the unsorted results, so after
sorting none of the visible PVs were monitored. It now uses the grid's visible
page row ids, and while checked it follows sort and filter changes.

Fix PVWS subscriptions leaking when the table is sorted or filtered while
monitoring. ValueCheckbox now clears its subscription when its row is removed.

Add tests for monitor all in QueryResults.test.jsx.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Filter-driven pagination resets can disrupt Monitor All, and hiding Actions can silently stop live updates.

2 open issues
What changed in this PR

Adds opt-in automatic monitoring for search results and updates Monitor All to use sorted, filtered page rows.

Changes:

  • Adds and displays the default-monitoring setting.
  • Updates page monitoring and subscription cleanup.
  • Adds regression tests for Monitor All behavior.
File Description
src/​config.js Parses the new monitoring setting.
src/​components/​services/​Services.jsx Displays the configured default.
src/​components/​home/​queryresults/​valuecheckbox/​ValueCheckbox.jsx Clears subscriptions on unmount.
src/​components/​home/​queryresults/​QueryResults.test.jsx Tests monitoring and pagination behavior.
src/​components/​home/​queryresults/​QueryResults.jsx Monitors visible page IDs and handles grid changes.
.env Documents the opt-in setting.

Review effort: Balanced

onPaginationModelChange={(newPaginationModel) => {
setPaginationModel(newPaginationModel);
clearMonitoring();
monitorAllOnNewPage(config.DEFAULT_MONITOR_ALL);
Comment on lines +49 to +52
useEffect(() => {
return () => {
if (isSubscribed.current) {
sendJsonMessage({ "type": "clear", "pvs": [props.pvName] });
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.

add option to default "monitor all" checkbox to on

2 participants