Skip to content

feat: 投票結果表示機能を追加し、関連する状態管理を実装#743

Draft
shiosyakeyakini-info wants to merge 1 commit intodevelopfrom
feature/fix_poll
Draft

feat: 投票結果表示機能を追加し、関連する状態管理を実装#743
shiosyakeyakini-info wants to merge 1 commit intodevelopfrom
feature/fix_poll

Conversation

@shiosyakeyakini-info
Copy link
Owner

This pull request introduces functionality to manage the visibility of poll results in notes. It adds a new field isPollResultOpened to the NoteStatus class and integrates it into the NoteRepository for state management. Additionally, it updates the NoteVote widget to utilize this new state for handling poll result visibility. Mock implementations for testing this functionality have also been updated.

Feature Addition: Poll Result Visibility Management

  • lib/repository/note_repository.dart: Added a new field isPollResultOpened to the NoteStatus class and implemented methods in NoteRepository to toggle, set, and retrieve the poll result visibility state. The initial visibility state is determined based on poll expiration and voting status. [1] [2] [3]

Integration with NoteVote Widget

  • lib/view/common/misskey_notes/note_vote.dart: Updated the NoteVote widget to use the poll result visibility state from NoteRepository instead of local hook state. Voting success now triggers the visibility of poll results, and tapping to toggle visibility is handled via the repository. [1] [2] [3] [4] [5]

Code Generation Updates

Mock Implementation for Testing

  • test/test_util/mock.mocks.dart: Added mock implementations for the new methods in NoteRepository (togglePollResult, setPollResultOpened, getPollResultOpened) to facilitate testing.

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