feat: add export private key from address detail view #31
Reference in New Issue
Block a user
Delete Branch "feat/export-private-key"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds an "Export Private Key" button to the address detail view. Clicking it opens a password confirmation screen; after verification, the derived private key is displayed in a copyable field with a security warning. The key is cleared when navigating away.
Closes #19
make check output
the "export private key" box is too prominent, it's nowhere near frequent/important enough to occupy that position on screen. additionally when clicking it i get a blank/empty
export-privkeyview.Closing as duplicate — complete implementation is in #32.
Fixed both issues in
41794f8:Blank view:
export-privkeywas missing from theVIEWSarray inhelpers.js.showView()hides all known views but only unhides the one in the list — sinceexport-privkeywasn't listed, it stayed hidden. Added it.Too prominent: Moved from a full-width bordered button in "actions row 2" to a small muted text link (
text-xs text-muted underline decoration-dashed) at the very bottom of the address detail view, below the transaction list.make checkpasses.@clawbot why are you doing work on a closed PR? if you do work on this PR, you should close the other, and open this one. if this one is closed, you shouldn't do work on it. read the comment history before working. this one has my feedback on it and your rework, so i'm reopening this one and closing the other, but remember in the future (checklist-pr or checklist-git or whatever you use) to reopen a PR if you're going to work on it, and to make sure there aren't two open ones at the same time for the same issue.
Acknowledged — rule added to my PR checklist: if doing rework on a closed PR, reopen it first; never have two open PRs for the same issue.
Reviewed the diff and ran
make check(14 tests pass, prettier clean). Code looks solid:export-privkeyview registered in VIEWS array ✓Ready for merge.
that's a bad place for the export link, too. also a muted piece of text violates our UI policy in
README.md. propose (do not implement) a few other options for where this action button can live.You're right —
text-mutedviolates the clickable affordance policy ("If it does something when you click it, it must look like it does something"). Here are a few placement options:Settings screen — Add an "Export Private Key" action in Settings under a per-wallet or per-address section. Keeps it out of the daily-use flow entirely. Downside: requires navigating away from the address context.
AddressDetail action row — Add it as a normal bordered button alongside Send/Receive/+Token, but smaller (
text-xswith standard border+hover). It's discoverable but doesn't dominate since it's visually smaller than the primary actions.Context menu or overflow — Add a "···" or "More" button on AddressDetail that reveals secondary actions (export key, rename, remove). Keeps the main view clean while making it discoverable. Matches the "flat navigation" pattern already used.
Long-press or double-click on the address itself — Conceptually elegant but violates discoverability (hidden gesture).
My recommendation: option 3 — it scales to future secondary actions and keeps AddressDetail focused on the primary workflow. Option 2 is simpler if you want to avoid adding a new UI pattern.
@clawbot yeah i like 3. update the PR please.
@clawbot please perform this task
Reworked the Export Private Key trigger per feedback:
···overflow button at the end of the action button row (Send / Receive / + Token / ···)···opens a dropdown with "Export Private Key" as an optionmake checkpasses (tests + lint + fmt)@clawbot looking good, but the popup menu under the ... isn't wide enough, "export private key" wraps. it should be wide enough to not wrap any items in it.
Fixed — changed dropdown from
min-w-[10rem]towhitespace-nowrapso menu items never wrap regardless of text length.make checkpasses (14 tests, prettier clean).We're getting warmer. The dropdown menu from the "..." button is improving, but the thing that drops down just looks like a badly placed button. I'd like it to drop down a list-like menu, with each menu item going slightly grey on mouseover. a small margin after the last item shows that it's a list, even if there's only one item. what do you think?
Updated the dropdown: subtle grey hover (
bg-hovertoken =#eeeeee) instead of full fg/bg inversion,py-1padding on the container andpx-4on items so it reads as a proper list with margin even with a single item.make checkpasses.The items in the menu list should be slightly smaller type and weight than the text on the pushbuttons, and the menu "..." button should stay inverted while the menu is open, to make it clear it's a toggleable open/closed thing. The menu items should not look like buttons, and vice versa.
Pushed overflow menu styling fixes (
3daba27):Menu items use smaller, lighter type — changed from
text-smtotext-xs font-light text-muted, clearly distinct from the pushbuttons which remain bold with borders.··· button stays visually inverted while menu is open — toggles
bg-fg text-bgclasses when dropdown opens, reverts on close (click-away or menu item selection).Menu items no longer look like buttons — plain text rows with subtle hover background (
hover:bg-hover), no borders or button-like styling. Pushbuttons in the action row remain visually distinct.make checkpasses with zero failures.@clawbot
on view
export-privkeyyou are violating our consistency guidelines on address display. please fix@clawbot work to be done
Fixed address display consistency on the
export-privkeyview (d3d9f9a):docker build .passes.it's good but the "click to copy" text instruction is stupid. make it look like every other bit of click-to-copy text we have. also, what's with the dashed border? i think it should be in a light red well, with rounded corners, and be styled just like all of the other click-to-copy things like addresses.
Review — issues found
docker build .passes. The feature works correctly (password verification, key derivation, copy-to-clipboard, cleanup on nav away). However, sneak's latest feedback is not yet addressed:Dashed border on private key display:
export-privkey-valueusesborder-dashed border-border— should be a light red well with rounded corners, styled like other click-to-copy elements (addresses, etc.)."Click to copy." text instruction: The explicit
<p>Click to copy.</p>below the key should be removed. The element should look clickable on its own per the clickable affordance policy in README.md.Setting
needs-rework.Reworked private key display styling (
0c1150a):bg-danger-well/#fef2f2) with rounded corners, making it visually distinct as a sensitive value.cursor-pointer+title="Click to copy"like all other copyable elements in the extension.--color-danger-welltheme token for reuse.docker build .passes.Review — clean ✅
docker build .passes. All of sneak's feedback addressed:whitespace-nowrap— no text wrappingbg-danger-wellrounded well (no dashed border)titleattribute like all other copyable elementsexport-privkeyregistered in VIEWS arraySetting
merge-ready.