Skip to content

Feature/file manager - #52

Merged
eMadman merged 7 commits into
mainfrom
feature/file-manager
Sep 15, 2026
Merged

eMadman merged 7 commits into
mainfrom
feature/file-manager

Conversation

@eMadman

@eMadman eMadman commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Add a device file manager

Adds a Tools → File Manager entry that browses device storage over ADB, with
uploads, downloads, and basic file operations.

File manager

  • Browse device storage starting at /sdcard, with an editable path field,
    quick-jump chips (sdcard, Download, DCIM, Movies), and a refresh action.
  • Sortable columns: name, size, and modified. Directions toggle per column and
    folders stay grouped above files in both directions.
  • Upload files from the OS file picker into the current directory, download
    files and folders, and create, rename, or delete entries. Rename and delete
    are reachable from row buttons, an overflow menu, or a right-click menu.
  • ls -la output is parsed for both toybox and legacy toolbox formats,
    including symlink targets and entries with no size or timestamp.

Download destinations

  • The save folder is persisted with shared_preferences so it survives
    restarts. A stored folder that is missing at launch falls back to the default
    for that session but is kept, since it may live on a drive or share that is
    not mounted yet.
  • "Ask each time" option prompts for a destination on every download,
    and a per-file "Download to…" action handles one-off overrides.
  • A destination bar in the file manager states where the next download will
    land, with inline Change and Open folder actions.
  • "Open containing folder" after a download now opens the folder the file
    actually went to, not the save location.

Also included

  • .gitattributes normalizing line endings to LF.
  • README feature-list entry for the file manager.
  • Renamed the home screen's "Media Settings" section to "Downloads & Media" and
    added a tooltip showing the full save path.

Testing

flutter test test/device_file_parser_test.dart — 14 tests covering toybox and
toolbox ls parsing, symlink handling, all three sort columns in both
directions, missing-metadata fallbacks, shell quoting, path joining/traversal,
and size formatting. All pass.

Manual verification of the dialog itself (upload, download, rename, delete,
"Ask each time") was done against my Peloton Bike with the Windows Client

Notes for reviewers

  • Uploading is unsupported on the mobile client and throws a clear error there;
    downloads work via Adb.downloadFile.
  • Adds one dependency: shared_preferences: ^2.5.5.
  • Not tested on Mac/Linux

Adds a Tools menu entry that opens a file manager dialog for browsing
device storage over ADB, uploading files via the OS file picker,
downloading to the save location, and creating, renaming, and deleting
entries. Remote paths are shell-quoted, and the ls parser handles both
toybox and legacy toolbox output formats with unit tests.
Downloads previously always landed in the save location, which reset to
the default folder on every launch and could only be changed from the
main screen.

- Persist the save location with shared_preferences so it survives
  restarts. A stored folder that is missing at launch falls back to the
  default for the session but is kept, since it may be on a drive or
  share that is not mounted yet.
- Add an "Ask each time" option that prompts for a destination on every
  download, and a per-file "Download to..." action for one-off
  overrides, reachable from an overflow button or a right-click menu.
- Show a destination bar in the file manager stating where the next
  download will land, with inline Change and Open folder actions.
- "Open containing folder" after a download now opens the folder the
  file actually went to rather than the save location.
- Use xdg-open on Linux; the opener previously fell back to macOS `open`
  on every non-Windows platform.
@eMadman
eMadman requested a review from doudar September 14, 2026 20:15

@doudar doudar left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Awesome addition!

@eMadman

eMadman commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

Confirmed working on mac as well.

@eMadman
eMadman merged commit 6585936 into main Sep 15, 2026
6 checks passed
@eMadman
eMadman deleted the feature/file-manager branch September 15, 2026 17:57
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