Skip to content

✨ Voting Portal: Acclaimed Contests - #3077

Merged
Findeton merged 10 commits into
release/10.0from
feat/meta-12900/release/10.0
Aug 28, 2026
Merged

✨ Voting Portal: Acclaimed Contests#3077
Findeton merged 10 commits into
release/10.0from
feat/meta-12900/release/10.0

Conversation

@Findeton

Copy link
Copy Markdown
Contributor

@coderabbitai

coderabbitai Bot 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: 158fa18e-49b8-4cbe-b465-e025fc3f5902

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-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-28 23:39 UTC

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>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

let's do this in another ticket :)

{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.

Comment thread packages/sequent-core/src/plaintext.rs Outdated
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<&'a str>) -> Vec<&'a str> {
let mut 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll add it, as even though it's not the focus of the PR, it's long overdue

Comment thread packages/sequent-core/src/ballot.rs Outdated
///
/// 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.

@Findeton
Findeton merged commit f8e3c61 into release/10.0 Aug 28, 2026
32 checks passed
@Findeton
Findeton deleted the feat/meta-12900/release/10.0 branch August 28, 2026 23:35
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