fix: prioritize active tunnels in job tunnel selector#71
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the “Create Job” tunnel selector to make it easier to pick a usable tunnel by prioritizing active statuses and surfacing tunnel health inline in the dropdown and selected value.
Changes:
- Sort existing tunnel options by status priority (healthy/degraded first), then by alias within each status bucket.
- Add a status indicator (colored dot + label) to tunnel options and the rendered selected value.
- Refactor tunnel option typing to support a custom/manual entry alongside existing tunnels.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| type TunnelStatusTagVariant = 'slate' | 'green' | 'yellow' | 'red'; | ||
|
|
||
| const tunnelStatusDotColorClassByStatus: Record<TunnelStatus, string> = { | ||
| healthy: 'bg-emerald-500', | ||
| degraded: 'bg-yellow-500', | ||
| down: 'bg-red-500', | ||
| inactive: 'bg-gray-500', | ||
| }; | ||
|
|
||
| const tunnelStatusTagVariantByStatus: Record<TunnelStatus, TunnelStatusTagVariant> = { | ||
| healthy: 'green', | ||
| degraded: 'yellow', | ||
| down: 'red', | ||
| inactive: 'slate', |
There was a problem hiding this comment.
TunnelStatusTagVariant duplicates the existing ColorVariant union exported by @shared/SmallTag. Consider typing tunnelStatusTagVariantByStatus as Record<TunnelStatus, ColorVariant> (or Extract<ColorVariant, 'slate' | 'green' | 'yellow' | 'red'>) to keep the mapping type aligned with the component’s accepted variants and avoid future drift.
Summary
Validation