fix: load sheets in subdirectory#188
Merged
Merged
Conversation
theacodes
approved these changes
Apr 26, 2026
Owner
theacodes
left a comment
There was a problem hiding this comment.
This looks like a great improvement, thank you so much for doing this.
This was referenced Apr 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Many issues (#119, #186) report loading problems when a file references other files located in subdirectories of the repo. Consider the following directory structure
which schematic hierarchy is
This currently causes an error because the existing VFS is not designed to handle tree-like directory structures. This PR refactors the VFS to support tree-structured files while maintaining backward compatibility with the older implementation. It currently refactors both
GitHubVFSandDragAndDropVFS.How it works
The idea behind the refactoring is
entriesinFileSystemBase, which preserves the original file system hierarchy.hasfunction returns true if a file exists in entries.getfunction loads and returns the corresponding File object.To simplify the implementation, a new
FileSystemBaseabstract class is introduced. It implements all methods required byIFileSystem(referred to asVirtualFileSystemin commit 2890714). Two abstract methods are provided for constructing the file tree:load_file: loads a file from a specific pathenumerate: lists the items in the current directoryFurthermore, to reduce the rate of API requests, it does not recursively list all files. Instead, it lists them on demand based on the directory requested by
has. The repositories referenced in these issues have been verified to work correctly.If these changes are accepted, we can proceed to implement recursive support for CodeBerg as well.
Known limits
The
hasfunction does not currently attempt to load directories with more than two levels of nesting.On the initial enumeration,
entriescontains only the root-level items:When
has('sub1/sub2/sub.kicad_sch')is subsequently called, it returns false because the contents ofsub1have not yet been enumerated.