fix(client): real user-impacting bugs across Desktop and TUI#30
Conversation
Fixes two high-impact issues: **Desktop (Electron):** - `packages/desktop/src/main/main.ts`: HTTP Basic Auth was permanently broken. The `login` handler called `event.preventDefault()` (suppressing Electron's native credential dialog) followed by `callback()` (sending blank credentials). Connecting to any `auth_basic`-protected server was a hard failure with no way for the user to supply credentials. Removed the `preventDefault()` call so Electron surfaces the OS-native credential dialog as intended. **TUI (terminal UI):** - `packages/codeplane/src/tui/util/clipboard.ts`: OSC 52 clipboard write guard had inverted logic. When `CODEPLANE_DISABLE_CLIPBOARD=1` was explicitly set in a non-TTY context, the condition `!isTTY && env !== "1"` evaluated to `true && false = false`, so the write was NOT skipped and the user's explicit disable request was ignored. Changed `&&` to `||` so either condition (not a TTY OR explicitly disabled) correctly skips the OSC 52 write. Co-Authored-By: codeplane-agent[bot] <287208015+codeplane-agent[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes two user-facing regressions across the Desktop Electron client and the TUI by restoring intended default behaviors in Electron auth handling and correcting a clipboard disable guard.
Changes:
- Desktop: stop suppressing Electron’s native HTTP Basic Auth credential dialog by no longer calling
event.preventDefault()/callback()in theapp.on("login")handler. - TUI: fix OSC 52 clipboard write skip condition so it correctly skips when stdout is non-TTY or
CODEPLANE_DISABLE_CLIPBOARD=1.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/desktop/src/main/main.ts | Restores Electron default login handling so the OS-native Basic Auth prompt can appear and credentials aren’t forced blank. |
| packages/codeplane/src/tui/util/clipboard.ts | Corrects boolean logic so OSC 52 clipboard writes respect explicit disable and non-TTY contexts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -2998,12 +2998,11 @@ if (!gotLock) { | |||
| app.on("login", (event, _webContents, _request, authInfo, callback) => { | |||
Triage — Keep OpenConfirmed real defect in PR #30. Copilot review flagged it; no prior agent comment. Defect found
Why not closeThis is a real hygiene/consistency issue — it breaks the existing naming convention in the same function and could trigger lint errors. Keep open. |
Review: real user-impacting bugs across Desktop and TUIStatus: Merge candidate All CI checks are green. Both fixes are surgical and correct:
These overlap with parts of PR #31 but are safe to merge together. |
Summary
Fixes two high-impact user-facing bugs found during a cross-client audit:
Changes
`packages/desktop/src/main/main.ts`: HTTP Basic Auth was permanently broken. The `login` handler called `event.preventDefault()` which suppresses Electron's native credential dialog, and `callback()` with no args sent blank credentials. Connecting to any `auth_basic`-protected server was a hard failure with no way for the user to supply credentials. Removed the `preventDefault()` call so Electron surfaces the OS-native credential dialog as the comment intended.
`packages/codeplane/src/tui/util/clipboard.ts`: OSC 52 clipboard write guard had inverted logic. When `CODEPLANE_DISABLE_CLIPBOARD=1` was explicitly set in a non-TTY context, the condition `!isTTY && env !== "1"` evaluated to `true && false = false`, so the OSC 52 write was NOT skipped — the user's explicit disable request was ignored. Changed `&&` to `||` so either condition (not a TTY OR explicitly disabled) correctly skips the write.
Verification