feat: allow volume browsing#4
Merged
Merged
Conversation
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull Request Overview
Adds a volume-browsing feature to the TUI, including backend support for retrieving filesystem trees and tests covering the new screens and client methods.
- Introduce
get_volume_treeinVolumeManagerandget_directory_informations_with_findinDockerClient - Add
VolumeBrowserScreenUI component, CSS rules, and key bindings for browsing - Expand test suite to cover filesystem parsing, volume manager tree retrieval, Docker client find calls, and TUI navigation
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/docker_volume_analyzer/docker_client.py | Implemented get_directory_informations_with_find to run find in a container |
| src/docker_volume_analyzer/filesystem.py | Added FileSystem and parse_find_output to build file trees |
| src/docker_volume_analyzer/volume_manager.py | Added get_volume_tree and imported parse_find_output |
| src/docker_volume_analyzer/tui.py | Added VolumeBrowserScreen, action_browse, and key handling |
| src/docker_volume_analyzer/tui.tcss | Extended stylesheet to style file tree and shortcuts |
| tests/test_volume_manager.py | Tests for get_volume_tree success and empty cases |
| tests/test_tui.py | Tests for browsing action, screen behavior, and key events |
| tests/test_filesystem.py | New tests for FileSystem, FileNode, and parse_find_output |
| tests/test_docker_client.py | Tests for get_directory_informations_with_find cases |
| .flake8 | Added flake8 config |
Comments suppressed due to low confidence (5)
src/docker_volume_analyzer/filesystem.py:35
- [nitpick] The attribute name
childrensis nonstandard English; consider renaming tochildrenfor clarity and consistency.
childrens: Dict[str, "FileNode"] = field(default_factory=dict)
src/docker_volume_analyzer/tui.py:155
- In
DockerTUI.action_browse,self.app.push_screenis used butappis not an attribute on theAppinstance. Replaceself.app.push_screenwithself.push_screento correctly push the new screen.
self.app.push_screen(
src/docker_volume_analyzer/volume_manager.py:36
- There's a missing space in the docstring before
parse_find_output. It readsandparse_find_output—insert a space for clarity.
dict: Dictionary with volume names as keys andparse_find_output
src/docker_volume_analyzer/tui.tcss:82
- Missing semicolon after the CSS property value. It should be
color: $footer-key-foreground;to avoid syntax errors.
color: $footer-key-foreground
src/docker_volume_analyzer/docker_client.py:98
- The return type uses
Union[str, None], butUnionis not imported. Addfrom typing import Unionat the top of the file.
def get_directory_informations_with_find(
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.
Now, users can examine the structure of their Docker volumes, view files, and navigate through directories.
Key changes
To browse the volume contents, a new VolumeBrowserScreen was added to the TUI.
Navigation functionality was implemented:
Icons to differentiate between directories and files.
The current path is displayed in a status bar.
How to Use:
Select a volume in the main table.
Press b to browse the selected volume.
Use Enter and Backspace to navigate.