Skip to content

[Tauri Simulator] : Add menu options for File tab in desktop version#740

Merged
tachyons merged 2 commits intoCircuitVerse:mainfrom
ShinichiShi:fix-issue-721
Jan 11, 2026
Merged

[Tauri Simulator] : Add menu options for File tab in desktop version#740
tachyons merged 2 commits intoCircuitVerse:mainfrom
ShinichiShi:fix-issue-721

Conversation

@ShinichiShi
Copy link
Contributor

@ShinichiShi ShinichiShi commented Jan 8, 2026

Fixes #721

Describe the changes you have made in this PR -

This PR adds the File menu options which was missing initially. The implementation of these options has already been done

Screenshots of the changes (If any) -

image

Note: Please check Allow edits from maintainers. if you would like us to assist in the PR.

Summary by CodeRabbit

  • New Features
    • File menu is now accessible with essential options: New Circuit, Save, Save Online, and Open.
    • Added visual separators between menu item groups for improved organization.

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify
Copy link

netlify bot commented Jan 8, 2026

Deploy Preview for circuitverse ready!

Name Link
🔨 Latest commit 5167bed
🔍 Latest deploy log https://app.netlify.com/projects/circuitverse/deploys/695f94c8587e9f00087bc357
😎 Deploy Preview https://deploy-preview-740--circuitverse.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 45 (🟢 up 23 from production)
Accessibility: 73 (no change from production)
Best Practices: 92 (no change from production)
SEO: 82 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

Walkthrough

The File submenu implementation was updated to display menu items instead of remaining hidden. The submenu now includes four action items: new-circuit, save-offline, save-online, and open-offline, organized with separators between logical groups. The menu construction flow, including hide-others and show-all operations, remains intact. This modification applies to the menu structure during debug builds and affects how the application handles menu events for these file operations.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully addresses issue #721 by removing the .hide() call and populating the File submenu with the required menu items (New Circuit, Save, Save Online, Open).
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the File menu visibility issue in the Tauri simulator as required by issue #721; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title accurately describes the main change: adding File tab menu options to the Tauri desktop simulator. It is clear, concise, and directly reflects the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src-tauri/src/lib.rs (1)

82-176: Consider refactoring the event handler for better maintainability.

The long if-else chain could be simplified using a match statement or by extracting the common emit-and-log pattern into a helper function. This would reduce duplication and improve readability.

♻️ Example refactor using a helper function
// Add before the on_menu_event call
fn emit_menu_event(app: &tauri::AppHandle, event_id: &str) {
    if let Err(e) = app.emit(event_id, ()) {
        eprintln!("Error emitting event: {}", e);
    }
}

// Then simplify the handler
app.on_menu_event(move |app, event| {
    let event_id = event.id().as_ref();
    match event_id {
        "new-project" | "save-online" | "save-offline" | "open-offline" |
        "export" | "import" | "clear" | "recover" | "preview-circuit" |
        "previous-ui" | "new-circuit" | "new-verilog-module" |
        "insert-sub-circuit" | "combinational-analysis" | "hex-bin-dec" |
        "download-image" | "themes" | "custom-shortcut" | "export-verilog" |
        "tutorial" | "user-manual" | "learn-digital-logic" | "discussion-forum"
            => emit_menu_event(&app, event_id),
        _ => {}
    }
});
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f071795 and 5167bed.

📒 Files selected for processing (1)
  • src-tauri/src/lib.rs
🔇 Additional comments (3)
src-tauri/src/lib.rs (3)

18-24: LGTM! File menu options are now visible.

The added menu items correctly address issue #721 by populating the File submenu instead of hiding it. All items (new-circuit, save-offline, save-online, open-offline) have corresponding event handlers in place.


10-177: Verify: Confirm menu availability for release builds.

The entire menu setup is guarded by if cfg!(debug_assertions), meaning release builds will have no menu bar. Confirm whether this is intentional (e.g., headless/API-only release builds) or whether menus should be available in production. If menus are required for end users, move the menu setup outside the debug assertion or create a separate configuration for release builds.


18-18: Both the File and Circuit menus correctly use the "new-circuit" ID to trigger the same action. The frontend listener emits the event to call createNewCircuitScope(), which both menu items are intended to trigger. The "+" suffix in the Circuit menu label is a UI convention indicating "add new"—not a signal of different functionality.

@tachyons
Copy link
Member

tachyons commented Jan 8, 2026

Please add meaningful PR title

@ShinichiShi
Copy link
Contributor Author

Please add meaningful PR title

Sorry about that🥲

Updating it

@ShinichiShi ShinichiShi changed the title Fix issue 721 [Tauri Simulator] : Add menu options for File tab in desktop version Jan 8, 2026
@tachyons
Copy link
Member

tachyons commented Jan 9, 2026

Does these buttons actually work ? Could ou add a screencast ?

@ShinichiShi
Copy link
Contributor Author

Does these buttons actually work ? Could ou add a screencast ?

Sure, here is the screencast, apparently the options exist and work as expected but i found a set of bugs related to these.

  • Upon performing the save option, the message says circuit saved in your browser's local storage. This is because tauri uses the existing vue-simulator which is originally designed for web. We can have it to store in the desktop app's local cache?
  • the open option lists the saved circuits, but doesnt really open the circuit in the simulator
  • the save online, redirects user to sign in and doesnt redirect back to the simulator. There isnt an option to cancel this process also.

I would like to fix this by raising issues for them separately or in this same issue. How shall i proceed with this ? 😄

Screencast.from.2026-01-09.08-41-39.webm

@ShinichiShi
Copy link
Contributor Author

also these options exists in other tabs also, so these may be redundant

  • New circuit palready resent in Circuit tab
  • Save and Save online present in Project Tab already under Save offline and Save online naming
  • only open option isnt found anywhere

But the bugs i mentioned above persist in these existing options also.

image image
image

@tachyons
Copy link
Member

Sure, please create separate issues for each menu items which aren't working as expected

@ShinichiShi
Copy link
Contributor Author

Sure, please create separate issues for each menu items which aren't working as expected

Doing so :))

@tachyons tachyons merged commit e156a10 into CircuitVerse:main Jan 11, 2026
10 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.

🐞 Bug: Missing 'File' Menu options in Tauri Simulator

2 participants