Skip to content

Commit 9fd827d

Browse files
committed
fix: only show DeviceSyncing when completion > 0, seed activity includes syncing devices
1 parent d88ec0b commit 9fd827d

3 files changed

Lines changed: 64 additions & 41 deletions

File tree

README.md

Lines changed: 61 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,48 @@ A terminal UI for [Syncthing](https://syncthing.net) — keeps a single `~/meshd
55
## What it looks like
66

77
```
8-
Dashboard ////////////////////////////////////////////////////
9-
mini-peer ● Online
10-
work-mac ○ Offline
11-
12-
─────────────────────────────────────────────────────────────
13-
meshd/ ✓ 3 items, all in sync
14-
15-
✓ 📁 projects/
16-
✓ 📄 notes.md
17-
✓ 📄 photo.jpg
8+
meshd | mini Up to Date
9+
────────────────────────────────────────────────────────────
10+
Dashboard ///////////////////////////////////////////////////
11+
mini ◎ ● Online
12+
MacBook ↻ 73%
13+
Phone ○ Offline last seen 2h ago
14+
15+
meshd ///////////////////////////////////////////////////////
16+
.stignore ✓ 3:04 PM
17+
projects/ ✓ May 19
18+
notes.md ↻ 2:34 PM
19+
photo.jpg ! May 15 ← conflict
1820
```
1921

2022
## Features
2123

22-
- **Single folder**`~/meshd` is auto-created and registered with Syncthing on first run
23-
- **Dashboard** — devices with live status (online/pending/offline) + file tree with sync indicators
24-
- **Connections** — accept or dismiss pending devices, view full device IDs
25-
- **CLI**`meshd id`, `meshd status --json`, `meshd devices`, `meshd doctor`
26-
- **MCP server** — Claude can check sync state, list files, add devices via `meshd mcp`
27-
- **Any file, any size** — Syncthing uses block-level transfer (only changed bytes move)
28-
- **Bidirectional** — both machines always have an identical copy
24+
- **Single folder**`~/meshd` auto-created and registered with Syncthing on first run
25+
- **Live monitoring** — event-driven updates, no polling delay
26+
- **Device completion %** — shows `↻ 73%` per device when syncing, not just Online/Offline
27+
- **Conflict detection**`.sync-conflict-*` files flagged with `!` badge immediately
28+
- **Last seen** — offline devices show "last seen 2h ago"
29+
- **Activity log** — timestamped event feed: connects, syncs, errors
30+
- **Connect screen** — accept/dismiss pending devices, rename devices inline
31+
- **Header spinner**`⠹ Syncing 73% · notes.md` shows exactly what's transferring
32+
- **MCP server** — Claude can query state, trigger scans, pause/resume sync
33+
- **Any file, any size** — block-level transfer, both machines always have identical copies
2934

3035
## Requirements
3136

3237
- [Syncthing](https://syncthing.net) installed and running
3338

3439
## Install
3540

36-
**macOS (Homebrew tap):**
41+
**Go install (all platforms):**
3742
```bash
38-
brew tap gitcoder89431/meshd
39-
brew install meshd
43+
go install github.com/gitcoder89431/meshd/cmd/meshd@latest
4044
```
4145

42-
**Go install (all platforms):**
46+
**macOS (Homebrew tap):**
4347
```bash
44-
go install github.com/gitcoder89431/meshd/cmd/meshd@latest
48+
brew tap gitcoder89431/meshd
49+
brew install meshd
4550
```
4651

4752
**From source:**
@@ -61,11 +66,12 @@ meshd
6166

6267
**macOS:**
6368
```bash
69+
brew install syncthing
6470
brew services start syncthing
6571
meshd
6672
```
6773

68-
meshd reads the Syncthing API key automatically from the default config location — no manual setup. On first launch it creates `~/meshd` and registers it with Syncthing.
74+
meshd reads the Syncthing API key automatically — no manual setup. On first launch it creates `~/meshd` and registers it with Syncthing.
6975

7076
Run `meshd doctor` to verify everything is working.
7177

@@ -75,9 +81,13 @@ Run `meshd doctor` to verify everything is working.
7581
meshd launch the TUI
7682
meshd id print this machine's Syncthing device ID
7783
meshd status show devices + file sync state
78-
meshd status --json machine-readable output (for scripts / quickshell widgets)
79-
meshd devices list all paired devices with their IDs
80-
meshd doctor check Syncthing connection and meshd folder health
84+
meshd status --json machine-readable output (scripts / quickshell widgets)
85+
meshd devices list all paired devices with IDs
86+
meshd scan trigger immediate rescan of ~/meshd
87+
meshd pause pause syncing
88+
meshd resume resume syncing
89+
meshd errors show file-level sync errors
90+
meshd doctor check Syncthing connection and folder health
8191
meshd mcp start MCP stdio server for Claude integration
8292
```
8393

@@ -93,19 +103,21 @@ meshd mcp start MCP stdio server for Claude integration
93103

94104
1. Run `meshd id` on this machine — copy the device ID
95105
2. Install Syncthing + meshd on the other machine, run `meshd id` there
96-
3. Add each machine's ID to the other via Syncthing web UI or `meshd mcp``add_device`
97-
4. The new machine appears as **Pending** in the Connections screen — press `a` to accept
98-
5. Both machines now share `~/meshd` automatically
106+
3. Add each machine's ID to the other via `meshd mcp``add_device`, or the Connect screen
107+
4. The new machine appears as **Pending** in Connect — press `a` to accept
108+
5. Both machines share `~/meshd` automatically
99109

100110
## Keybindings
101111

102112
| Key | Action |
103113
|-----|--------|
104-
| `j` / `` | Move down |
105-
| `k` / `` | Move up |
106-
| `r` | Force refresh |
107-
| `a` | Accept pending device (Connections screen) |
108-
| `d` | Dismiss pending device (Connections screen) |
114+
| `j` / `` | Navigate down |
115+
| `k` / `` | Navigate up |
116+
| `enter` | Open selected file/folder in terminal |
117+
| `r` | Rename device (Connect screen) / refresh (Activity) |
118+
| `a` | Accept pending device |
119+
| `d` | Dismiss pending device |
120+
| `s` | Toggle sidebar |
109121
| `ctrl+k` | Command palette |
110122
| `?` | Help |
111123
| `q` / `ctrl+c` | Quit |
@@ -122,7 +134,18 @@ Add to `~/.claude.json`:
122134
}
123135
```
124136

125-
Available tools: `get_status`, `list_files`, `list_devices`, `get_device_id`, `add_device`
137+
| Tool | What it does |
138+
|------|-------------|
139+
| `get_status` | Devices + file list with sync state |
140+
| `list_devices` | All paired devices with status |
141+
| `get_device_id` | This machine's device ID |
142+
| `list_files` | Files in ~/meshd with sync indicators |
143+
| `add_device` | Accept/add a device by ID |
144+
| `trigger_scan` | Force immediate rescan |
145+
| `pause_sync` | Pause syncing |
146+
| `resume_sync` | Resume syncing |
147+
| `get_errors` | File-level sync errors |
148+
| `get_activity` | Recent events log |
126149

127150
## Stack
128151

@@ -140,11 +163,10 @@ meshd doctor # health check
140163

141164
## Release
142165

143-
GoReleaser via GitHub Actions on tag push. Publishes to GitHub Releases + Homebrew tap.
166+
GoReleaser via GitHub Actions on tag push.
144167

145-
> **Note:** Homebrew tap requires a `homebrew-meshd` repo at `github.com/gitcoder89431/homebrew-meshd`
146-
> and a `HOMEBREW_TAP_TOKEN` secret in the repo settings. Until then, use `go install` or download
147-
> a binary from the Releases page.
168+
> **Homebrew tap** requires a `homebrew-meshd` repo at `github.com/gitcoder89431/homebrew-meshd`
169+
> and a `HOMEBREW_TAP_TOKEN` secret. Until then use `go install` or download from Releases.
148170
149171
```bash
150172
git tag v0.1.0 && git push origin v0.1.0

internal/app/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ func seedActivity(devices []syncthing.Device, fs syncthing.FolderStatus) []scree
367367
now := time.Now()
368368
var entries []screens.ActivityEntry
369369
for _, d := range devices {
370-
if d.Status == syncthing.DeviceOnline {
370+
if d.Status == syncthing.DeviceOnline || d.Status == syncthing.DeviceSyncing {
371371
entries = append(entries, screens.ActivityEntry{
372372
Time: now,
373373
Icon: "●",

internal/syncthing/client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ func (c *Client) GetDevices() ([]Device, error) {
177177
var comp apiCompletion
178178
if err := c.get("/rest/db/completion?folder="+MeshdFolderID+"&device="+d.DeviceID, &comp); err == nil {
179179
completion = comp.Completion
180-
if completion < 100 {
180+
// only mark syncing if there's actual progress to show (0 means folder not shared or nothing to sync)
181+
if completion > 0 && completion < 100 {
181182
s = DeviceSyncing
182183
}
183184
}

0 commit comments

Comments
 (0)