Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update the discovery_path for macos + misc refactors #67

Merged
merged 4 commits into from
Feb 3, 2025

Conversation

0xbrayo
Copy link
Member

@0xbrayo 0xbrayo commented Feb 3, 2025

Important

Update macOS discovery path and refactor module management in lib.rs and manager.rs.

  • Behavior:
    • Update discovery_path for macOS in Defaults::default() in lib.rs to /Applications/ActivityWatch.app/Contents/MacOS.
    • Optimize autostart logic in run() in lib.rs by checking state before enabling/disabling.
  • Refactors:
    • Rename get_modules_in_path() to discover_modules() in manager.rs and lib.rs.
    • Rename modules_in_path to modules_discovered in ManagerState in manager.rs.
    • Reorganize imports in manager.rs for clarity.
  • Misc:
    • Add TODO comment in run() in lib.rs suggesting concurrent setup to improve startup time.

This description was created by Ellipsis for 4e992da. It will automatically update as commits are pushed.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 4e992da in 54 seconds

More details
  • Looked at 164 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 9 drafted comments based on config settings.
1. src-tauri/src/lib.rs:212
  • Draft comment:
    Using cfg!(target_os = "linux") ensures discoveryPath is only set on Linux. Ensure this meets your intent for macOS support since now it's handled separately below.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    None
2. src-tauri/src/lib.rs:333
  • Draft comment:
    TODO comment notes potential concurrent setup improvements. Consider opening an issue or providing more context for a future refactor.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    None
3. src-tauri/src/lib.rs:358
  • Draft comment:
    Typo in error message: 'autosart' should be 'autostart'.
  • Reason this comment was not posted:
    Comment was on unchanged code.
4. src-tauri/src/lib.rs:212
  • Draft comment:
    Using cfg!(target_os = "linux") means only Linux is handled; other Unix (e.g. BSD) will fall into the default branch. Confirm this is intended.
  • Reason this comment was not posted:
    Comment did not seem useful.
5. src-tauri/src/lib.rs:219
  • Draft comment:
    Hardcoding the macOS discovery path; ensure this path suits all deployment scenarios on macOS.
  • Reason this comment was not posted:
    Comment did not seem useful.
6. src-tauri/src/lib.rs:354
  • Draft comment:
    When disabling autostart, consider checking its state first (as done in the enable branch) and fix the typo 'autosart' to 'autostart'.
  • Reason this comment was not posted:
    Marked as duplicate.
7. src-tauri/src/manager.rs:56
  • Draft comment:
    Renaming 'modules_in_path' to 'modules_discovered' clarifies intent; ensure associated docs/tests reflect the change.
  • Reason this comment was not posted:
    Comment did not seem useful.
8. src-tauri/src/manager.rs:347
  • Draft comment:
    Renaming function from 'get_modules_in_path()' to 'discover_modules()' improves clarity; verify consistent usage across platforms.
  • Reason this comment was not posted:
    Comment did not seem useful.
9. src-tauri/src/manager.rs:362
  • Draft comment:
    Consider handling errors from directory reads explicitly instead of silently ignoring them when discovering modules.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_axEPs1NUcuW1Npas


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@0xbrayo 0xbrayo merged commit d2544cd into ActivityWatch:master Feb 3, 2025
5 checks passed
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