Skip to content

Fix and refactor workspace table to allow subfolders#32

Open
obazopaz wants to merge 32 commits into
devfrom
feature/recursive-workspace-tree
Open

Fix and refactor workspace table to allow subfolders#32
obazopaz wants to merge 32 commits into
devfrom
feature/recursive-workspace-tree

Conversation

@obazopaz

@obazopaz obazopaz commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

obazopaz added 28 commits June 29, 2026 10:29
Replace the two-level getGSFilesFromDir loop with collectGSFilesFromDirRecursive()
so nested run folders load at arbitrary depth in DFS order. Recurse calcGSUsedSpaceDir()
so folder sizes include all descendant file content.

https://trello.com/c/QBKArZlk/109-dev-fix-and-refactor-workspace-table-to-allow-subfolders
Replace the flat two-level addTreeTableNodesToFiles() loop with DFS
assignTreeIdsRecursive() from the project root, assigning dotted tree_id
values (n, n.i, n.i.j) while keeping existing 2-level IDs unchanged.
Add sortFilesForTable() so rows render parent-before-children and pending
job rows land in tree position; wire it in workspace/index.php. Extend
formatData() with tree_depth and omit empty tree_id_parent for templates.

https://trello.com/c/QBKArZlk/109-dev-fix-and-refactor-workspace-table-to-allow-subfolders
…ilesFromDirRecursive

Handle cases where directory files are not set, ensuring child IDs are correctly populated and processed.

https://trello.com/c/QBKArZlk/109-dev-fix-and-refactor-workspace-table-to-allow-subfolders
Add a check to ensure that file data is valid and contains an ID before processing, preventing potential errors during file collection.

https://trello.com/c/QBKArZlk/109-dev-fix-and-refactor-workspace-table-to-allow-subfolders
Refactor functions to return unique child nodes and validate file entries before processing. This prevents potential errors and improves the integrity of the file structure during tree operations.

https://trello.com/c/QBKArZlk/109-dev-fix-and-refactor-workspace-table-to-allow-subfolders
Add data-order attributes to various table cells in the workspace HTML files to improve sorting functionality. This change ensures that file and folder entries can be sorted based on their respective keys aster adding subfolders rendering.

https://trello.com/c/QBKArZlk/109-dev-fix-and-refactor-workspace-table-to-allow-subfolders
Use a list plus usort with id tie-break instead of ksort on order keys,
so colliding _print_order values no longer drop rows.
…Data

Assign tree_sort/parent_tree_sort during table sorting and expose
normalized *_sort_key fields for template data-order attributes.
Load tool icons via __DIR__-relative paths with a skeleton fallback
instead of a cwd-dependent relative path.
Shared tree ID, folder-path, and file-record helpers for nested workspace rows.
Disable DataTables global ordering; reorder DOM siblings per parent and persist sort headers across redraws.
Collapse/expand all descendants; sync folder icons and row padding by tree depth.
Lazy file records, folder label cache, and safer drawToolsList rendering for nested rows.
Recursive folder/file check state, ancestor uncheck, and descendant restore on expand.
Updated the tool removal function call to ensure the second parameter is passed as a string.
…ders

Eliminating unnecessary folder ID tracking and enhancing the unchecking of ancestor folder checkboxes when no descendant files remain checked.
@obazopaz obazopaz requested a review from nicodr97 July 2, 2026 10:28
Comment thread front_end/openVRE/public/applib/getDataMove.php Outdated
Comment thread front_end/openVRE/public/applib/getDataMove.php Outdated
Comment thread front_end/openVRE/public/assets/pages/scripts/datatables-page.js Outdated
Comment thread front_end/openVRE/public/phplib/mongoDB.inc.php Outdated
Comment thread front_end/openVRE/public/phplib/mongoDB.inc.php

@nicodr97 nicodr97 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just a few comments. Also need for more visible difference of folder hierarchy in the workspace table.

@obazopaz

obazopaz commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Just a few comments. Also need for more visible difference of folder hierarchy in the workspace table.

I have updated the PR.
I have also made changes for displaying the sublevels better
Screenshot from 2026-07-06 12-55-50

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.

2 participants