[Tauri Simulator] : Add menu options for File tab in desktop version#740
[Tauri Simulator] : Add menu options for File tab in desktop version#740tachyons merged 2 commits intoCircuitVerse:mainfrom
Conversation
✅ Deploy Preview for circuitverse ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughThe 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)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 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 callcreateNewCircuitScope(), 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.
|
Please add meaningful PR title |
Sorry about that🥲 Updating it |
|
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.
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 |
|
Sure, please create separate issues for each menu items which aren't working as expected |
Doing so :)) |




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) -
Note: Please check Allow edits from maintainers. if you would like us to assist in the PR.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.