feat(dw-desktop): surface env auth type, edit credentials, friendlier connection errors#25
Open
nicped wants to merge 1 commit into
Open
feat(dw-desktop): surface env auth type, edit credentials, friendlier connection errors#25nicped wants to merge 1 commit into
nicped wants to merge 1 commit into
Conversation
… connection errors Environment list now shows an auth-type badge (API key / OAuth / Username). Edit environment can now change the auth mode and credentials, mirroring the Add flow. Non-secret values (client id, username) are loaded back from the keychain and pre-filled; secrets stay write-only and blank-means-unchanged. The stored API key is shown as an obfuscated hint (abcd…wxyz) so the active key is recognizable when comparing environments. Username is now persisted for password auth, and both modals exchange password credentials for an API key via loginPassword. Connection failures are no longer silent: loadRemote records the error, the remote pane shows an error banner with Retry, and a toast fires on connect. Low-level errors (fetch failed, OAuth 401, ...) are translated into plain language via a shared humanizeAuthError helper; the raw text is still kept in the Debug panel. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What & why
Three related improvements to the environment/auth experience in dw-desktop, driven by usability gaps:
1. Auth type is visible in the environment list
Each row in the sidebar now shows a small badge — API key, OAuth, or Username — so you can tell at a glance how each environment authenticates.
2. Edit environment can change auth mode & credentials
The Edit dialog previously only let you change the display name, host, and local folder. It now mirrors the Add flow's auth section:
abcd…wxyz) so you can recognize which key is in use when comparing environments. The raw key is never returned to the renderer.Supporting changes: the username is now persisted for password auth (it was previously discarded), and both Add and Edit exchange password credentials for an API key via
loginPassword.3. Connection errors are surfaced and humanized
Previously a failed remote connection just showed an empty pane.
loadRemotenow records the failure; the remote pane shows an error banner with a Retry button, and a toast fires when the initial connect fails.humanizeAuthErrorhelper:fetch failed/ENOTFOUND→ "Couldn't reach "host". Check that the address is correct and the site is online."OAuth token request failed (401)/invalid_client→ "Authentication failed. Double-check your credentials for this environment."Security notes
auth:getHintsIPC returns only client id, username, and an obfuscated API-key preview — never the full secret.Testing
npm run typecheck— clean.npm test— 36 passing (added coverage forhumanizeAuthError,obfuscateSecret,getCredentialHints(asserts the raw key never leaks), username persistence, and updated thelistFiles401 assertion to the humanized message).Notes / caveats
dw-api.tsandDualPaneBrowser.tsxis mostly Prettier reflowing pre-existing long lines in files I touched — the functional changes are small.🤖 Generated with Claude Code