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

Fix Desktop Mini Window Navbar Toggle with Custom Hamburger Component #520

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gitsofaryan
Copy link
Contributor

@gitsofaryan gitsofaryan commented Mar 10, 2025

Fixes #521

Describe the changes you have made in this PR -

  • the navbar toggle issue in desktop mini window mode, ensures that our custom component correctly triggers collapse/expand behavior for links.

Screenshots of the changes (If any) -

Recording.2025-03-10.230449.mp4

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

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced the mobile navigation experience with a new toggle button, providing a more intuitive method for revealing navigation links on smaller screens.
  • Chores

    • Updated the build process for the frontend, removing the previous desktop build script and configuration.

Copy link
Contributor

coderabbitai bot commented Mar 10, 2025

Walkthrough

The changes introduce a new mobile toggle button for the navigation bar in the Navbar.vue component, replacing the existing Hamburger component. The new button, styled as a Bootstrap navbar toggler, is conditionally rendered based on the showSidebar state and incorporates attributes for Bootstrap's collapse functionality. Additionally, the command for building the frontend in the GitHub Actions workflow has been updated, and scripts and configuration files related to the desktop build process have been removed.

Changes

Files Change Summary
v0/.../Navbar/Navbar.vue Replaced Hamburger component with a Bootstrap-styled toggle <button>; added collapse attributes; adjusted indentation for the projectName span.
.github/workflows/tauri-release.yml Updated build command from npm run desktop to npm run build in the GitHub Actions workflow.
package.json Removed script entry "desktop": "bash build-desktop.sh" from the scripts section.
src-tauri/tauri.conf.json Changed beforeBuildCommand to set DESKTOP_MODE=true before executing npm run build.
build-desktop.sh Removed the shell script that executed npx vite build --config desktop.config.ts.
desktop.config.ts Removed the Vite configuration file that included plugins for Vue, Vuetify, and internationalization.

Suggested reviewers

  • niladrix719

Poem

I'm a little rabbit, hopping in the code,
Found a shiny toggle that lightens my load.
With Bootstrap finesse and a simple click,
Navigation unfolds oh so quick!
A carrot for every commit 🥕🐰!

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 Shellcheck (0.10.0)
build-desktop.sh

build-desktop.sh: build-desktop.sh: openBinaryFile: does not exist (No such file or directory)
{"comments":[]}

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

desktop.config.ts

Oops! Something went wrong! :(

ESLint: 8.57.0

No files matching the pattern "desktop.config.ts" were found.
Please check for typing mistakes in the pattern.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Mar 10, 2025

Deploy Preview for circuitverse ready!

Name Link
🔨 Latest commit 2f09782
🔍 Latest deploy log https://app.netlify.com/sites/circuitverse/deploys/67d0709e36f2510008d44081
😎 Deploy Preview https://deploy-preview-520--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: 42
Accessibility: 75
Best Practices: 92
SEO: 80
PWA: -
View the detailed breakdown and full score reports

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

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)
v0/src/components/Navbar/Navbar.vue (1)

44-44: Unused import should be removed.

The Hamburger component is imported but no longer used in the template since it has been replaced with the Bootstrap navbar toggler button. Consider removing this unused import to keep the codebase clean.

-import Hamburger from '@/Navbar/Hamburger/Hamburger.vue'
🧰 Tools
🪛 ESLint

[error] 44-44: 'Hamburger' is defined but never used.

(no-unused-vars)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a9f309 and 89d0dc1.

📒 Files selected for processing (1)
  • v0/src/components/Navbar/Navbar.vue (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - circuitverse
  • GitHub Check: Header rules - circuitverse
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
v0/src/components/Navbar/Navbar.vue (2)

5-17: Implementation of Bootstrap navbar toggler looks good.

The addition of a standard Bootstrap navbar toggler button is a good approach for fixing the navbar toggle functionality. The implementation correctly includes the necessary Bootstrap attributes for controlling the collapse behavior (data-bs-toggle, data-bs-target), proper accessibility attributes, and conditionally renders based on the showSidebar state as intended.

This change successfully addresses the PR objective of fixing the desktop mini window navbar toggle functionality.


23-24: Indentation adjustment looks good.

This is a minor formatting change that improves code consistency without affecting functionality.

@gitsofaryan
Copy link
Contributor Author

cc : @vedant-jain03 @niladrix719

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.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

🔭 Outside diff range comments (2)
package.json (2)

6-15: ⚠️ Potential issue

Missing desktop script entry in package.json.

The PR introduces a build-desktop.sh script that should be executed with npm run desktop, but the corresponding script entry is missing in package.json.

    "scripts": {
        "serve": "vite preview",
        "build": "bash build.sh",
        "dev": "vite",
        "tauri": "tauri",
+       "desktop": "bash build-desktop.sh",
        "preview": "vite preview",
        "lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
        "format": "prettier .  --write",
        "format": "prettier .  --write",
        "postinstall": "husky install",
        "test": "vitest"

70-71: ⚠️ Potential issue

Fix JSON syntax error - extra closing brace.

There's an extra closing brace in the package.json which would make it invalid JSON.

        "vue-cli-plugin-vuetify": "~2.5.1",
        "vue-tsc": "^0.34.7"
-    },
    },
    "optionalDependencies": {
🧹 Nitpick comments (8)
package.json (3)

13-14: Remove duplicate format script entry.

There are two identical format script entries, which is unnecessary.

        "lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
        "format": "prettier .  --write",
-       "format": "prettier .  --write",
        "postinstall": "husky install",

23-25: Remove duplicate subscript extension.

The @tiptap/extension-subscript dependency is listed twice.

        "@tiptap/extension-character-count": "^2.0.3",
        "@tiptap/extension-subscript": "^2.0.3",
-       "@tiptap/extension-subscript": "^2.0.3",
        "@tiptap/extension-superscript": "^2.0.3",

54-54: Remove duplicate @vitejs/plugin-vue entry.

The @vitejs/plugin-vue package is listed twice in the devDependencies section.

        "@types/webfontloader": "^1.0.0",
        "@vitejs/plugin-vue": "^2.3.3",
-       "@vitejs/plugin-vue": "^2.3.3",
        "@vue/test-utils": "^2.4.6",
desktop.config.ts (2)

57-66: Consider removing commented code.

There are commented lines in the proxy configuration that should be either implemented or removed for cleaner code.

        proxy: {
-           // ...(process.env.NODE_ENV === 'development' && {
            '^/(?!(simulatorvue)).*': {
                target: proxyUrl,
                changeOrigin: true,
                headers: {
                    origin: proxyUrl,
                },
            },
-           // }),
        },

11-12: Remove consecutive empty lines.

There are two consecutive empty lines which can be reduced to one for better code formatting.

const proxyUrl: string = 'http://localhost:3000'

-
// https://vitejs.dev/config/
.github/workflows/tauri-release.yml (3)

26-31: Dependency Installation Step & Trailing Space
The dependency installation for both the Vue project and the Tauri CLI is correctly executed within the specified working directory (./src). However, YAMLlint has flagged a trailing space on line 30. Removing this trailing space would improve code quality.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 30-30: trailing spaces

(trailing-spaces)


32-36: Frontend Build Step & Trailing Space
The frontend build step correctly invokes the Vue build command within the proper working context. Note that YAMLlint indicates trailing spaces on line 35; removing these trailing spaces is recommended.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 35-35: trailing spaces

(trailing-spaces)


46-55: Tauri App Build Step & Trailing Space
The Tauri app build step is correctly set up using tauri-apps/tauri-action@v0 with clear configuration details such as project path, tag name, and release information. YAMLlint has flagged trailing spaces on line 49; these should be removed to comply with YAML formatting standards.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 49-49: trailing spaces

(trailing-spaces)

🛑 Comments failed to post (2)
build-desktop.sh (1)

1-2: 🛠️ Refactor suggestion

Add a shebang line to the script.

The script is missing a shebang line to specify which shell interpreter should execute it. This is important for portability and consistency.

+#!/bin/bash
 npx vite build --config desktop.config.ts
 echo "All builds completed successfully"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

#!/bin/bash
npx vite build --config desktop.config.ts
echo "All builds completed successfully"
🧰 Tools
🪛 Shellcheck (0.10.0)

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)

.github/workflows/tauri-release.yml (1)

18-20: 💡 Verification agent

🧩 Analysis chain

Checkout Repository Step Version Update
The checkout step uses actions/checkout@v3. According to static analysis (actionlint), this version may be outdated. Consider updating to a newer version (e.g., actions/[email protected] or later as recommended) for improved stability and feature support.


Update Checkout Version in Workflow
We confirmed that .github/workflows/tauri-release.yml (lines 18–20) still uses actions/checkout@v3. Static analysis via actionlint flagged this version as potentially outdated. Please consider upgrading to a newer release (for example, actions/[email protected] or later) to benefit from improved stability and new features.


🏁 Script executed:

#!/bin/bash
# Verify the current checkout action version in the tauri-release workflow
grep -R "actions/checkout@" .github/workflows/tauri-release.yml

Length of output: 97


Action Required: Update Checkout Action Version
The workflow file at .github/workflows/tauri-release.yml (lines 18–20) currently uses actions/checkout@v3. Verification confirms this version is still in use, and static analysis (actionlint) recommends updating to a newer version (e.g., actions/[email protected] or later) for enhanced stability and features.

  • Update the checkout step in .github/workflows/tauri-release.yml from actions/checkout@v3 to actions/[email protected] (or a later release).
🧰 Tools
🪛 actionlint (1.7.4)

19-19: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

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 (3)
src-tauri/tauri.conf.json (1)

6-11: Build Configuration and Cross-Platform Command Warning

The build settings are well structured and clearly define the frontend distribution and pre-build commands. However, note that the beforeBuildCommand on line 10 uses a Unix-specific command (cp) to copy files. This may cause issues when running on Windows environments. Consider using a cross-platform alternative (such as a Node.js script or a module like cpx) to ensure compatibility across all target platforms.

.github/workflows/tauri-release.yml (2)

20-20: Typographical Improvement in Comment

The inline comment on line 20 contains a minor grammatical error ("is been used"). Please update it to something like "Node 22 is being used in the CircuitVerse primary codebase" to improve clarity and professionalism.


30-30: Remove Trailing Spaces

Trailing spaces have been detected on lines 30, 35, and 49. Removing these extraneous spaces will help maintain consistency and adhere to YAML style guidelines.

Also applies to: 35-35, 49-49

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 30-30: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed73fb8 and 2f09782.

📒 Files selected for processing (13)
  • .github/workflows/tauri-release.yml (1 hunks)
  • package.json (4 hunks)
  • src-tauri/tauri.conf.json (1 hunks)
  • .github/workflows/tauri-release.yml (1 hunks)
  • build-desktop.sh (1 hunks)
  • desktop.config.ts (1 hunks)
  • package.json (1 hunks)
  • src-tauri/tauri.conf.json (1 hunks)
  • .github/workflows/tauri-release.yml (1 hunks)
  • build-desktop.sh (0 hunks)
  • desktop.config.ts (0 hunks)
  • package.json (0 hunks)
  • src-tauri/tauri.conf.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • desktop.config.ts
🚧 Files skipped from review as they are similar to previous changes (9)
  • .github/workflows/tauri-release.yml
  • src-tauri/tauri.conf.json
  • package.json
  • build-desktop.sh
  • .github/workflows/tauri-release.yml
  • package.json
  • src-tauri/tauri.conf.json
  • package.json
  • desktop.config.ts
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/tauri-release.yml

19-19: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 YAMLlint (1.35.1)
.github/workflows/tauri-release.yml

[error] 30-30: trailing spaces

(trailing-spaces)


[error] 35-35: trailing spaces

(trailing-spaces)


[error] 49-49: trailing spaces

(trailing-spaces)

🔇 Additional comments (2)
src-tauri/tauri.conf.json (1)

1-37: Overall Configuration Approval

The remainder of the Tauri configuration, including product metadata, window settings, and bundle targets, appears correct and aligns with the intended desktop build process.

.github/workflows/tauri-release.yml (1)

18-19: Update Checkout Action Version

The workflow currently uses actions/checkout@v3, but static analysis indicates that this version is outdated. Consider updating to a newer version (for example, actions/checkout@v4 if available) to ensure improved reliability and security in your builds.

🧰 Tools
🪛 actionlint (1.7.4)

19-19: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

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.

Desktop Mini Window Navbar Toggle not expanding
1 participant