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

feat(gsoc'24): Advance options for embed view #312

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

Conversation

niladrix719
Copy link
Member

@niladrix719 niladrix719 commented May 16, 2024

Fixes #107

Added Advance Options / User preferences for embed view

Users can now select/unselect the following options to toggle their rendering in the embed view:

  • Theme
  • Display Title
  • Clock Time
  • Fullscreen
  • Zoom in out
Screen.Recording.2024-05-16.at.5.15.16.PM.mov

Summary by CodeRabbit

  • New Features

    • Introduced a structured theming system with multiple visual themes.
    • Enhanced interactivity in the embed component with conditional rendering based on user preferences.
    • Added computed properties for better management of user-defined settings, including theme selection.
  • Style

    • Updated styles for improved responsiveness and layout flexibility in the embed component.
    • Introduced new CSS rules for better visual hierarchy and element positioning.

Copy link

netlify bot commented May 16, 2024

Deploy Preview for circuitverse ready!

Name Link
🔨 Latest commit a365698
🔍 Latest deploy log https://app.netlify.com/sites/circuitverse/deploys/66d483f3d9ce680008d01a67
😎 Deploy Preview https://deploy-preview-312--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.

src/pages/embed.vue Outdated Show resolved Hide resolved
src/pages/embed.vue Outdated Show resolved Hide resolved
src/pages/embed.vue Outdated Show resolved Hide resolved
@Arnabdaz Arnabdaz added the 🌟 feature New feature or request label Jun 2, 2024
@niladrix719 niladrix719 added the GSOC'24 PR's for GSoC'24 label Jul 25, 2024
@vedant-jain03
Copy link
Member

@niladrix719 please fix the conflicting file

src/assets/constants/theme.ts Outdated Show resolved Hide resolved
src/pages/embed.vue Outdated Show resolved Hide resolved
Comment on lines 245 to 262
case 'default':
updateThemeForStyle(THEME.default);
break;
case 'night-sky':
updateThemeForStyle(THEME.night_sky);
break;
case 'lite-born-spring':
updateThemeForStyle(THEME.lite_born_spring);
break;
case 'g-and-w':
updateThemeForStyle(THEME.g_and_w);
break;
case 'high-contrast':
updateThemeForStyle(THEME.high_contrast);
break;
case 'color-blind':
updateThemeForStyle(THEME.color_blind);
break;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
case 'default':
updateThemeForStyle(THEME.default);
break;
case 'night-sky':
updateThemeForStyle(THEME.night_sky);
break;
case 'lite-born-spring':
updateThemeForStyle(THEME.lite_born_spring);
break;
case 'g-and-w':
updateThemeForStyle(THEME.g_and_w);
break;
case 'high-contrast':
updateThemeForStyle(THEME.high_contrast);
break;
case 'color-blind':
updateThemeForStyle(THEME.color_blind);
break;
case 'default':
updateThemeForStyle(THEME.default);
break;
case 'night-sky':
updateThemeForStyle(THEME.night_sky);
break;
case 'lite-born-spring':
updateThemeForStyle(THEME.lite_born_spring);
break;
case 'g-and-w':
updateThemeForStyle(THEME.g_and_w);
break;
case 'high-contrast':
updateThemeForStyle(THEME.high_contrast);
break;
case 'color-blind':
updateThemeForStyle(THEME.color_blind);
break;

updateThemeForStyle(theme.value)

refactor this

Copy link
Member Author

Choose a reason for hiding this comment

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

as theme.value is coming from params, we cannot directly put theme.value inside the updateThemeForStyle func, would like to discuss if there is any better way

@Arnabdaz Arnabdaz enabled auto-merge (squash) August 11, 2024 16:31
Copy link
Contributor

coderabbitai bot commented Sep 1, 2024

Walkthrough

The changes introduce a new TypeScript file defining a theme type and constant, enhancing theming capabilities. The embed.vue file is updated to include conditional rendering and computed properties based on user preferences, while the CSS file adjusts element styling for improved layout and responsiveness.

Changes

Files Change Summary
src/assets/constants/theme.ts Introduced ThemeType type and THEME constant for structured theme management.
src/pages/embed.vue Added computed properties and conditional rendering based on route query parameters; implemented theme application on mount.
src/styles/css/embed.css Modified element height to auto, added gap property, and created a new style for #bottom_right_circuit_heading.

Assessment against linked issues

Objective Addressed Explanation
ESLint should support TypeScript files (#[107]) The changes do not address the ESLint plugin issue.

🐇 "In the meadow, a theme takes flight,
With colors that dance, oh what a sight!
Computed properties, so clever and bright,
Responsive styles make everything right.
Hooray for the changes, let's hop with glee,
For a vibrant new 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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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
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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 129048f and a365698.

Files selected for processing (3)
  • src/assets/constants/theme.ts (1 hunks)
  • src/pages/embed.vue (8 hunks)
  • src/styles/css/embed.css (2 hunks)
Additional comments not posted (18)
src/assets/constants/theme.ts (1)

1-17: LGTM! Consider the suggestion from the previous review.

The code changes are approved. The type and constant are correctly defined.

However, the suggestion from the previous review is still applicable:

export const THEME = {
  default: 'Default Theme' as const,
  night_sky: 'Night Sky' as const,
  lite_born_spring: 'Lite-born Spring' as const,
  g_and_w: 'G&W' as const,
  high_contrast: 'High Contrast' as const,
  color_blind: 'Color Blind' as const,
}

Using as const will infer string literal types for the theme names, providing better type safety.

src/styles/css/embed.css (2)

49-50: LGTM!

The code changes are approved. Setting height: auto; improves responsiveness by allowing the element to adjust its height based on the content. Adding gap: 1rem; enhances the layout by introducing spacing between flex items.


264-274: LGTM!

The code changes are approved. The new CSS rule for #bottom_right_circuit_heading improves the visual hierarchy by establishing a fixed position for the element at the bottom right of the viewport. The font settings and color enhance the appearance of the heading.

src/pages/embed.vue (15)

Line range hint 51-75: LGTM!

The code changes are approved.


88-88: LGTM!

The code changes are approved.


Line range hint 95-106: LGTM!

The code changes are approved.


Line range hint 107-118: LGTM!

The code changes are approved.


138-141: LGTM!

The code changes are approved.


167-167: LGTM!

The code changes are approved.


182-182: LGTM!

The code changes are approved.


183-183: LGTM!

The code changes are approved.


197-197: LGTM!

The code changes are approved.


198-198: LGTM!

The code changes are approved.


199-199: LGTM!

The code changes are approved.


200-200: LGTM!

The code changes are approved.


201-201: LGTM!

The code changes are approved.


203-203: LGTM!

The code changes are approved.


243-246: LGTM!

The code changes are approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 feature New feature or request GSOC'24 PR's for GSoC'24
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merge updates and bug fixes from the main CircuitVerse repository since the decoupling of the vue simulator.
3 participants