fix(ui): tavern floor, play-area focus border, and Smirk locked-wallet UX

Tavern: revert the per-cell 'varied floor/wall' tiles to coherent single tiles — mixing wood/stone/plank per cell read as visual noise (assetPacks.js).

Play area: draw the keyboard-focus outline inset (outline-offset -2px) so the yellow border shows on the right edge, which the container's overflow:hidden was clipping (ui.js).

Smirk: a locked wallet now shows a friendly 'unlock in the extension, then Retry' hint instead of a red error, and the LOCKED error code is preserved through connect()/signMessage(). Current Smirk builds auto-open the unlock popup on connect(); older builds throw LOCKED, which the Retry button re-invokes (smirkAuth.js).
This commit is contained in:
jwinterm
2026-07-10 08:46:38 -04:00
parent 3643746c21
commit a05a10efd7
3 changed files with 31 additions and 16 deletions
+19 -6
View File
@@ -170,7 +170,9 @@ const SmirkAuth = {
try {
keys = await window.smirk.connect();
} catch (smirkError) {
throw new Error('Failed to connect to Smirk wallet: ' + (smirkError.message || 'Unknown error'));
const e = new Error('Failed to connect to Smirk wallet: ' + (smirkError.message || 'Unknown error'));
e.code = smirkError && smirkError.code; // preserve SmirkRpcError code ('LOCKED', 'USER_REJECTED', …)
throw e;
}
if (!keys || !keys.wow) {
@@ -182,7 +184,9 @@ const SmirkAuth = {
try {
signResult = await window.smirk.signMessage(challenge);
} catch (signError) {
throw new Error('Failed to sign challenge: ' + (signError.message || 'Unknown error'));
const e = new Error('Failed to sign challenge: ' + (signError.message || 'Unknown error'));
e.code = signError && signError.code; // preserve 'LOCKED' etc.
throw e;
}
// Find WOW signature
@@ -317,11 +321,20 @@ const SmirkAuth = {
} catch (err) {
console.error('Smirk login failed:', err);
this._updateButton(btn, 'error');
this._updateButton(btn, 'error'); // button label becomes "Retry Smirk Connect"
// Show error message
const errorMsg = 'Smirk login failed: ' + err.message;
$('#messages').append($('<li class="error">').text(errorMsg));
// A locked wallet is an action, not a red error. Current Smirk builds auto-open the
// unlock popup on connect()/signNostrEvent(); older builds throw LOCKED — so guide the
// user to unlock and retry (the Retry button re-invokes connect(), which pops the
// unlock screen on the updated build).
const locked = (err && err.code === 'LOCKED') || /is locked/i.test((err && err.message) || '');
if (locked) {
$('#messages').append($('<li class="status">').text(
'🔒 Your Smirk wallet is locked. Open the Smirk extension, unlock it, then click "Retry Smirk Connect".'
));
} else {
$('#messages').append($('<li class="error">').text('Smirk login failed: ' + err.message));
}
throw err;
}