Skip to content

refactor: convert restrictedElementDiv.js to TypeScript#810

Closed
pantha704 wants to merge 1 commit intoCircuitVerse:mainfrom
pantha704:ts-restrictedElementDiv#661
Closed

refactor: convert restrictedElementDiv.js to TypeScript#810
pantha704 wants to merge 1 commit intoCircuitVerse:mainfrom
pantha704:ts-restrictedElementDiv#661

Conversation

@pantha704
Copy link
Contributor

@pantha704 pantha704 commented Jan 17, 2026

Closing - file already covered by PR #705

Part of CircuitVerse#661 (1 file per PR rule)

- Added return type annotations for all functions
- Added type annotations for parameters and variables
- Added optional chaining for scope[element]?.length to prevent errors
- Added null checks for DOM elements
- Applied same changes to v1/src
@netlify
Copy link

netlify bot commented Jan 17, 2026

Deploy Preview for circuitverse ready!

Name Link
🔨 Latest commit 2b15074
🔍 Latest deploy log https://app.netlify.com/projects/circuitverse/deploys/696b3fed2c997400086b0515
😎 Deploy Preview https://deploy-preview-810--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: 21 (🔴 down 23 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 Jan 17, 2026

Walkthrough

Four exported functions from restrictedElementDiv.js files—updateRestrictedElementsList(), updateRestrictedElementsInScope(), showRestricted(), and hideRestricted()—are removed from JavaScript implementations and re-added in corresponding TypeScript files across both src/simulator/src/ and v1/src/simulator/src/ directories. These functions manage the display of restricted circuit elements within the simulator UI, including rendering lists of restricted elements, scanning scopes for restricted element usage, and toggling visibility of restriction-related warning messages. The net effect is a migration of the restricted element UI management layer from JavaScript to TypeScript.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the primary change: converting JavaScript files to TypeScript with type annotations, matching the actual changeset across src/ and v1/src/ directories.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

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

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.

@pantha704 pantha704 closed this Jan 17, 2026
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