Skip to content

Conversation

@naman79820
Copy link
Contributor

@naman79820 naman79820 commented Feb 1, 2026

Fixes #910

Describe the changes you have made in this PR -

The help button wasn't working in the desktop app because window.open() is not supported in Tauri. Implemented a solution using Tauri's WebviewWindow to open documentation in a new window within the app, with a fallback to window.open() for the web version.

Screenshots of the UI changes (If any) -

Desktop.2026.02.03.-.01.15.03.02.mp4

Code Understanding and AI Usage

Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?

  • No, I wrote all the code myself
  • Yes, I used AI assistance (continue below)

If you used AI assistance:

  • I have reviewed every single line of the AI-generated code
  • I can explain the purpose and logic of each function/component I added
  • I have tested edge cases and understand how the code handles them
  • I have modified the AI output to follow this project's coding standards and conventions

Explain your implementation approach:
Since window.open() doesn't work in Tauri, I used the WebviewWindow API to open help documentation in a new Tauri window. This avoids security concerns with the shell plugin while maintaining functionality. The solution detects the Tauri environment and opens docs accordingly, with a web fallback for browser use.


Checklist before requesting a review

  • I have added proper PR title and linked to the issue
  • I have performed a self-review of my code
  • I can explain the purpose of every function, class, and logic block I added
  • I understand why my changes work and have tested them thoroughly
  • I have considered potential edge cases and how my code handles them
  • If it is a core feature, I have added thorough tests
  • My code follows the project's style guidelines and conventions

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

Summary by CodeRabbit

  • New Features
    • Help button now opens help links in a dedicated in-app webview window on desktop, with fallback to the browser.
  • Chores
    • Added a desktop permission enabling creation of in-app webview windows to support the new help behavior.

@netlify
Copy link

netlify bot commented Feb 1, 2026

Deploy Preview for circuitverse ready!

Name Link
🔨 Latest commit 50d0587
🔍 Latest deploy log https://app.netlify.com/projects/circuitverse/deploys/6982318b6624fd0008fa32ec
😎 Deploy Preview https://deploy-preview-911--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: 44 (🔴 down 4 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 Feb 1, 2026

Walkthrough

Added the permission string "core:webview:allow-create-webview-window" to src-tauri/capabilities/default.json. Updated src/components/Panels/Shared/HelpButton.vue to compute the helplink reactively, change helpButtonClick to async, detect the Tauri runtime, and — when running under Tauri — attempt to open the helplink in a new WebviewWindow (with a generated id and specified size), falling back to window.open on failure. Non‑Tauri (web) behavior continues to use window.open.

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR contains an out-of-scope change: package-lock.json and cargo.lock were added but are not required to fix the Help button issue. Remove package-lock.json and cargo.lock from the PR as they are dependency lock files unrelated to fixing the Help button functionality.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately and concisely describes the main fix—implementing Help button functionality in the Tauri desktop app.
Linked Issues check ✅ Passed The PR fully addresses issue #910 by implementing Tauri WebviewWindow API to open documentation and providing fallback for web version.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

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

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Failure to add the new IP will result in interrupted reviews.


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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
package.json (1)

59-59: ⚠️ Potential issue | 🟠 Major

cross-env version incompatible with Node 18.

The cross-env package at version ^10.1.0 requires Node >= 20, but this repository uses Node 18. This will cause installation or runtime failures in Node 18 environments.

Based on learnings: "In Node 18 environments (e.g., this repo cv-frontend-vue), pin cross-env to 7.x (e.g., ^7.0.3) because cross-env 10.x requires Node >= 20."

Proposed fix
-    "cross-env": "^10.1.0",
+    "cross-env": "^7.0.3",
🤖 Fix all issues with AI agents
In `@src/components/Panels/Shared/HelpButton.vue`:
- Line 15: Replace the top-level static import of open from
'@tauri-apps/plugin-shell' with a runtime check using isTauri() and a dynamic
import so bundlers don't try to load Tauri in web builds; locate the HelpButton
component (HelpButton.vue) where open is referenced, remove the top-level
"import { open } ..." and instead, inside the click handler or setup code that
triggers opening, call isTauri() and if true await
import('@tauri-apps/plugin-shell') to get the open function and call it,
otherwise run the web fallback; ensure you handle import errors with try/catch
and keep the same call signature where open(...) is used.
🧹 Nitpick comments (1)
src/components/Panels/Shared/HelpButton.vue (1)

23-31: Consider logging the error for debugging purposes.

Silently swallowing the error makes it harder to diagnose issues. Adding a console warning would help developers understand when and why the fallback is triggered.

Proposed improvement
 async function helpButtonClick() {
 	if (!helplink) return
 	
 	try {
 		await open(helplink)
 	} catch (error) {
 		// Fallback for web version
+		console.warn('Tauri shell open failed, using window.open fallback:', error)
 		window.open(helplink, '_blank')
 	}
 }

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: 1

🤖 Fix all issues with AI agents
In `@src/components/Panels/Shared/HelpButton.vue`:
- Around line 15-31: The component currently snapshots props.obj?.helplink into
the plain constant helplink, so updates to the parent-mutated object are not
reflected; change helplink to a Vue computed that returns props.obj?.helplink
(import computed from 'vue') and update uses in helpButtonClick to read the
computed's value (e.g., helplink.value) and guard against undefined; keep the
existing isTauri/open logic but reference the computed instead of the original
constant.

@naman79820
Copy link
Contributor Author

Ready to be reviewed @tachyons @ThatDeparted2061 @Nihal4777

@naman79820
Copy link
Contributor Author

naman79820 commented Feb 1, 2026

Currently i have added package-lock.json and cargo.lock as well in it

@naman79820 naman79820 force-pushed the fix/help-button-tauri branch from 47c0808 to d84f7f2 Compare February 2, 2026 19:40
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: 1

🤖 Fix all issues with AI agents
In `@src/components/Panels/Shared/HelpButton.vue`:
- Around line 29-35: Wrap the WebviewWindow construction inside a try/catch when
isTauri() returns true to handle failures from missing permissions or invalid
URLs; update the code around the WebviewWindow call (the new WebviewWindow(...)
expression in HelpButton.vue / the isTauri() block) to catch errors, log the
error (e.g., console.error or your app logger) and surface a user-friendly
fallback (toast, alert, or opening the link externally) so the user gets
feedback instead of silent failure.

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: 2

🤖 Fix all issues with AI agents
In `@src/components/Panels/Shared/HelpButton.vue`:
- Around line 25-52: Remove the duplicate/orphaned helpButtonClick definition
and keep the single complete implementation that uses helplink, isTauri, and
WebviewWindow; specifically, delete the earlier/extra async function
helpButtonClick() block and the stray closing/braced lines so only the intended
async function helpButtonClick() { const link = helplink.value ... try { new
WebviewWindow(...) } catch { window.open(...) } else { window.open(...) } }
remains.
- Around line 15-17: There are two duplicate declarations of the helpButtonClick
function (the incomplete one and the complete implementation) causing malformed
braces; remove the first incomplete helpButtonClick declaration so only the full
implementation remains, and delete any leftover dangling closing braces
associated with the removed fragment to restore correct block structure; search
for helpButtonClick and ensure the remaining async function uses the
WebviewWindow creation + try/catch fallback as intended.

@naman79820 naman79820 force-pushed the fix/help-button-tauri branch from 26fc0a2 to 898b11e Compare February 2, 2026 20:00
@naman79820
Copy link
Contributor Author

Hii @tachyons ready to be reviewed once again although currently ci is stuck on "waiting to run this check"
Ci passed locally

@naman79820 naman79820 requested a review from tachyons February 2, 2026 20:07
@naman79820
Copy link
Contributor Author

naman79820 commented Feb 3, 2026

all checks passed ready for review :))

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: “Help” button does not work for any circuit element in Tauri app

2 participants