fix(desktop): only show ports in sidebar when actively in use#1488
Conversation
Static ports from ports.json were always displayed even when not running. Now ports only appear when detected by the port scanner, with static config used solely for label overrides.
📝 WalkthroughWalkthroughTwo utility functions in the PortsList component refactored: filtering and sorting logic to exclude empty port groups by workspace, and reordering the port merging strategy to prioritize dynamic ports while using static configuration as secondary source. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
ports.jsonwere always displayed in the sidebar even when not running, adding visual clutterChanges
merge-ports.ts: Simplified merge logic to iterate only over dynamically detected ports. Static ports serve as a label source rather than always being shown. Removed the two-pass approach (static-first, then dynamic-only) in favor of a single pass over active ports with static label lookup.usePortsData.ts: Added.filter()to remove workspace groups with zero active ports, preventing empty workspace sections in the sidebar.Test Plan
ports.jsonwith static port entries — verify they do not appear in the sidebar when nothing is running on those portsports.json— verify it appears with the configured labelports.json— verify it still appears (dynamic-only, no label)Summary by CodeRabbit