Skip to content

Fix four review issues from PR #59 folder-context-menu feature - #65

Draft
GOODBOY008 with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-code-for-comments
Draft

Fix four review issues from PR #59 folder-context-menu feature#65
GOODBOY008 with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-code-for-comments

Conversation

Copilot AI commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

PR #59 added a "New Connection" folder context menu entry that pre-selects the clicked folder in the connection dialog. The code review identified four correctness issues that this PR addresses.

Fixes

  • connection-manager.tsx — "New Connection" menu item was always rendered even when onNewConnection is absent, producing a silent no-op click. Now conditionally rendered only when the prop is provided. Also updated prop type to (folderPath?: string) => void.

  • App.tsxhandleNewTab(folderPath?) was passed directly as a Radix/DOM onClick handler in some callsites, meaning it would receive a MouseEvent and store it as a folder path. Added a typeof folderPath === 'string' guard:

    const handleNewTab = useCallback((folderPath?: string) => {
      setConnectionInitialFolder(typeof folderPath === 'string' ? folderPath : undefined);
      ...
    }, []);
  • connection-dialog.tsx — Folder pre-selection was inlined inside the main open/editingConnection effect and initialFolder was added to its dep array, causing the full reset/reload to re-run on every initialFolder change (wiping in-progress edits). Moved pre-selection into a dedicated effect with its own dep array:

    useEffect(() => {
      if (open && !editingConnection && initialFolder) {
        setConnectionFolder(initialFolder);
      }
    }, [open, editingConnection, initialFolder]);
  • connection-dialog-folder.test.tsx — Test used React.ComponentProps without importing the React namespace. Switched to import { type ComponentProps } from 'react'.

Copilot AI changed the title [WIP] Fix code based on review comments Fix four review issues from PR #59 folder-context-menu feature Jul 26, 2026
Copilot AI requested a review from GOODBOY008 July 26, 2026 06:33
Copilot AI added 2 commits July 26, 2026 06:42
PR #61:
- Add aria-label and aria-expanded to folder chevron button for accessibility
- Restore activeConnectionIds memoization to prevent unnecessary re-renders
- Fix expand/collapse state preservation using flat map for deep tree support

PR #62:
- Replace parseInt with Number() + integer floor for number inputs
- Reset to protocol-specific default port when field is cleared
- Use getDefaultPort(protocol) for port fallback when editing connections
@GOODBOY008

Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

…icts

Resolved conflicts in:
- src/App.tsx: kept typeof guard for folderPath parameter
- src/__tests__/connection-dialog-folder.test.tsx: kept proper ComponentProps import
- src/components/connection-dialog.tsx: kept main's displayValues/handleNumberInput
  pattern from PR #62, re-applied dedicated initialFolder effect fix
- src/components/connection-manager.tsx: kept main's mergeExpanded from PR #61,
  re-applied conditional onNewConnection rendering and aria-label fixes

Copilot AI commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflicts with origin/main. All four conflicting files have been handled:

All 508 tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants