Skip to content

Conversation

@ekoneil
Copy link
Collaborator

@ekoneil ekoneil commented Jan 15, 2025

Checkpoint FilesTree. This tree shows files associated with a Skyline project with simple support for replicates and peptide libraries. Includes a simple functional test which is more of a placeholder than an actual test.

FilesTree is incomplete - does not work in all scenarios, is missing files, etc.

* Extend Skyline's data model with support for files and groups of files
* Implement file data model on Chromatograms, Peptide Library, and Background Proteome
* Switch UI to new file model

This is far from finished. Current interface names are meh.

Next up: handle document change events incrementally using the model, consider adding IFileProvider to file model.
* Hide tooltip when tree loses focus
* Update SrmSettings with a way to return its files, this unblocks work on FilesTree but needs to be reworked
* Cleanup FilesTreeNode subclasses
* Rename FileType enum values
… FilesTreeForm which handles access to Skyline window (rather than pushing SkylineWindow into FilesTree).

* Also for .skyl / .sky.view: placeholder tooltips, action to Open Containing Folder
… has DocumentFilePath so don't need access to SkylineWindow

* TC code inspection fixes
…zard/pwiz into Skyline/work/20250102_FilesView
* Add IDs on LibrarySpec, BackgroundProteome
* Proper handling of document change events
* Support for handling a model change on FilesTreeNode
* Use FilesTreeNode's Tag to store model (instead of using a separate property)
* Remove the IFileModel interface from BiblioSpecLite

Outstanding issues exacerbated yet not addressed with this change:

(1) Code reuse with SrmTreeNode / SequenceTree. There are opportunities but chose not to tackle them now.
(2) Revisiting Files access from SrmSettings. Handling doc changes now requires lookups by index so put in a temporary fix.

Will revisit both after tree v1 is running and well tested.
* Verify length and order of tree nodes for replicates and peptide libraries
* Verify renaming replicate
* Verify UI actions for opening library dialog / audit log and activating replicate
…er causes subtle failures (example below for future reference) in tutorial tests so switch to simply putting an Id field on the base model.

Example failure:

Assert.Fail failed.  Diff found at line 5 position 50: expected
01:12:15     Settings > Peptide Settings > Background proteome changed from "None" to "Yeast_mini"
01:12:15     actual
01:12:15     Settings > Peptide Settings > Background proteome > Background proteome database path changed from Missing to "Yeast_MRMer_mini.protdb"
1) Reorder replicates
2) Delete replicates
3) Undo
4) Existence of Project Files nodes
…FilesTree, change icons when known files go missing or reappear.

* Checkpoint a "file missing" icon pending decision to make "missing" versions of existing icons for replicate, peptide, etc.
* Change replicate and sample file icons
* Minor changes to a few type names
* Add property for local file path to UI model
* Get smarter about finding local files when SrmSettings has a non-local path
* Correctly set file found / missing icon when .sky document opens
* "Open Containing Folder" context menu item works for non-local paths
* Show local path in replicate sample file's tooltip
* Add option for Manage Results
* Add option for Library Explorer
* Cleanup menu item configuration
* Simplify docnode => treenode wireup
…ted items are put at the end

* Expand level 1 folders when FilesTree opens for the first time.
@brendanx67 brendanx67 force-pushed the Skyline/work/20250102_FilesView branch from 0a95b8c to 76d5837 Compare October 27, 2025 22:59
brendanx67 and others added 19 commits October 27, 2025 18:13
(1) Return focus to FilesTree after editing a tree node's label
(2) Validate tree node labels, canceling label edit events if the new name matches the node's current name or if the new name dupliates the name of another item in the collection
(3) Change verb used in the context menu from "Show" to "Open" to match Skyline's File menu item that opens Windows Explorer
(4) Fix item shown twice in node tooltips
(5) Update the .sky file icon
(6) Only enable Remove and Remove All context menu items when all selected tree nodes have the same type of model
- Enable rename for SpectralLibrary nodes (long-click to edit label)
- Implement SpectralLibrary.Rename() with Library/LibrarySpec synchronization
- Add SpectralLibrary.HasItemWithName() for duplicate name validation
- Add localized resource strings for error messages and audit logging
- Extend FilesTreeForm.EditTreeNodeLabel() to handle both Replicate and SpectralLibrary
- Add comprehensive test coverage in FilesTreeFormTest

The key challenge was maintaining synchronization between the parallel
LibrarySpecs and Libraries arrays, which must have matching names at
each index to pass PeptideLibraries.LibrariesMatch() validation.
- Add IFileRenameable interface to FileModel.cs with:
  * ValidateNewName() with error message out parameter
  * PerformRename() for executing rename operation
  * AuditLogMessageResource property for audit logging
- Implement IFileRenameable in Replicate and SpectralLibrary
- Convert Rename() methods from static to instance methods
- Simplify FilesTreeNode.SupportsRename() to use interface check
- Refactor FilesTreeForm.EditTreeNodeLabel() to use polymorphism:
  * Reduced from ~65 lines to ~35 lines
  * Removed all type-specific branching logic
  * Now extensible for future renameable types

Benefits: Cleaner architecture, easier to extend, type-safe at compile time.
All tests pass with no behavior changes.
…zard/pwiz into Skyline/work/20250102_FilesView
…zard/pwiz into Skyline/work/20250102_FilesView
…zard/pwiz into Skyline/work/20250102_FilesView
…rver.GetFolderPath call and update TODO with PR #3334
brendanx67 pushed a commit that referenced this pull request Nov 27, 2025
Introduces a new Files view tab in Skyline that displays and manages all
files related to the current document (spectral libraries, background
proteomes, chromatogram caches, audit logs, replicate files, etc.).

The view includes file system monitoring, background operations,
drag-and-drop organization, and visual indicators for missing files.

- 64.8% code coverage with 4 comprehensive test classes
- All tests passing
- Test data cleanup: removed empty SkylineWindowEventsTest.zip, reduced
  FilesTreeFormTest.zip from 87 MB to ~1 MB
- Cleaned up from original PR #3334

For complete details, see: ai/todos/active/TODO-20251126_files_view.md

Closes #3334
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.

4 participants