Skip to content

fix(connect): six post-merge bugs + README hero screenshots#9

Merged
valehdba merged 2 commits into
mainfrom
fix/connect-bugs-and-readme-hero
May 9, 2026
Merged

fix(connect): six post-merge bugs + README hero screenshots#9
valehdba merged 2 commits into
mainfrom
fix/connect-bugs-and-readme-hero

Conversation

@valehdba

@valehdba valehdba commented May 9, 2026

Copy link
Copy Markdown
Owner

Summary

Two follow-up commits to #8 that arrived after the squash-merge so didn't make it into main:

  1. fix(connect) — six bugs surfaced by post-merge self-review (one functional, two UX, one visual, one race, one wrong-condition).
  2. docs(readme) — adds two hero screenshots above the architecture diagram so a visitor scrolling the repo sees the product before the diagram.

Bugs fixed

# Bug File
1 handleJdbc had an empty if (p.password) { /* comment */ } block whose comment claimed to queue the password — code did nothing ConnectDialog.tsx
2 handleCommand copied the command and then overwrote it with the password — toast said "command copied" but clipboard held the password ConnectDialog.tsx
3 launchSshUrl used window.location.href — Chromium navigates to ERR_UNKNOWN_URL_SCHEME if no handler is registered, throwing the user out of the app. Switched to the synthetic-anchor-click pattern used by 1Password / Bitwarden ssh.ts
4 RDP option enabled for any credential with a host — for a Postgres credential on port 5432, buildRdpFile({ ...item, protocol: "rdp" }) overrode protocol but kept the port, generating an .rdp file pointing at host:5432 (RDP doesn't run on 5432). Now gated through a new canBuildRdp helper that requires effectiveProtocol === "rdp" ConnectDialog.tsx + protocol.ts
5 toggleSelectAll compared s.size === filtered.length — coincidental size match across scope changes flipped the toggle wrong direction. Switched to filtered.every(it => s.has(it.id)) matching the header-checkbox visual VaultPage.tsx
6 Connect dialog target subtitle deduped on exact string equality — db-prod-01 and db-prod-01:5432 are different strings, so the host appeared twice in the rendered header. Extracted buildTargetSubtitle helper with smart dedupe ConnectDialog.tsx + protocol.ts

README hero

Two screenshots between the description and the ASCII architecture diagram:

  • The vault dashboard — the at-a-glance "what does Passman look like?"
  • The Connect dialog — the headline feature

The screenshots already exist under docs/img/ and stay in sync with the live styles via the docs/preview/ mockups, so this isn't a maintenance trap.

Tests

  • 48 web tests passing (was 37, +11 regression tests):
    • 6 covering buildTargetSubtitle dedupe behaviour (host:port + non-redundant IP + AD-domain user encoding)
    • 5 covering canBuildRdp gating, including the explicit case that a Postgres credential on port 5432 must NOT enable the RDP option
  • All existing tests still pass; typecheck clean across core / web / extension.

🤖 Generated with Claude Code

valehdba and others added 2 commits May 9, 2026 22:20
Self-review of #8 surfaced six runtime/UX bugs that the test suite didn't
catch. Tests added for each.

1. handleJdbc had an empty `if (p.password) { /* comment */ }` block whose
   comment claimed to queue the password on the clipboard but did nothing.
   Removed the misleading code and updated the toast to be honest:
   "JDBC URL copied · use the row's Copy button for the password".

2. handleCommand copied the command and then copied the password, leaving
   the password on the clipboard while the toast said "command copied" —
   the user would paste the password instead of the command. Now copies
   the command alone; password lives on the per-row Copy button.

3. launchSshUrl assigned to `window.location.href`, which is unreliable in
   Chromium for custom-scheme URLs: when no handler is registered Chrome
   navigates the tab to an `ERR_UNKNOWN_URL_SCHEME` page, throwing the
   user out of the app. Switched to the synthetic-anchor-click pattern
   used by 1Password / Bitwarden — the click invokes the protocol handler
   if present and is a silent no-op otherwise.

4. The "Open RDP session" option was enabled for any credential with a
   host, then called `buildRdpFile({ ...item, protocol: "rdp" })` — which
   overrode the protocol but kept the credential's port. For a Postgres
   credential on port 5432 the resulting .rdp pointed at `host:5432`,
   which doesn't run RDP. The option is now gated through a new
   `canBuildRdp` helper that requires `effectiveProtocol === "rdp"`, and
   the disabled-state hint guides the user to set the protocol field.

5. VaultPage.toggleSelectAll compared `s.size === filtered.length` to
   decide between select-all and deselect-all. With cross-scope selection
   that comparison can be coincidentally true even when the visible rows
   aren't the selected ones, causing a deselect when the user expected a
   select. Switched to a per-row `every`-based check that matches what
   CredentialsGrid uses for the header-checkbox visual.

6. The Connect dialog's "where this points" subtitle ran a dedupe pass
   keyed on exact string equality — but "db-prod-01" and "db-prod-01:5432"
   are different strings, so the host appeared twice in the rendered
   header (visible in the v0 vault-connect screenshot). Extracted the
   logic into a tested `buildTargetSubtitle` helper that keeps host:port
   as the canonical segment and only adds the IP separately when the
   hostname was used as the primary identifier.

Tests: 48 passing (was 37) — +11 covering buildTargetSubtitle's dedupe
and canBuildRdp's gating, including the regression case where a Postgres
credential on port 5432 must NOT enable the RDP option.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The README's "this is what it does" was an ASCII architecture diagram —
informative but it doesn't communicate the product. Added two screenshots
above the diagram:

1. The vault dashboard (sidebar groupings, engine-coloured rows, Connect
   button per row) — the at-a-glance "what does Passman look like?"
   answer for someone landing on the repo.
2. The Connect dialog with JDBC / SSH / copy-command / RDP options —
   the headline feature that distinguishes this from a generic password
   manager.

Both images already exist under docs/img/ and are kept in sync with the
live styles via the docs/preview/ mockups, so README screenshots track
the actual product without a separate maintenance burden.

Tightened the description's first line to mention the DBA / infrastructure
focus that the screenshots make obvious.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@valehdba valehdba merged commit ae22ee6 into main May 9, 2026
7 checks passed
@valehdba valehdba deleted the fix/connect-bugs-and-readme-hero branch May 9, 2026 18:21
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.

1 participant