fix: voting-rules save, ballot-refusal message, teams More-Information error - #192
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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 callsform.reset().checked={data.policy.ownTeamVoting}sets the checkbox property, neverdefaultChecked, so reset reverts it to unchecked; and becauseownTeamVotingdefaults 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 thefalsethe organiser never chose. Fixed with the file's existingkeepValueshandler (update({ reset: false })). (Confirmed from the reporter's before/after screenshots.)Add frontend sveltekit setup #8 (partial) A refused ballot now says why —
castBallotcollapsed everyFAILED_PRECONDITIONinto "Voting is not open." SubmitVote returns that code for two separate states — thevotingEnabledmaster switch, and theVOTEcapability 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.feat: add backend to proc compose setup of the project #10 Teams "More Information" throws (Thibaut, high) — TeamCard resolves
moreInfoHrefthrough SvelteKit'sresolve()(route-id typed), but the teams list passed the fragment#team-{id}(cast toany), whichresolve()rejects at runtime. main'steams/[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.tsfile;.sveltefiles are not treefmt-formatted (confirmed: treefmt-nix prettier excludes.svelte)Related, NOT in this PR (need a product decision)
Edit teambutton has no action wired. Decide: port main's team detail/edit page, or hide the control.