Skip to content

feat(tray): Total Commander style file manager (progress, cancel, gone-runtime banner); ls --json, mkdir, rm -r, --via ssh, --progress - #23

Merged
arlinamid merged 3 commits into
mainfrom
feat/tray-files
Nov 20, 2026
Merged

arlinamid merged 3 commits into
mainfrom
feat/tray-files

Conversation

@arlinamid

Copy link
Copy Markdown
Owner

What

Tray: a two-pane file manager (Files button on a local card, tray/files.py): this computer on the left (drive list, Up), the runtime on the right from /content.

  • Copy by drag and drop, the Upload ➜ / ⬅ Download buttons or F5; F7 new folder, F8 delete (local files go to the recycle bin, remote after a confirmation), Enter/double-click opens, Backspace goes up.
  • The line at the bottom runs a command in the runtime's folder: colab ssh -- sh -c over ssh, otherwise colab exec with Python on stdin (no key needed).
  • Transfer: contents API or ssh/scp, chosen at the top and saved as tray_transfer.
  • Every action is one of the CLI's own subcommands, run one at a time with QProcess (tray/file_ops.py builds the argv).

CLI pieces it runs:

  • colab ls --json (path + items with name/type/size/last_modified, folders first; errors as JSON),
  • colab mkdir PATH,
  • colab rm -r PATH (children first; the contents API refuses a non-empty folder),
  • colab upload/download --via ssh [-i KEY] (OpenSSH scp through colab ssh --proxy-mode, default key from ssh_identity).

Tests

  • tests/test_files_extras.py, tests/test_tray_file_ops.py, tests/test_tray_files.py (offscreen Qt: listing, navigation incl. drives, F5, drag in both directions, F8 with/without confirmation, command line over ssh and exec, buttons, transfer setting). Full suite: 1374 passed.
  • Live on an attached Colab web UI runtime: mkdir, scp tree up and down identical, ls --json, rm -r; the window's real QProcess runner uploaded, downloaded, ran a command and deleted; the window was tried from the tray.

🤖 Generated with Claude Code

arlinamid and others added 3 commits November 20, 2026 03:27
The pieces the tray's file manager runs as CLI subcommands:

- `colab ls --json`: one object with the path and its items (name,
  type, size, last_modified), folders first; an error is JSON too.
- `colab mkdir PATH` creates a remote folder.
- `colab rm -r PATH` removes a folder and everything in it (the contents
  API refuses a folder that is not empty), children first.
- `colab upload/download --via ssh [-i KEY]` copies with OpenSSH scp
  through `colab ssh --proxy-mode` instead of the contents API; it uses
  the default key from `ssh_identity` / COLAB_CLI_SSH_IDENTITY.

Tested live on an attached Colab web UI runtime: mkdir, a tree uploaded
and downloaded back identical over scp, ls --json, rm -r.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Files button of a local card opens a Total Commander style window:
this computer on the left (drive list, Up), the runtime on the right
from /content. Drag and drop, the Upload/Download buttons or F5 copy
between them; F7 makes a folder, F8 deletes (local files go to the
recycle bin, remote ones after a confirmation), Enter or double-click
opens, Backspace goes up. The line at the bottom runs a command in the
runtime's folder: `colab ssh -- sh -c` over ssh, otherwise `colab exec`
with Python on stdin, so it works without an SSH key.

Transfers go over the contents API or ssh/scp, chosen at the top and
saved as `tray_transfer` in settings.json. Every action is one of the
CLI's own subcommands (ls --json, upload/download -r --via, mkdir,
rm -r, ssh, exec), run one at a time with QProcess.

Tested live: the window's runner uploaded, downloaded, ran a command and
deleted on an attached Colab web UI runtime, and the window was tried
from the tray (a locked system file reported its permission error).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ime is gone

- Progress: a bar with files done / total, the file being copied and the
  time. `colab upload/download --progress` prints one line per file
  (ContentsClient.upload_dir/download_dir take an on_file hook); scp
  shows a moving bar and the time.
- Cancel: stops the running command and drops the waiting ones. The
  whole process tree is stopped (taskkill /T on Windows, where scp would
  outlive the CLI; SIGTERM elsewhere, on which `--via ssh` kills scp).
  The output says what is left for each transfer mode.
- When the runtime is gone (the tray's refresh no longer has it, or a
  command prints "Session not found"), a red banner says so, waiting
  commands are dropped and the remote side is disabled; the local pane
  keeps working, and the window comes back if the runtime does.
- A failed or cancelled scp warns that the target may be cut short.
- docs/09 section 5 documents the window in full; the README has user
  sections for the file manager and for runtimes from the Colab web UI.

Tested live: per-file progress on a 30-file upload; cancel over the
contents API (stopped at 7 of 60 files) and over scp (no scp.exe left);
the banner after `colab stop` with the window open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@arlinamid arlinamid changed the title feat(tray): Total Commander style file manager; ls --json, mkdir, rm -r, --via ssh feat(tray): Total Commander style file manager (progress, cancel, gone-runtime banner); ls --json, mkdir, rm -r, --via ssh, --progress Nov 20, 2026
@arlinamid

Copy link
Copy Markdown
Owner Author

Added after review: progress bar (files done / total via upload/download --progress), Cancel (stops the whole process tree, so scp does not keep copying on Windows), a red banner and read-only remote side when the runtime is gone, a cut-short warning after a failed or cancelled scp, and full docs (docs/09 section 5, README sections). Live: 30-file upload progress, cancel over contents (7/60) and scp (no scp.exe left), banner after colab stop. Full suite 1387 passed.

@arlinamid
arlinamid merged commit e4f63ce into main Nov 20, 2026
4 checks passed
arlinamid added a commit that referenced this pull request Nov 20, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant