Skip to content

✨ Voting Portal: Acclaimed Contests - #3077

Open
Findeton wants to merge 8 commits into
release/10.0from
feat/meta-12900/release/10.0
Open

✨ Voting Portal: Acclaimed Contests#3077
Findeton wants to merge 8 commits into
release/10.0from
feat/meta-12900/release/10.0

Conversation

@Findeton

Copy link
Copy Markdown
Contributor

@coderabbitai

coderabbitaiBot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8a01ef90-3b6e-4233-8f17-101db0b22c90

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@Findeton
Findeton marked this pull request as ready for review August 25, 2026 22:21
@github-actions

github-actionsBot commented Aug 25, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://docs.sequentech.io/docusaurus/pr-preview/pr-3077/

Built to branch doc-previews at 2026-08-26 01:47 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

area_id: String,
}

fn validate_manual_tally_sheet_contest(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a dedicated helper for a bool check? I think this should be inline instead. If it is ought to make more checks, take the whole contest and apply those too?

///
/// Acclaimed contests are displayed to the voter but never encoded, so
/// every codec, validation and consistency path must go through this
/// instead of reading `contests` directly. The voting portal keeps a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To uphold this requirement, we need to make contests field private (preferably real private, not pub(crate), or at least very narrowly scoped). It comes with some small structural update needs, but per my limited checks it should be rather minimal, aside from test fixture creations. To cover the required cases, we can export helpers, including test-only (feature gated extra impl or mods) tooling, as we do in beyond.

While I think making the whole struct more conservative would be better I'm aware that it'd blow way beyond this PR's scope. Since this introduces a new invariant for data consistency, I think it is worth to consider.
If we prefer to go this way, we'd need to do the same for the js types as well, provide accessors for "votable" or "full" contest list.

If you think this is not the correct time/place to introduce this change, I'd agree for sure, but would ask to add a doc on the contests field, so that anyone reaching to it can be aware of the semantic difference. Maybe something like:

/// All the contest available in this style./// It may include those are display-only (e.g., skipped by checks, not encoded) too./// See [Self::votable_contests()] for details.pub contests:Vec<Contest>,

{translate(question, "name", i18n.language) || ""}
</Typography>
{displayedAcclamationDescription ? (
<Typography variant="body2" className="contest-acclamation">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend using info style Alert instead (for all acclamation messages), I think it'd be more readable and nicer as UI.

Ok(())
}

fn sorted_ids(ids: &HashSet<&str>) -> Vec<String> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fn sorted_ids(ids:&HashSet<&str>) -> Vec<String>{
fn sorted_ids<'a>(ids:&HashSet<&'astr>) -> Vec<&'astr>{
letmut ids:Vec<_> = ids.iter().copied().collect();
ids.sort_unstable();
ids
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, we definitely need a guard on the endpoint publishing the changes to prevent acclamation change. An administrative/config issue shouldn't allow corrupting data or causing incorrectly decoded votes, but result in error or bad ux at most, I think.

///
/// Blank/invalid markers, withdrawn candidates, and empty write-in slots
/// are ballot configuration artefacts rather than elected candidates.
pub fn is_eligible_acclaimed_candidate(&self) -> bool {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this naming is quite confusing, maybe something like is_acclamation_eligible read better, took me a while to figure this out for real. If you agree, all the call sites and relevant field/functions/variables should be updated for the new naming.

Sign up for freeto 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

@Findeton@eselimsen