PictoPy icon indicating copy to clipboard operation
PictoPy copied to clipboard

DOC: Update Rust backend API documentation for Tauri v2 and missing IPC commands

Open Prakhar1808 opened this issue 1 month ago • 7 comments

What's wrong with the existing documentation

Currently, docs/backend/backend_rust/api.md contains several critical inaccuracies and is severely out of date:

  1. Outdated Tauri v1 API imports: The usage example imports invoke from @tauri-apps/api/tauri (Tauri v1), whereas PictoPy has migrated to Tauri v2 where commands must be invoked via @tauri-apps/api/core.
  2. Broken code example: The example references an undefined variable serverPath instead of resourcesFolderPath (console.log("Resources folder path:", serverPath)), causing a runtime ReferenceError when executed.
  3. Missing 12 of 13 registered IPC commands: The documentation only lists get_resources_folder_path. The remaining 12 commands defined and registered in frontend/src-tauri/src/main.rs (invoke_handler!) are completely undocumented:
    • File System / Media: open_image_file
    • Reverse Tunnel Service: tunnel_start, tunnel_stop, tunnel_status
    • Window & UI Management: open_model_manager, get_close_to_tray, set_close_to_tray
    • System Autostart: enable_autostart, disable_autostart, is_autostart_enabled
    • Memories Service: open_memory, take_pending_memory
  4. Missing Event Bus Documentation: Undocumented native desktop events (memory:pending, memory:open) emitted from Rust to the frontend webview.

Proposed Solution

Update docs/backend/backend_rust/api.md to:

  • Migrate frontend code samples to Tauri v2 syntax (import { invoke } from '@tauri-apps/api/core';).
  • Fix the broken variable reference in get_resources_folder_path.
  • Document all 13 commands with Rust signatures, source file locations, parameters, return types, and TypeScript usage examples.
  • Document background IPC events (memory:pending, memory:open) and their frontend subscription pattern with listen.
  • Ensure clean compliance with repository markdown linting (.github/.markdownlint-cli2.jsonc).

Record

  • [x] I agree to follow this project'''s Code of Conduct
  • [x] I want to work on this issue

Prakhar1808 avatar Oct 26 '26 14:10 Prakhar1808

👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)

github-actions[bot] avatar Oct 26 '26 14:10 github-actions[bot]

⚠️ Potential Duplicate Issue (Semantic Match)

This issue appears semantically similar to the following issues in AOSSIE-Org/PictoPy:

  1. Remove unwanted Tauri code and update documentation (#511, closed) https://github.com/AOSSIE-Org/PictoPy/issues/511 Similarity: 67.5%

  2. Good First Issue: Change Tauri/Rust docs to match the current state of the repository (#358, closed) https://github.com/AOSSIE-Org/PictoPy/issues/358 Similarity: 67.2%

  3. BUG: HTTP requests fail - missing tauri-plugin-http in Tauri v2 (#1087, open) https://github.com/AOSSIE-Org/PictoPy/issues/1087 Similarity: 64.9%

Please review before proceeding.

github-actions[bot] avatar Oct 26 '26 15:10 github-actions[bot]

@Prakhar1808 can i work on this if its not assigned to anyone?

RitikaSen27 avatar Oct 27 '26 11:10 RitikaSen27

@Prakhar1808 can i work on this if its not assigned to anyone?

it has not been validated or approved by the maintainers yet, i would again encourage you to check the beta release to find bugs, there's plenty to work on in PROD

Prakhar1808 avatar Oct 28 '26 03:10 Prakhar1808

@Prakhar1808 I would like to work on this issue can you please assign it to me if its not assigned to anyone ?

swastiksharma45 avatar Oct 29 '26 13:10 swastiksharma45

hey @swastiksharma45 the issue is still not approved by the maintainers and i myself am working on this, you should check the beta of pictopy to find more issues

Prakhar1808 avatar Oct 30 '26 08:10 Prakhar1808

i'm working on this, i'll raise a PR asap

Prakhar1808 avatar Nov 15 '26 12:11 Prakhar1808