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 Clock Settings Functionality and Improve UI #384

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Darshan808
Copy link
Contributor

@Darshan808 Darshan808 commented Oct 3, 2024

Description:

This PR resolves an issue where the clock settings in CircuitVerse's Vue Simulator were not functioning correctly. Regardless of the clock time set, the clock always oscillated with a period of 500ms. This fix ensures that the clock now operates according to the user's specified time.

Additionally, the clock wasn't enabled by default, and a scroll bar appeared on the clock time display, leading to poor UI. These issues have been fixed by:

- Integrating the function to change the clock time (previously implemented in simulatorArea) into circuitProperties.

- Removing the scroll bar on the clock time display using basic CSS..

- Enabling the clock by default using html attribute 'checked'.

Testing:

Manual testing was conducted to verify that the clock functions as expected and the UI improvements are effective.

Screencasts

Before

Screencast.from.2024-10-03.18-28-21.webm

After

Screencast.from.2024-10-03.18-29-20.webm

Summary by CodeRabbit

  • New Features

    • Enhanced project property input with responsive circuit name updates.
    • Added functionality to change clock time in the simulation area.
  • Bug Fixes

    • Default state of the "Clock Enabled" checkbox is now checked.
  • Style

    • Updated numeric input fields to hide default spinners for a cleaner appearance.

Copy link
Contributor

coderabbitai bot commented Oct 3, 2024

Walkthrough

The changes involve updates to the ProjectProperty.vue and InputGroups.vue components, enhancing their interactivity and styling. In ProjectProperty.vue, the template structure is modified to improve the responsiveness of input fields and the default state of a checkbox. The InputGroups.vue component receives new styles to hide default numeric input spinners across different browsers. Additionally, a new function changeClockTime is introduced in circuit.ts to allow modifications to the clock time in the simulation area.

Changes

File Path Change Summary
src/components/Panels/PropertiesPanel/ModuleProperty/ProjectProperty/ProjectProperty.vue Modified template structure, added :key binding for circuit name input, and updated checkbox default state.
src/components/Panels/Shared/InputGroups.vue Added scoped <style> to hide default numeric input spinners for webkit and Firefox.
src/simulator/src/circuit.ts Introduced changeClockTime function to circuitProperty object for modifying clock time.

Poem

In the fields where circuits play,
A clock ticks bright, come what may.
Inputs dance, spinners hide,
In our code, new features abide.
With every change, we hop with glee,
For a better world, just wait and see! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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 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 Oct 3, 2024

Deploy Preview for circuitverse ready!

Name Link
🔨 Latest commit 869c63e
🔍 Latest deploy log https://app.netlify.com/sites/circuitverse/deploys/66fe93c82291080008ba1e03
😎 Deploy Preview https://deploy-preview-384--circuitverse.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@Darshan808
Copy link
Contributor Author

@tanmoysrt
Can i get this approved under 'hacktoberfest-accepted' label ?

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

🧹 Outside diff range and nitpick comments (1)
src/simulator/src/circuit.ts (1)

54-56: Approved: changeClockTime implementation with suggestion

The changeClockTime function implementation looks good and addresses the PR objective of fixing the clock functionality. However, consider adding input validation for the t parameter to ensure only valid time values are passed to simulationArea.changeClockTime.

Consider adding input validation:

 function changeClockTime(t: number) {
+    if (t <= 0) {
+        throw new Error("Clock time must be a positive number");
+    }
     simulationArea.changeClockTime(t)
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 51766f2 and 869c63e.

📒 Files selected for processing (3)
  • src/components/Panels/PropertiesPanel/ModuleProperty/ProjectProperty/ProjectProperty.vue (1 hunks)
  • src/components/Panels/Shared/InputGroups.vue (1 hunks)
  • src/simulator/src/circuit.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/components/Panels/Shared/InputGroups.vue
🔇 Additional comments (5)
src/components/Panels/PropertiesPanel/ModuleProperty/ProjectProperty/ProjectProperty.vue (3)

45-47: LGTM: Clock enabled by default as per PR objectives.

The addition of the checked attribute to the "Clock Enabled" checkbox input element aligns perfectly with the PR objective of enabling the clock by default. This change directly addresses one of the UI improvements mentioned in the PR summary.


Line range hint 1-185: Summary: Partial implementation of PR objectives.

The changes in this file address one of the PR objectives by enabling the clock by default. However, other mentioned improvements, such as integrating the clock time adjustment function and removing the scroll bar from the clock time display, are not visible in this file.

Could you please provide information on where the remaining changes have been implemented? This will help ensure a comprehensive review of all the improvements mentioned in the PR objectives.

To help locate the remaining changes, you can run the following script:

#!/bin/bash
# Description: Search for files with changes related to clock functionality and UI improvements.

# Test: Search for files with relevant changes
rg --type vue --type typescript --type css -e "clock" -e "timePeriod" -e "scrollbar" -e "overflow"

Line range hint 93-185: Verify clock time adjustment implementation.

The PR objectives mention integrating the clock time adjustment function into the circuitProperties. However, I don't see any changes related to this functionality in this file. Could you please verify if these changes have been implemented in another file or if they're missing from the PR?

To help verify this, you can run the following script to search for relevant changes:

src/simulator/src/circuit.ts (2)

51-52: LGTM: Addition of changeClockTime to circuitProperty

The addition of changeClockTime to the circuitProperty object is appropriate and aligns with the PR objective of integrating the clock time adjustment function into the circuitProperties.


51-56: Summary: Clock functionality improvements implemented, but some PR objectives not addressed

The changes in this file successfully integrate the clock time adjustment function into the circuitProperties and should fix the issue of the clock not operating according to the user-specified time. However, other PR objectives, such as enabling the clock by default and removing the scroll bar from the clock time display, are not addressed in this file.

To ensure all PR objectives are met, please verify that the following items are addressed in other files:

  1. Enabling the clock by default using the HTML attribute 'checked'.
  2. Removing the scroll bar from the clock time display through CSS adjustments.

You can use the following script to search for these changes:

@Darshan808
Copy link
Contributor Author

@Arnabdaz
Could you please review this PR ?

@Darshan808
Copy link
Contributor Author

Darshan808 commented Oct 23, 2024

@gr455
Could this PR be reviewed please ?
Also I would really appreciate if you could label this PR as hacktoberfest-accepted.

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.

1 participant