Skip to content

feat(remote): push desktop directory changes to mobile/web via presence - #53

Merged
tallcode merged 7 commits into
mainfrom
claude/infallible-ellis-baf469
Jul 27, 2026
Merged

tallcode merged 7 commits into
mainfrom
claude/infallible-ellis-baf469

Conversation

@tallcode

Copy link
Copy Markdown
Collaborator

Summary

  • Mobile Chats empty states: Distinguish offline (show desktop-sleep hint, hide FAB) from connected-but-empty (show create-CTA, keep FAB).
  • Real-time directory sync: Desktop store write paths (threads/workspaces/runs) set a catalog dirty flag; remote presence heartbeat runs at 1s, compares a length-prefixed signature of the full directory snapshot, and publishes a full snapshot on change or a tiny liveness payload every 20s when idle.
  • Mobile + web sync: onPresence applies the full snapshot to local sessions/workspaces and self-heals when the selected session is deleted. Mobile closeConversation also refreshes the list as a backstop.
  • Chat input padding: Increased horizontal/top/bottom padding for a more spacious composer.

Why

Previously, deleting a conversation or workspace on the desktop left stale entries on mobile and web until reconnect/restart. Presence was the only authorized push channel (NATS permissions are explicit, not wildcarded), so we extended it with a full directory snapshot + signature compare rather than introducing a new subject.

Reviewer notes

  • NATS permissions unchanged (still evt.>/rep.>/presence).
  • Correctness does not depend on the dirty flag — the 20s heartbeat recomputes the signature and self-heals any missed mark.
  • Streaming state is included in the snapshot, so blue dots and send/stop button stay in sync.
  • No DB schema changes, no i18n additions.

Verification

  • cd gui/src-tauri && cargo check passes.
  • cd mobile && npm run check passes (typecheck + lint + prettier + 14 tests).
  • End-to-end: delete a conversation on desktop → mobile/web remove it within ~1s; idle traffic is a tiny presence heartbeat every 20s.

🤖 Generated with Claude Code

tallcode and others added 5 commits July 27, 2026 15:53
When the desktop is offline, show a disconnected empty state with a sleep/disconnect hint and hide the new-conversation FAB. When connected but empty, prompt to create a new conversation with an inline CTA while keeping the FAB.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Dirty-flag catalog tracking in store write paths (threads/workspaces/runs), 1s presence heartbeat with signature compare, light/full snapshot switching, 20s self-heal fallback. Mobile + web onPresence sync directory from full snapshots with self-heal on selected-session deletion. closeConversation also refreshes the list as a backstop.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@tallcode
tallcode enabled auto-merge (squash) July 27, 2026 09:49
tallcode and others added 2 commits July 27, 2026 18:00
Only used internally via super::util::*; external callers only need take_catalog_dirty.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@tallcode
tallcode merged commit bafd62a into main Jul 27, 2026
16 checks passed
@tallcode
tallcode deleted the claude/infallible-ellis-baf469 branch July 27, 2026 10:09
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