Enhance port conflict detection with structured data and visual UI#79
Draft
Enhance port conflict detection with structured data and visual UI#79
Conversation
- Added structured types for port conflicts (PortChange, PortConflict, PortConflictsResult) - Enhanced detectAndFixPortConflicts to return detailed conflict information - Redesigned PortConflictsAlert component with improved UI: - Shows which containers have conflicts with visual badges - Clear indication of which service port is kept vs changed - Better visualization of port changes with color-coded old/new ports - Grouped conflict information by port - Added comprehensive test suite for port conflict scenarios - All 127 tests passing Co-authored-by: ajnart <49837342+ajnart@users.noreply.github.com>
The regex was matching across service boundaries when a service's port had already been changed. The pattern would match from the target service through to the next service that still had the conflicting port. Fixed by using a negative lookahead to prevent matching across service definitions. Also removed the while loop since each service should only have one port conflict per port number, simplifying the logic. - All 128 tests passing including new detailed conflict tracking test - Verified fix with manual demonstration script Co-authored-by: ajnart <49837342+ajnart@users.noreply.github.com>
Addressed code review feedback by adding comprehensive comments explaining: - The purpose of the regex pattern - Each part of the complex pattern including lookaheads - Why modifying result during iteration is safe in this context All tests still passing. Co-authored-by: ajnart <49837342+ajnart@users.noreply.github.com>
Comprehensive documentation covering: - Overview of all changes made - Detailed explanation of new types and functionality - Bug fix explanation with technical details - UI enhancement documentation with visual structure - Complete test coverage summary - Regex pattern explanation - Future enhancement suggestions All 128 tests passing. Ready for final review. Co-authored-by: ajnart <49837342+ajnart@users.noreply.github.com>
Created detailed documentation showing: - Before/After comparison of UI - Visual examples of different conflict scenarios - Color scheme and styling details - Component structure and data flow - Accessibility considerations - Future enhancement suggestions This provides maintainers and reviewers with clear understanding of the UI improvements. Co-authored-by: ajnart <49837342+ajnart@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Enhance port conflict detection and resolution logic
Enhance port conflict detection with structured data and visual UI
Jan 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docker Compose Maker
Type of Change
Description
Port conflict detection now returns structured data and renders with visual indicators showing which services keep/lose ports and their reassignments.
Core Changes
Type System (
lib/docker-compose/port-conflicts.ts)PortChange,PortConflict,PortConflictsResultreplace string arraysRegex Bug Fix
[\s\S]*?matched across service boundaries after port replacement(?![^\n]*\n\s{2}[a-zA-Z0-9_-]+:)prevents cross-service matchingUI Component (
components/compose-modal/PortConflictsAlert.tsx)Example
Test Coverage
Checklist
mainbranchThis PR is in accordance with the CONTRIBUTING.md guidelines.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
fonts.googleapis.com/usr/local/bin/node node /home/REDACTED/work/dcm/dcm/node_modules/.bin/next build ker/cli-plugins/docker-compose n-me�� config --quiet /usr/libexec/docker/docker-init config --quiet docker-compose /usr/libexec/docker/docker-init --ve��(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.