Let the Dropbox panel pause and resume syncing

Click the Dropbox hero icon to pause or resume the daemon (dropbox-cli
stop/start), with a tooltip on hover. When paused, both the hero and the
bar icon grey out and the phrase reads "Syncing paused". The greying is
optimistic so it reacts the instant you click, then reconciles with the
real daemon state once it settles (reverting if the command failed).

Also fix status.py's running detection, which was stuck reporting true:
this dropbox-cli inverts the `running` exit code and reports "isn't
running" (not "not running") when stopped, so the paused state never
showed. Detection now keys off the status text alone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-07-20 14:00:50 -07:00
co-authored by Claude Opus 4.8
parent ff1d1c325e
commit a7c0d0f6a1
3 changed files with 113 additions and 14 deletions
+4 -4
View File
@@ -99,11 +99,11 @@ def main():
running = False
status_text = "Not installed"
if dropbox_cli:
running_exit, _ = command_output([dropbox_cli, "running"])
status_exit, status_output = command_output([dropbox_cli, "status"])
status_text = status_output if status_exit == 0 and status_output else ("Running" if running else "Stopped")
stopped = "not running" in status_text.lower() or status_text.lower() == "stopped"
running = running_exit == 0 or (status_exit == 0 and status_text != "" and not stopped)
status_text = status_output if status_exit == 0 and status_output else "Stopped"
lowered = status_text.lower()
stopped = "not running" in lowered or "isn't running" in lowered or lowered == "stopped"
running = status_exit == 0 and status_output != "" and not stopped
used, files = scan_dropbox(account_path, limit) if authenticated else (0, [])
usage_percent = (used / quota * 100) if quota > 0 else 0