Reproduce
- Click the gitmarks toolbar icon on any page
- Click Save this page
- Wait for the green "✓ saved" line to appear under the button
Expected
Button reflects the new state — either says "Saved ✓" with a normal cursor, or text changes to "Save again" and re-enables, or the popup auto-closes after a brief delay.
Actual
Button still says "saving…" and is disabled. Because of `button:disabled { cursor: progress; }` in `packages/extension-shared/src/popup.html:26`, hovering it shows a loading cursor. The popup remains open with this confusing dual state ("saving…" button + "✓ saved" status text) until the user clicks elsewhere to dismiss it.
Root cause
`packages/extension-shared/src/popup.ts:107-115` — the success branch only sets the status text:
```ts
if (result.ok) {
status.className = "ok";
status.textContent = "✓ saved";
} else {
status.className = "err";
status.textContent = result.message;
saveBtn.disabled = false;
saveBtn.textContent = "Try again";
}
```
The failure branch correctly re-enables the button and updates its text; the success branch doesn't.
Suggested fix
Pick one (recommended ordering):
- Auto-close popup after ~600ms on success. Cleanest UX — the popup served its purpose, get out of the way. Matches how most browser action popups behave after a one-shot action.
- Re-enable + relabel to "Saved ✓" and keep the click handler idempotent (saves again on click), or
- Re-enable + relabel to "Close" that calls `window.close()`.
I lean (1). If we go with (1), make sure the timeout still gives screen-reader users time to hear the status update.
Scope
Single file edit in `packages/extension-shared/src/popup.ts`. Add a vitest case in `packages/extension-shared/test/` that exercises the popup save flow if not already covered.
Reproduce
Expected
Button reflects the new state — either says "Saved ✓" with a normal cursor, or text changes to "Save again" and re-enables, or the popup auto-closes after a brief delay.
Actual
Button still says "saving…" and is
disabled. Because of `button:disabled { cursor: progress; }` in `packages/extension-shared/src/popup.html:26`, hovering it shows a loading cursor. The popup remains open with this confusing dual state ("saving…" button + "✓ saved" status text) until the user clicks elsewhere to dismiss it.Root cause
`packages/extension-shared/src/popup.ts:107-115` — the success branch only sets the status text:
```ts
if (result.ok) {
status.className = "ok";
status.textContent = "✓ saved";
} else {
status.className = "err";
status.textContent = result.message;
saveBtn.disabled = false;
saveBtn.textContent = "Try again";
}
```
The failure branch correctly re-enables the button and updates its text; the success branch doesn't.
Suggested fix
Pick one (recommended ordering):
I lean (1). If we go with (1), make sure the timeout still gives screen-reader users time to hear the status update.
Scope
Single file edit in `packages/extension-shared/src/popup.ts`. Add a vitest case in `packages/extension-shared/test/` that exercises the popup save flow if not already covered.