Skip to content

refactor: multiple fixes and improvements#43

Merged
elboletaire merged 13 commits into
mainfrom
f/fixes-and-improvements-42
Nov 17, 2025
Merged

refactor: multiple fixes and improvements#43
elboletaire merged 13 commits into
mainfrom
f/fixes-and-improvements-42

Conversation

@elboletaire

Copy link
Copy Markdown
Member

refs #42

Copilot AI review requested due to automatic review settings November 17, 2025 12:03
@elboletaire elboletaire marked this pull request as draft November 17, 2025 12:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new ElectionContext to centralize election data management and computed values, refactoring components to consume this shared state instead of maintaining their own local state or making redundant API calls. The changes improve data consistency, reduce code duplication, and establish a single source of truth for election-related information.

Key changes:

  • Added ElectionProvider with auto-refreshing election data and computed values for status, timing, and vote counts
  • Refactored ProcessProvider to consume election data from ElectionContext when available
  • Updated multiple components to use centralized election state instead of local state management

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/pages/VotePage.tsx Wrapped the vote page with ElectionProvider to provide election context
src/contexts/election-context.tsx New context provider managing election state, polling, and computed values
src/contexts/process-context.tsx Modified to consume and use election data from ElectionContext
src/components/vote-parameters.tsx Removed local state management, now uses useElection hook for status and timing
src/components/vote-display.tsx Replaced local process queries and state with useElection hook, added voting method lookup map
src/components/vote-actions.tsx Updated to use election status values from useElection hook

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/contexts/election-context.tsx
Comment thread src/contexts/election-context.tsx Outdated
Comment thread src/contexts/election-context.tsx
@github-actions

github-actions Bot commented Nov 17, 2025

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request November 17, 2025 12:04 Inactive
@github-actions github-actions Bot temporarily deployed to pull request November 17, 2025 12:44 Inactive
@github-actions github-actions Bot temporarily deployed to pull request November 17, 2025 14:25 Inactive
@elboletaire elboletaire force-pushed the f/fixes-and-improvements-42 branch from afa0189 to 103cd43 Compare November 17, 2025 15:24
@github-actions github-actions Bot temporarily deployed to pull request November 17, 2025 15:25 Inactive
@github-actions github-actions Bot temporarily deployed to pull request November 17, 2025 16:22 Inactive
@github-actions github-actions Bot temporarily deployed to pull request November 17, 2025 16:46 Inactive
@elboletaire elboletaire marked this pull request as ready for review November 17, 2025 17:24
@github-actions github-actions Bot temporarily deployed to pull request November 17, 2025 17:25 Inactive
@github-actions github-actions Bot temporarily deployed to pull request November 17, 2025 17:43 Inactive
@elboletaire elboletaire merged commit 50f8b21 into main Nov 17, 2025
2 checks passed
@github-actions github-actions Bot temporarily deployed to production November 17, 2025 17:44 Inactive
@elboletaire elboletaire deleted the f/fixes-and-improvements-42 branch November 17, 2025 17:44
@github-actions github-actions Bot temporarily deployed to pull request November 17, 2025 17:44 Inactive
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