-
Notifications
You must be signed in to change notification settings - Fork 752
feat: add eruda devtools for debugging #1831
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @bajrangCoder, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the application's debugging capabilities by integrating Eruda, a powerful in-browser developer console. It provides a dedicated 'Developer Mode' setting and convenient commands to manage the devtools, allowing for easier inspection of the application's runtime state and more efficient debugging of plugins and other components. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces Eruda devtools for debugging, a valuable addition for developers. The implementation is well-structured, with a dedicated devTools module and proper integration into the app's settings and commands. The code is generally clean and follows existing patterns. I've provided a few suggestions to enhance maintainability and consistency, such as refactoring to avoid code duplication and addressing the use of private library properties. Overall, this is a strong contribution.
Greptile SummaryThis PR adds Eruda developer tools integration to enable in-app debugging and inspection capabilities. When enabled via settings, the feature downloads and caches the Eruda library from a CDN, then provides keyboard shortcuts (Ctrl+Shift+I) and commands to toggle the inspector panel. Key changes:
Issues found:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant AppSettings
participant DevTools
participant FileSystem
participant CDN
participant Eruda
Note over User,Eruda: Developer Mode Activation Flow
User->>AppSettings: Enable Developer Mode
AppSettings->>DevTools: import & init(showLoader=true)
DevTools->>FileSystem: Check if eruda.js exists
alt File not found
DevTools->>User: Show loader dialog
DevTools->>CDN: Download from jsdelivr CDN
CDN-->>DevTools: Return eruda.js script
DevTools->>FileSystem: Save eruda.js to DATA_STORAGE
DevTools->>User: Hide loader dialog
end
DevTools->>FileSystem: Get internal URI for eruda.js
DevTools->>Eruda: Inject script tag into document
Eruda-->>DevTools: Script loaded
DevTools->>Eruda: eruda.init(config)
DevTools->>Eruda: Hide entry button
DevTools-->>AppSettings: Initialization complete
AppSettings->>User: Show success toast
Note over User,Eruda: App Startup Flow (when enabled)
User->>App: Start app
App->>DevTools: import & init(showLoader=false)
DevTools->>FileSystem: Load cached eruda.js
DevTools->>Eruda: Initialize silently
Note over User,Eruda: Inspector Toggle Flow
User->>User: Press Ctrl+Shift+I
User->>DevTools: toggle()
alt Inspector hidden
DevTools->>Eruda: show()
DevTools->>Eruda: Show entry button
else Inspector visible
DevTools->>Eruda: hide()
DevTools->>Eruda: Hide entry button
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
38 files reviewed, 2 comments
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
| if (settings.value.developerMode) { | ||
| try { | ||
| const devTools = (await import("lib/devTools")).default; | ||
| await devTools.init(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone enables devTools and doesn't use it, it loads eruda.js for no reason and wastes memory. It might be better to move the init call to the show() function
No description provided.