Repository navigation
Opt-in activity reader and setting (step 1 of #195) - #196
Merged
Merged
Conversation
Before: the UI check could not start the window. Now: it starts the Vite dev server with the fake backend and opens Settings and Groups.
Before: the UI check needed pnpm on the machine. Now: it runs pnpm 9 through npx.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #195
What it does
An opt-in setting, off by default, "Share activity and presence". Step 1 is local only: it reads how long since the last keyboard or mouse input and writes it to
<state>/activity.json. Nothing is sent to other machines yet (step 2).crates/core/src/activity.rs:idle_seconds()(WindowsGetLastInputInfo, macOS IOKitHIDIdleTime, other systemsunknown), a pureTracker(active below 120 s, idle from 120 s, write on change or every 300 s) and a 30 s loop.choices.rs:activity { share, ts },set_activity, merged by its ownts.activity status|enable|disable [--json]; the daemon and the app run the loop.app/ui/src/activity-consent.ts), Tauri commandsget_activity/set_activity, fake backend.Idle cost
One OS call per 30 s, 0 to 12 small local writes per hour, no network. While sharing is off the loop only reads the local choices file.
Checks run (Ubuntu 24 on WSL2)
cargo fmt --all -- --check: exit 0cargo clippy -p claude-sync-core -p claude-sync-cli --no-default-features --all-targets -- -D warnings: exit 0cargo test -p claude-sync-core --no-default-features -p claude-sync-cli: exit 0, 534 core tests, 28 cli unit tests and the newtests/activity.rs, 0 failedpnpm -C app/ui test: 30 passed;pnpm -C app/ui build(tsc and vite): exit 0