Skip to content

fix(votes): quiet return visit — no banner, no form, only Ändern button - #117

Merged
DavidSchmidt00 merged 1 commit into
stagingfrom
claude/fix-padel-agent-93-GvGhn
May 19, 2026
Merged

DavidSchmidt00 merged 1 commit into
stagingfrom
claude/fix-padel-agent-93-GvGhn

Conversation

@DavidSchmidt00

Copy link
Copy Markdown
Owner

Problem

After the previous fix, returning visitors (localStorage has their votes) saw the full submit form again — confusing since they already voted. Submitting again then always showed "Verfügbarkeit gespeichert" on every future visit.

Solution

Three-state submit row via new sessionSubmitted flag:

State Bottom row
Never voted / editing Name field + "Verfügbarkeit speichern" button
Just submitted this session ✓ "Verfügbarkeit gespeichert"
Returning visitor (from localStorage) Empty — nothing shown

The ✏️ Ändern button at the top still appears whenever a previous vote exists.

Test plan

  • Open a vote you've voted on before → bottom is empty, only ✏️ Ändern at top
  • Click ✏️ Ändern → form appears, submit → success banner shows
  • Reload page → bottom is empty again (banner gone)
  • Open a vote you've never voted on → form shown normally

https://claude.ai/code/session_01Y9SKqkQP7DxXSe1TnXynin


Generated by Claude Code

…after submit

Introduces sessionSubmitted (boolean, default false) alongside submittedVotes:

  submittedVotes null          → show submit form (never voted / editing)
  submittedVotes set + session → show "Verfügbarkeit gespeichert ✓"
  submittedVotes set, no sess  → show nothing (returning visitor, quiet)

Returning visitors see the ✏️ Ändern button at the top and nothing at the
bottom — the success banner only appears immediately after submitting in
the current browser session.

Co-Authored-By: AI Agent <noreply@agent>
@DavidSchmidt00
DavidSchmidt00 merged commit 9984ece into staging May 19, 2026
1 check passed
@DavidSchmidt00
DavidSchmidt00 deleted the claude/fix-padel-agent-93-GvGhn branch May 19, 2026 12:10
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.

2 participants