Skip to content

feat: Add option to reload all or only selected rows after invoking script#3200

Merged
mtrezza merged 3 commits intoparse-community:alphafrom
mtrezza:feat/script-row-reload
Feb 10, 2026
Merged

feat: Add option to reload all or only selected rows after invoking script#3200
mtrezza merged 3 commits intoparse-community:alphafrom
mtrezza:feat/script-row-reload

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Feb 10, 2026

Pull Request

Feature

Add option "Script > Reload all rows after run" to reload the whole table or only selected rows after invoking a script. This prevents unnecessarily loading the whole data table and all related info panel data when only some rows may have changed.

If "Reload all rows after run" is disabled, the data table is not re-fetched, meaning any rows that after script invocation would not match the applied filter would still appear in the table. To update the table, the "Refresh" button needs to be clicked.

Summary by CodeRabbit

  • New Features
    • Added a Script menu toggle to control data refresh behavior after script execution. Users can now choose between full table reload or selective refresh of only the affected objects for improved performance. Setting is automatically saved.

@parse-github-assistant
Copy link

parse-github-assistant bot commented Feb 10, 2026

🚀 Thanks for opening this pull request!

@parseplatformorg
Copy link
Contributor

parseplatformorg commented Feb 10, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

Adds a persisted feature flag reloadDataTableAfterScript to choose between full table reload or selective object-level refresh after running scripts; threads two new refresh callbacks through components and updates ScriptUtils.executeScript to accept an optional onRefreshObjects callback.

Changes

Cohort / File(s) Summary
Script execution & cell
src/lib/ScriptUtils.js, src/components/BrowserCell/BrowserCell.react.js
executeScript signature extended to accept onRefreshObjects; BrowserCell conditionally supplies onRefresh vs onRefreshObjects based on reloadDataTableAfterScript.
Data browser core
src/dashboard/Data/Browser/Browser.react.js, src/dashboard/Data/Browser/DataBrowser.react.js
Adds refreshObjects / handleRefreshObjects and toggleReloadDataTableAfterScript; implements selective object refresh flow with _skipPanelClear to suppress panel clearing during targeted refreshes; wires new methods and state.
Prop threading & UI toggle
src/dashboard/Data/Browser/BrowserTable.react.js, src/dashboard/Data/Browser/BrowserToolbar.react.js, src/components/BrowserRow/BrowserRow.react.js
Threads onRefreshObjects and reloadDataTableAfterScript through table/row components; BrowserToolbar adds menu item and toggle for the flag.
Menu cleanup
src/components/BrowserMenu/BrowserMenu.react.js
Removed setCurrent(null) calls from submenu mouse-enter and top-level entry click handlers.

Sequence Diagram

sequenceDiagram
    participant User
    participant BrowserCell as BrowserCell
    participant ScriptUtils as ScriptUtils
    participant Browser as Browser
    participant DataBrowser as DataBrowser

    User->>BrowserCell: trigger Execute script
    BrowserCell->>ScriptUtils: executeScript(script, className, objectId, showNote, onRefresh, onRefreshObjects)
    alt reloadDataTableAfterScript == true
        ScriptUtils->>Browser: onRefresh()
        Browser->>DataBrowser: full data table refresh
    else reloadDataTableAfterScript == false
        ScriptUtils->>Browser: onRefreshObjects([objectId])
        Browser->>DataBrowser: handleRefreshObjects(objectIds)
        DataBrowser->>DataBrowser: clear per-object cache\nset _skipPanelClear = true\nrefetch affected panels/objects
    end
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly Related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides a clear feature explanation but does not follow the repository template structure, missing explicit 'Issue' and 'Approach' sections, and lacks a 'Tasks' checklist. Restructure the description to match the template by adding explicit 'Issue', 'Approach', and 'Tasks' sections, or clarify why the template sections are not applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main feature: adding an option to control whether the data table reloads all rows or only selected rows after script execution.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mtrezza mtrezza changed the title feat: Add option to reload only selected rows after invoking script feat: Add option to reload all or only selected rows after invoking script Feb 10, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/dashboard/Data/Browser/DataBrowser.react.js`:
- Around line 466-479: The _skipPanelClear flag is left true if
this.props.onRefreshObjects(objectIds) rejects; update handleRefreshObjects to
ensure the flag is always consumed by wrapping the asynchronous call in a
try/finally: set this._skipPanelClear = true before calling
this.props.onRefreshObjects, await the call inside try, and then in finally set
this._skipPanelClear = false so any rejection does not leave the flag set;
reference the handleRefreshObjects method and the this._skipPanelClear field
when making this change.
- Around line 675-713: handleRefreshObjects currently sets this._skipPanelClear
before awaiting this.props.onRefreshObjects and never resets it if the promise
rejects, and it doesn't guard against onRefreshObjects being undefined; update
handleRefreshObjects to check that this.props.onRefreshObjects is a function
before calling it, and wrap the await call in a try/finally so that
this._skipPanelClear is always cleared in the finally block (optionally log the
error in the catch). Reference: method handleRefreshObjects, the field
_skipPanelClear, and this.props.onRefreshObjects.
🧹 Nitpick comments (2)
src/dashboard/Data/Browser/Browser.react.js (1)

188-188: localStorage key is not scoped to the app.

The reloadDataTableAfterScript key in localStorage is global across all Parse apps managed by this dashboard instance. This is consistent with how browserLimit is stored (also a global key), so this appears intentional. Just noting that switching between apps will share this preference.

src/dashboard/Data/Browser/DataBrowser.react.js (1)

2941-2956: Consider extracting the duplicated executeScript callback logic.

The conditional onRefresh/onRefreshObjects pattern at lines 2951-2952 is identical to lines 1340-1341. A small helper (e.g., getScriptRefreshCallbacks()) would keep the two call sites in sync and reduce the chance of future drift.

Example helper
+  getScriptRefreshCallbacks() {
+    return {
+      onRefresh: this.props.reloadDataTableAfterScript ? this.props.onRefresh : null,
+      onRefreshObjects: this.props.reloadDataTableAfterScript ? null : this.handleRefreshObjects,
+    };
+  }

Then at each call site:

const { onRefresh, onRefreshObjects } = this.getScriptRefreshCallbacks();
executeScript(script, className, objectId, this.props.showNote, onRefresh, onRefreshObjects);

@mtrezza mtrezza merged commit 173b953 into parse-community:alpha Feb 10, 2026
12 checks passed
@mtrezza mtrezza deleted the feat/script-row-reload branch February 10, 2026 20:16
parseplatformorg pushed a commit that referenced this pull request Feb 10, 2026
# [8.5.0-alpha.6](8.5.0-alpha.5...8.5.0-alpha.6) (2026-02-10)

### Features

* Add option to reload all or only selected rows after invoking script ([#3200](#3200)) ([173b953](173b953))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 8.5.0-alpha.6

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Feb 10, 2026
parseplatformorg pushed a commit that referenced this pull request Feb 12, 2026
# [8.5.0](8.4.0...8.5.0) (2026-02-12)

### Bug Fixes

* Auto-formatting not applied when Cloud Config parameter value is outdated and re-fetched from server ([#3182](#3182)) ([84eab36](84eab36))
* Clicking reload button in info panel may display fetched data in incorrect panel ([#3189](#3189)) ([b348ef5](b348ef5))
* Role linking in ACL fails with type error ([#3095](#3095)) ([2070d29](2070d29))
* Security migration from csurf to csrf-sync ([#3188](#3188)) ([a95d8a3](a95d8a3))
* View configuration dialog looses focus while typing and lacks syntax highlighting ([#3183](#3183)) ([715fe8d](715fe8d))

### Features

* Add keyboard shortcut to scroll info panels to top ([#3199](#3199)) ([7535626](7535626))
* Add option to reload all or only selected rows after invoking script ([#3200](#3200)) ([173b953](173b953))
* Add reload button to info panel on long loading time ([#3184](#3184)) ([3712d96](3712d96))
* Add support for script execution invoking dashboard form for user input ([#3201](#3201)) ([159f99d](159f99d))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 8.5.0

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

Labels

state:released Released as stable version state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants