Skip to content

[Cherry-pick] DYN-10020 - Revise Sample File Directory Traversing#16823

Merged
zeusongit merged 1 commit intoRC4.0.2_masterfrom
cherrypick-16820
Jan 12, 2026
Merged

[Cherry-pick] DYN-10020 - Revise Sample File Directory Traversing#16823
zeusongit merged 1 commit intoRC4.0.2_masterfrom
cherrypick-16820

Conversation

@github-actions
Copy link

@github-actions github-actions bot commented Jan 9, 2026

Cherry-pick of #16820 to RC4.0.2_master

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.

New Method: IsGenerativeDesignFile (lines 603–680)

  • Checks if the file is a .dyn or .dyf file
  • Deserializes the JSON and looks for the Linting property (case-insensitive)
  • Handles both JObject and Dictionary<string, object> cases
  • Extracts the activeLinter value
  • Returns true if it equals "Generative Design" (case-insensitive)
  • Includes error handling

Integration into File Processing (lines 254–258)

  • Skips files that have Generative Design as the active linter before adding them to the sample files list

Home Page Filtering Behavior

The home page now filters out:

  • Non-.dyn files
  • Directories ending in .dependencies
  • Directories that don't contain .dyn files
  • .dyn files with "Generative Design" as the active linter

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

@github-actions github-actions bot added this to the 4.0.2 milestone Jan 9, 2026
@QilongTang QilongTang requested a review from a team January 12, 2026 15:31
Copy link
Contributor

@zeusongit zeusongit left a comment

Choose a reason for hiding this comment

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

@zeusongit zeusongit merged commit 7549d09 into RC4.0.2_master Jan 12, 2026
11 of 12 checks passed
@zeusongit zeusongit deleted the cherrypick-16820 branch January 12, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants