Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.

fix(client): real user-impacting bugs across Desktop and TUI#30

Merged
devinoldenburg merged 1 commit into
mainfrom
fix/client-issues-20260601
Jun 1, 2026
Merged

fix(client): real user-impacting bugs across Desktop and TUI#30
devinoldenburg merged 1 commit into
mainfrom
fix/client-issues-20260601

Conversation

@devinoldenburg
Copy link
Copy Markdown
Collaborator

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

  • `bun --cwd packages/desktop typecheck` — passes
  • `bun --cwd packages/codeplane typecheck` — passes (pre-existing unrelated TS2578 on `pty.node.ts`)
  • `bun lint` — 0 errors
  • `bun --cwd packages/codeplane test test/tui/text-value.test.ts` — 5 pass

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>
Copilot AI review requested due to automatic review settings June 1, 2026 10:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the app.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) => {
@devinoldenburg
Copy link
Copy Markdown
Collaborator Author

Triage — Keep Open

Confirmed real defect in PR #30. Copilot review flagged it; no prior agent comment.

Defect found

  1. Unused parameter lint inconsistency (packages/desktop/src/main/main.ts): callback is intentionally unused after removing credential-supplying logic. Renaming to _callback matches the pattern used for _webContents and _request in the same handler and avoids potential lint failures under stricter configs.

Why not close

This is a real hygiene/consistency issue — it breaks the existing naming convention in the same function and could trigger lint errors. Keep open.

@devinoldenburg
Copy link
Copy Markdown
Collaborator Author

Review: real user-impacting bugs across Desktop and TUI

Status: Merge candidate

All CI checks are green. Both fixes are surgical and correct:

  • Clipboard OSC52 guard fixes the inverted TTY/disable logic
  • Electron HTTP Basic Auth restores the OS-native credential dialog

These overlap with parts of PR #31 but are safe to merge together.

@devinoldenburg devinoldenburg merged commit a251114 into main Jun 1, 2026
12 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants