Repository navigation
Add ping-menu extension - #22299
Add ping-menu extension#22299
Conversation
commented
Oct 20, 2025
|
Congratulations on your new Raycast extension! 🚀 You can expect an initial review within five business days. Once the PR is approved and merged, the extension will be available on our Store. |
commented
Oct 27, 2025
|
@greptileai can you do a fresh review here? |
left a comment
There was a problem hiding this comment.
I'll provide a fresh review of this ping-menu extension PR.
Overall Assessment
This is a well-structured menu bar extension that monitors ping latency to google.com. The implementation is clean and follows Raycast conventions. Here are my findings:
✅ Strengths
- Good documentation - README clearly explains features and limitations
- Proper caching - Uses LocalStorage to show last known values on startup
- Smart refresh logic - Different intervals for background vs. active states
- User feedback - Color-coded indicators and tooltips provide good UX
- Configuration - Standard Raycast config files are properly set up
🔍 Issues & Suggestions
Critical Issues
1. Hardcoded ping target
The extension only pings google.com with no configuration option. Consider adding a preference for the target host.
2. Type safety suppressions
There are multiple @ts-ignore comments in ping-monitor.tsx (lines 115, 117, 120, 124, 126). This suggests either:
- Type definitions need updating
- Components are being used incorrectly
- There's a version mismatch in dependencies
Code Quality
3. Error handling in pingGoogle()
} catch (error) {
console.error("Ping failed:", error);
return null;
}The error is logged but the actual error message isn't captured or displayed to users. The history just shows "Failed" without context.
4. Magic numbers
- Line 16:
-W 1000(timeout) - Line 73:
slice(0, 10)(history size) - Line 88:
1000(interval) - Lines 102-104: Latency thresholds (60, 150)
These should be constants or preferences.
5. Potential memory leak in LocalStorage
Every ping saves to LocalStorage (line 73). While you're limiting to 10 items, this still happens every second when active. Consider debouncing or only saving periodically.
Documentation
6. Incomplete CHANGELOG
The date is 2025-10-20 which is in the future. Should this be 2024-10-20?
7. README oversells limitations
The note about "Background Execution Limitation" is extensive but the extension correctly uses interval: "10s" in package.json for background updates. The explanation might confuse users.
Configuration
8. Missing metadata
package.json is missing:
categoriesfield (should include something like "Developer Tools" or "Productivity")versionfieldkeywordsfield for discoverability
9. Interval configuration
The interval: "10s" in package.json seems reasonable, but the code runs at 1-second intervals when open. Document this behavior difference more clearly.
Testing
10. No error state UI
If ping fails repeatedly, the menu just shows "..." or old data. Consider showing an error state or retry option.
11. Platform-specific ping command
/sbin/ping assumes macOS/Unix. While Raycast is macOS-only, the path might vary. Consider using just ping and letting PATH resolution handle it.
Recommendations
- Add user preferences for target host and update interval
- Fix TypeScript issues - remove
@ts-ignorecomments - Extract magic numbers to named constants
- Add proper error state handling and display
- Fix the CHANGELOG date
- Add missing package.json metadata
- Consider rate-limiting LocalStorage writes
- Add more granular color indicators or make thresholds configurable
Minor Nits
mise.tomlspecifiesnode = "latest"but this might cause inconsistency across contributors- The icon.png file isn't visible in the diff - ensure it's high quality and follows Raycast guidelines
- Consider adding a "Copy latency" action in the menu items
Would you like me to provide specific code suggestions for any of these issues?
… extension - Deleted .eslintrc.json file. - Updated package-lock.json and package.json to include new versions of dependencies, including @raycast/utils, @raycast/eslint-config, eslint, prettier, and typescript. - Adjusted TypeScript configuration to target ES2023 and updated JSX handling. - Refactored ping-monitor component to utilize useCachedPromise for improved data fetching and state management.
commented
Oct 30, 2025
|
Hi @basilar👋 Thanks for your contribution 🔥 I updated the code a bit; could you make sure I didn't break anything? Ideas: let the user change the domain in preferences, maybe set the default to check every minute and let the user decide in preferences? You could add a preference for that and check in the code if the time passed that amount to recheck 🙂 |
left a comment
•
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This review covers only the changes made since the last review, not the entire PR. This PR adds a new ping-menu extension that provides continuous network latency monitoring through a menu bar command. The extension pings google.com every 10 seconds and displays the current latency with color-coded indicators (green for good, yellow for fair, red for poor). The implementation includes local storage of ping history (last 10 results) and proper error handling. Key technical changes include migrating from legacy .eslintrc.json to the newer eslint.config.js format, modernizing the TypeScript configuration to ES2023 with react-jsx transform, and refactoring the core ping logic from manual React hooks (useState/useEffect) to Raycast's useCachedPromise hook for simplified state management.
Important Files Changed
| Filename | Score | Overview |
|---|---|---|
| extensions/ping-menu/eslint.config.js | 5/5 | Adds new ESLint configuration using Raycast's standard template |
| extensions/ping-menu/tsconfig.json | 5/5 | Modernizes TypeScript config with ES2023 and react-jsx transform |
| extensions/ping-menu/.eslintrc.json | 2/5 | Empties the old ESLint config file instead of removing it entirely |
| extensions/ping-menu/package.json | 4/5 | Defines new ping-menu extension with menu-bar command and dependencies |
| extensions/ping-menu/src/ping-monitor.tsx | 3/5 | Refactors ping monitor from manual hooks to useCachedPromise implementation |
Confidence score: 3/5
- This PR introduces a functional new extension but has some architectural concerns that may affect performance
- Score lowered due to potential issues with useCachedPromise for continuous monitoring, empty .eslintrc.json file instead of proper cleanup, and missing PR description/screenshots required for new extensions
- Pay close attention to ping-monitor.tsx implementation and ensure the empty .eslintrc.json file doesn't cause linting issues
Additional Comments (1)
-
extensions/ping-menu/.eslintrc.json, line 1 (link)logic: Empty
.eslintrc.jsonshould be deleted if migrating toeslint.config.js. Having both files can cause conflicts. Are you migrating to the new flat config format? If so, this file should be deleted entirely.
5 files reviewed, 1 comment
left a comment
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR adds a new ping-menu extension that provides continuous network latency monitoring through Raycast's menu bar. The extension pings google.com at 10-second intervals and displays real-time latency information with color-coded status indicators (green for good, yellow for moderate, red for poor connection). It maintains a persistent history of the last 10 ping results using LocalStorage and caches results for improved performance. The extension integrates well with Raycast's menu bar system by using MenuBarExtra component and follows the platform's architectural patterns with proper TypeScript typing and React hooks like useCachedPromise.
Important Files Changed
| Filename | Score | Overview |
|---|---|---|
| extensions/ping-menu/src/ping-monitor.tsx | 3/5 | Main extension logic with ping functionality, menu bar display, and status indicators - has hardcoded path and caching issues |
| extensions/ping-menu/CHANGELOG.md | 4/5 | Documents initial release features but uses hardcoded date instead of required {PR_MERGE_DATE} template |
| extensions/ping-menu/.prettierrc | 2/5 | Prettier configuration that doesn't follow Raycast's standard settings (should use printWidth: 120) |
| extensions/ping-menu/mise.toml | 3/5 | Node.js version configuration using "latest" instead of specific version number |
| extensions/ping-menu/package.json | 5/5 | Well-structured package configuration with proper dependencies and menu-bar command setup |
| extensions/ping-menu/eslint.config.js | 5/5 | Standard ESLint configuration following Raycast's template exactly |
| extensions/ping-menu/tsconfig.json | 5/5 | Standard TypeScript configuration with appropriate settings for Raycast extensions |
| extensions/ping-menu/.gitignore | 5/5 | Standard gitignore setup excluding appropriate files and folders |
Confidence score: 3/5
- This PR requires careful review due to several technical issues that could affect functionality and consistency
- Score reflects hardcoded system paths, incorrect Prettier configuration, non-standard version specification, and missing changelog template format that deviate from Raycast guidelines
- Pay close attention to ping-monitor.tsx for path compatibility, .prettierrc for formatting standards, and CHANGELOG.md for proper template usage
9 files reviewed, 3 comments
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
commented
Nov 6, 2025
|
@greptileai could you do a fresh review of this PR? |
left a comment
There was a problem hiding this comment.
I'll review this PR for the new ping-menu extension. Let me analyze the code structure, implementation, and adherence to Raycast extension best practices.
Overall Assessment
This is a well-structured menu bar extension that monitors ping latency to google.com. The implementation is clean and follows Raycast conventions well.
✅ Strengths
- Clear Purpose: Simple, focused functionality - ping monitoring in the menu bar
- Good UX: Visual indicators (colored dots) and informative tooltips
- Proper Caching: Uses LocalStorage for persistence across sessions
- Error Handling: Gracefully handles ping failures
- TypeScript: Properly typed throughout
- Configuration: Follows Raycast extension structure correctly
🔍 Code Review Findings
Critical Issues
File: src/ping-monitor.tsx
-
Performance Concern - Aggressive Polling (Lines 115-121)
const intervalId = setInterval(() => { if (!cancelled) { fetchPing(); } }, 1000);
The extension pings every second regardless of whether the menu is open. This could be resource-intensive and potentially trigger rate limits. Consider using Raycast's built-in
interval(currently set to 10s in package.json) for background updates and only poll frequently when the menu is actively being viewed.
Minor Issues
File: package.json
- Node Version Mismatch (Line in mise.toml)
Consider aligning these versions for consistency.
// mise.toml has node = "22.14.0" // but package.json devDeps has "@types/node": "22.13.10"
File: src/ping-monitor.tsx
-
Hardcoded Target (Line 16)
const { stdout } = await execAsync("/sbin/ping -c 1 -W 1000 google.com");
While google.com is a reasonable default, consider making this configurable via preferences for users who might want to ping different hosts.
-
Magic Numbers (Lines 135-137)
if (lat < 60) return Color.Green; if (lat < 150) return Color.Yellow;
Consider extracting these thresholds as constants or making them configurable.
💡 Suggestions for Improvement
- Respect Menu State: Only poll aggressively (1s) when menu is open, use the 10s interval when closed
- Add Preferences: Allow users to configure ping target and latency thresholds
- Consider IPv6: The current ping command might not work consistently across all network configurations
- Add Error Details: Show more specific error information in the history when pings fail
📋 Compliance Check
- ✅ Follows extension guidelines
- ✅ Proper package.json structure
- ✅ TypeScript configuration correct
- ✅ Asset usage appropriate
- ✅ README documentation present
- ✅ Changelog included
Recommendation
Conditional Approval - This is a solid extension that provides useful functionality. The main concern is the aggressive 1-second polling which should be optimized. I'd recommend addressing the performance issue before merging, but the other suggestions are nice-to-haves for future iterations.
The extension demonstrates good understanding of Raycast APIs and follows best practices in most areas. Great work overall! 🎯
commented
Nov 6, 2025
|
Could you look into above @basilar I converted this PR into a draft until it's ready for the review, please press the button |
commented
Nov 7, 2025
|
Hello @pernielsentikaer, I've introduced options to customise the site to ping and specify the "method" for running the process in the background. Personally, I require the 1-second refresh to bypass Raycast's own scheduler and avoid the 10-second limitation. However, I've also included the Raycast version (with a 10-second interval) as the default to ensure that only those who truly need my "override" will utilise it. I hope this meets your needs too. Cheers |
left a comment
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This review covers only the changes made since the last review. The developer has enhanced the ping-menu extension by adding user configurability through preferences and implementing two distinct polling modes. The key changes include adding a preferences section to package.json with configurable site targeting and ping method selection (standard vs aggressive), refactoring the ping monitor to use these preferences, and updating the changelog with user-focused feature descriptions in an "Added" section.
Important Files Changed
| Filename | Score | Overview |
|---|---|---|
| extensions/ping-menu/CHANGELOG.md | 4/5 | Restructured changelog from technical "Changed" to user-focused "Added" section with better formatting and British English consistency |
| extensions/ping-menu/package.json | 4/5 | Added preferences section with site selection and ping method configuration options |
| extensions/ping-menu/src/ping-monitor.tsx | 4/5 | Implemented configurable ping monitoring with dynamic polling intervals based on user preferences |
Confidence score: 4/5
- This PR is safe to merge with minimal risk of breaking existing functionality
- Score reflects well-structured preferences implementation and proper state management, but dinged for lack of error handling in preference validation and potential confusion with polling method descriptions
- Pay close attention to the preferences configuration in package.json to ensure the descriptions clearly communicate the trade-offs between methods
3 files reviewed, 2 comments
commented
Nov 7, 2025
|
Published to the Raycast Store: |
commented
Nov 7, 2025
|
🎉 🎉 🎉 Such a great contribution deserves a reward, but unfortunately we couldn't find your Raycast account based on your GitHub username (@basilar). Please link your GitHub account to your Raycast account to receive your credits and soon be able to exchange them for some swag. |
Description
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder