portfolio-edit: form is edit-mode only; submit becomes a + glyph

Two related polishes:

- The add form was auto-shown by the empty-state path so brand-new
  users would see something to act on. That conflicts with the user's
  preference for "Edit always toggles the form, no other path." The
  empty state now shows guidance copy ("click edit to add one")
  instead. exitEditMode always hides the form too.
- The submit "add" word-button is replaced by a square accent-bordered
  + glyph (26×26). Matches the visual weight of the calendar ghost
  next to it but stays in the accent colour so it reads as primary.
  Adds a tiny active-state scale tick for tactile feedback.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Giorgio Gilestro 2026-05-27 15:22:13 +02:00
parent 2ffd228976
commit 6377c929b8
4 changed files with 27 additions and 17 deletions

View file

@ -189,13 +189,13 @@
mount.innerHTML =
'<div class="empty" style="padding:16px;">' +
notice +
'Welcome — start by adding a position above, or ' +
'No positions yet — click <strong>edit</strong> to add one, or ' +
'<a href="/settings#import">import a CSV from your broker →</a>' +
'</div>';
// When empty, the add form should be visible by default — the
// edit module toggles it via the pf-empty class.
// The form is only ever visible in edit mode — never auto-shown by
// the empty state. Defensive: ensure it stays hidden here.
var form = document.getElementById('pf-add-form');
if (form) form.hidden = false;
if (form) form.hidden = true;
}
// Silently remove an unrecoverable cloud blob and re-render. The user