Skip to content

Clear Home loading overlay when deleted files are removed#93

Merged
jasonstratton merged 1 commit into
DynamoDS:masterfrom
Chloepeg:DYN-10516-Refresh-Templates-and-Recent-Files-from-disk-dynamically
Jun 17, 2026
Merged

Clear Home loading overlay when deleted files are removed#93
jasonstratton merged 1 commit into
DynamoDS:masterfrom
Chloepeg:DYN-10516-Refresh-Templates-and-Recent-Files-from-disk-dynamically

Conversation

@Chloepeg

@Chloepeg Chloepeg commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Purpose

This PR addresses DYN-10516.

The changes in the code aim to clear the Home loading overlay when trying to open a deleted or moved Recent file or Template and sends refreshed data back to DynamoHome. Without this, Home remains stuck on “Loading” until the user switched away and returned.

This pr works with : DynamoDS/Dynamo#17161

gif loading overlay

Changes :

  • Clears the loading state when refreshed Recent file data is received from Dynamo.
  • Clears the loading state when refreshed Template data is received from Dynamo.
  • Added coverage for both loading-state clear behaviors.

Declarations

Check these if you believe they are true

Release Notes

Home no longer stays stuck on the loading screen after clicking a deleted or moved Recent file or Template.

The disk refresh and missing-file handling live in the Dynamo repo PR, this repo only fixes the WebView loading overlay on the DynamoHome side.

Reviewers

@zeusongit
@DynamoDS/eidos

FYIs

@dnenov
@johnpierson
@jnealb
@jasonstratton

PageRecent.tsx: when Dynamo sends refreshed Recent file data through receiveGraphDataFromDotNet(...), DynamoHome now also calls setIsDisabled(false). This hides the loading overlay after a clicked Recent file is found to be deleted and removed from the list.

TemplatesContext.tsx: when Dynamo sends refreshed template data through receiveTemplatesDataFromDotNet(...), DynamoHome now calls window.setShowStartPageChanged?.(true). That uses the existing Home visibility handler to clear the loading overlay after a clicked Template is found to be deleted and removed from the list.

PageRecent.test.tsx: adds a unit test proving refreshed Recent data clears the loading state.

TemplatesContext.test.tsx: adds a unit test proving refreshed template data clears the loading state.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the DynamoHome WebView “Loading” overlay getting stuck by clearing the disabled/loading state when refreshed Recent graphs or Template data is received from the host (typically after a missing/deleted item triggers a refresh).

Changes:

  • Clear Recent page loading/disabled state when window.receiveGraphDataFromDotNet receives refreshed graph data.
  • Clear Home loading/disabled state when window.receiveTemplatesDataFromDotNet receives refreshed template data.
  • Add unit tests covering both loading-state clear behaviors.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/components/Recent/PageRecent.tsx Clears disabled/loading state after refreshed Recent graphs are received.
src/components/TemplatesContext.tsx Clears disabled/loading state after refreshed Templates data is received.
tests/unit/Recent/PageRecent.test.tsx Adds coverage that graph refresh clears loading/disabled state.
tests/unit/TemplatesContext.test.tsx Adds coverage that template refresh clears loading/disabled state.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 37 to +41
try {
// jsonData is already an object, so no need to parse it
const data = jsonData;
setGraphs(data);
setIsDisabled(false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agree, but it is low risk. Consider making the change before merging

Comment on lines 53 to +57
try {
// jsonData is already an object, so no need to parse it
const data = (jsonData || []).map(normalizeTemplate);
setTemplates(data);
window.setShowStartPageChanged?.(true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agree, but it is low risk. Consider making the change before merging

act(() => {
window.receiveGraphDataFromDotNet(mockGraphs);
});
expect(defaultProps.setIsDisabled).toHaveBeenCalledWith(false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minot and not a big deal.

setIsDisabled is only called once so toHaveBeenCalledWith and toHaveBeenLastCalledWith are essentially equivalent

Comment on lines +22 to +24
act(() => {
window.receiveTemplatesDataFromDotNet([]);
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The expect will never actually fail — it's noise. Ignore

@jasonstratton jasonstratton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Approved. I will merge.

The first two Copilot comments have some value. Please read them and consider the change in a future PR, but no worries here.

@jasonstratton jasonstratton merged commit 8649cb2 into DynamoDS:master Jun 17, 2026
11 checks passed
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.

3 participants