Skip to content

fix: voting-rules save, ballot-refusal message, teams More-Information error - #192

Merged
caviri merged 3 commits into
developfrom
fix/feedback-voting-20260819
Aug 18, 2026
Merged

fix: voting-rules save, ballot-refusal message, teams More-Information error#192
caviri merged 3 commits into
developfrom
fix/feedback-voting-20260819

Conversation

@caviri

@caviri caviri commented Aug 18, 2026

Copy link
Copy Markdown
Member

Second batch from the 2026-08-18 QA feedback. All three are confirmed from the primary source (screenshots / code trace), verified with svelte-check (0 errors) and prettier.

Fixes

  1. feat: add frontend with authentication #9 Saving voting rules silently unchecks "own-team voting" (Thibaut, high) — the Rules form used a bare use:enhance, whose default success handler calls form.reset(). checked={data.policy.ownTeamVoting} sets the checkbox property, never defaultChecked, so reset reverts it to unchecked; and because ownTeamVoting defaults to checked and round-trips to the same value, Svelte's reactivity never re-asserts it. The data saved correctly — only the display lied, and a second save from that state would store the false the organiser never chose. Fixed with the file's existing keepValues handler (update({ reset: false })). (Confirmed from the reporter's before/after screenshots.)

  2. Add frontend sveltekit setup #8 (partial) A refused ballot now says whycastBallot collapsed every FAILED_PRECONDITION into "Voting is not open." SubmitVote returns that code for two separate states — the votingEnabled master switch, and the VOTE capability being closed by the current phase — so an organiser couldn't tell which of the two controls to fix. Now surfaces the server's own detail. Note: Add frontend sveltekit setup #8's deeper cause is that phase "Vote" checkboxes are descriptive only ("does not turn these actions on or off") while voting needs a separate master switch — a coupling decision, tracked separately.

  3. feat: add backend to proc compose setup of the project #10 Teams "More Information" throws (Thibaut, high) — TeamCard resolves moreInfoHref through SvelteKit's resolve() (route-id typed), but the teams list passed the fragment #team-{id} (cast to any), which resolve() rejects at runtime. main's teams/[teamId] detail page was never carried onto this branch, so the fragment had no target either. The link is now only rendered for a real in-app route; ProjectCard's real-route callers are unaffected.

Verification

  • svelte-check — 0 errors (5 pre-existing warnings, unrelated files)
  • prettier --check (repo config) clean on the .ts file; .svelte files are not treefmt-formatted (confirmed: treefmt-nix prettier excludes .svelte)

Related, NOT in this PR (need a product decision)

caviri added 3 commits August 19, 2026 00:15
…team

The Rules form used a bare `use:enhance`, whose default success handler calls
form.reset(). `checked={data.policy.ownTeamVoting}` sets the checkbox PROPERTY,
never the defaultChecked ATTRIBUTE, so reset reverts every box to unchecked.
`ownTeamVoting` defaults to checked and round-trips to the same value, so
Svelte's fine-grained reactivity never re-asserts the property — the reset's
uncheck sticks and the save looks like it turned the rule off. The data was
saved correctly; only the display lied, and a second save from that state would
have stored the false the organiser never chose.

Uses the file's existing `keepValues` handler (update({ reset: false })), which
keeps the invalidation that reflects genuine changes while dropping the
destructive reset.
castBallot mapped every FAILED_PRECONDITION to one string, "Voting is not open
for this hackathon." SubmitVote answers that code for two distinct states — the
votingEnabled master switch being off, and the VOTE capability being closed by
the current phase — so an organiser was told voting was closed with no way to
know which of the two separate controls to fix. Surface the server's own detail
(the same `e.details || "…"` pattern this file already uses for other codes).
TeamCard resolves its moreInfoHref through SvelteKit's resolve(), which takes a
route id. The teams list passed "#team-{id}" — a bare fragment, cast to `any`
to get past the type checker — and resolve() throws on it, so clicking "More
Information" errored. There is also no element with that id to scroll to: main's
teams/[teamId] detail page was not carried onto this branch, so the fragment
never had a target.

Guard the link on a real in-app route (moreInfoHref.startsWith("/")) and stop
the teams page passing a fragment, so the dead link is not offered until a team
detail page exists to point at. ProjectCard's callers pass real routes and are
unaffected.
@caviri
caviri merged commit 455feff into develop Aug 18, 2026
1 check passed
@caviri
caviri deleted the fix/feedback-voting-20260819 branch August 18, 2026 22:21
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.

1 participant