Skip to content

DYN-10020 - Revise Sample File Directory Traversing#16820

Merged
zeusongit merged 5 commits intoDynamoDS:masterfrom
johnpierson:dyn10020_sampleFilesFix
Jan 9, 2026
Merged

DYN-10020 - Revise Sample File Directory Traversing#16820
zeusongit merged 5 commits intoDynamoDS:masterfrom
johnpierson:dyn10020_sampleFilesFix

Conversation

@johnpierson
Copy link
Member

@johnpierson johnpierson commented Jan 9, 2026

Purpose

Issue: WalkDirectoryTree in StartPage.xaml.cs adds directory entries even if they contain no .dyn files. It filters .dyn files, but directories are added before checking for children.

This PR improves the sample file directory traversal logic by filtering out dependency folders and empty directories from the sample file tree.

Key Changes:
Adds filtering to exclude directories ending with ".dependencies" from the sample file tree
Implements empty directory filtering by only adding directories that contain .dyn files (directly or in subdirectories)

Summary

Added filtering to exclude .dyn files with "Generative Design" as the active linter.

Changes Made

JSON Handling

  • Added using Newtonsoft.Json.Linq; to handle JObject instances from JSON deserialization.

Home Page Filtering Behavior

The home page now filters out:

  • Non-.dyn files
  • Directories ending in .dependencies or equal to gd
  • Directories that don't contain .dyn files

After Fix:
image

Declarations

Check these if you believe they are true

Release Notes

  • Samples section in Home no longer shows results from .dependencies folders (Generative Design samples) or blank directories.

Reviewers

@DynamoDS/eidos

FYIs

@emru-y

Copilot AI review requested due to automatic review settings January 9, 2026 13:47
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the sample file directory traversal logic by filtering out dependency folders and empty directories from the sample file tree.

Key Changes:

  • Adds filtering to exclude directories ending with ".dependencies" from the sample file tree
  • Implements empty directory filtering by only adding directories that contain .dyn files (directly or in subdirectories)

thank you mr copilot 🤓

Co-authored-by: Copilot <[email protected]>
@johnpierson johnpierson changed the title DYN-10020 - Revise Sample File Directory Traversing DYN-10020, REVIT-245836 - Revise Sample File Directory Traversing Jan 9, 2026
@johnpierson johnpierson changed the title DYN-10020, REVIT-245836 - Revise Sample File Directory Traversing DYN-10020 - Revise Sample File Directory Traversing Jan 9, 2026
{
//Make sure the folder's name is not "backup"
if (!directory.Name.Equals(Configurations.BackupFolderName))
// Make sure that the folder name is not "backup" and that it doesn't end with ".dependencies".
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking more about it maybe we should exclude all GD samples. Player I think they're fine.
GD samples are more complex and require some familiarity with GD and the starting point for that should be the GD app I guess.

Copy link
Member Author

Choose a reason for hiding this comment

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

That might be a bit more difficult as file names can change? Should we just ignore a top level directory if any sub directory contains a .dependencies folder?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can check if the dyn has an active linter (Generative Design), and if it does filter it out?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just added the logic for filtering based on linter.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can just exclude the folder named GD ?

@QilongTang QilongTang requested a review from a team January 9, 2026 14:39
@QilongTang QilongTang added this to the 4.0.2 milestone Jan 9, 2026
@zeusongit zeusongit merged commit c70e506 into DynamoDS:master Jan 9, 2026
25 of 27 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 9, 2026
@github-actions
Copy link

github-actions bot commented Jan 9, 2026

Successfully created backport PR for RC4.0.2_master:

@johnpierson johnpierson deleted the dyn10020_sampleFilesFix branch January 12, 2026 16:16
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.

5 participants