Skip to content

Conversation

@Hosoda-abo
Copy link
Member

@Hosoda-abo Hosoda-abo commented Dec 8, 2025

@Hosoda-abo Hosoda-abo self-assigned this Dec 8, 2025
@kantacky kantacky added this to the 251225_1.7.0 milestone Dec 23, 2025
Hosoda-abo and others added 2 commits December 25, 2025 20:33
* Create GitHubContributorVieeModel

* Create githubContributorViewModelTest

* Refactor GithubContributorViewmodel to use a class-level service instance for improved code clarity and efficiency (#417)

---------

Co-authored-by: Kanta Oikawa <[email protected]>
* Create GitHubContributorVieeModel

* Create githubContributorViewModelTest

* Create githubContributorScreen

* Fix Copilot error

* Transition from the Settings Screen to the GitHub Contributor Screen

* Fix copilot error

* Fix the classname GitHubContributorViewModelProvider

* Display usename

* Update lib/feature/setting/settings.dart

Co-authored-by: Kanta Oikawa <[email protected]>

* Refactor GithubContributorViewmodel to use a class-level service instance for improved code clarity and efficiency (#417)

---------

Co-authored-by: Kanta Oikawa <[email protected]>
@Hosoda-abo Hosoda-abo marked this pull request as ready for review December 25, 2025 12:08
@Hosoda-abo Hosoda-abo requested review from a team, Copilot, hikaru-0602 and kantacky December 25, 2025 12:08
@github-actions
Copy link

github-actions bot commented Dec 25, 2025

2 Warnings
⚠️ このPRは大きすぎます (556 lines)。小さなPRに分割することを検討してください。
⚠️ アプリコードが変更されていますが、テストが追加されていません。テストの追加を検討してください。
2 Messages
📖 追加されたファイル: lib/domain/github_profile.dart, lib/feature/github_contributor/github_contributor_screen.dart, lib/feature/github_contributor/github_contributor_service.dart, lib/feature/github_contributor/github_contributor_viewmodel.dart, lib/feature/github_contributor/github_contributor_viewstate.dart, lib/repository/github_contoributor_repository.dart, test/feature/github_contributors/github_contributor_service_test.dart, test/feature/github_contributors/github_contributor_service_test.mocks.dart, test/feature/github_contributors/github_contributor_viewmodel_test.dart, test/feature/github_contributors/github_contributor_viewmodel_test.mocks.dart
📖 Dangerのチェックが完了しました! 🎉

Generated by 🚫 Danger

@Hosoda-abo Hosoda-abo requested a review from ryka-1104 December 25, 2025 12:09
Copy link

Copilot AI left a comment

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 implements a GitHub Contributors display feature that fetches and shows the list of contributors from the GitHub API. It follows clean architecture principles with domain, repository, service, and presentation layers, and includes comprehensive test coverage.

  • Adds a complete GitHub contributors feature with clean architecture separation
  • Implements UI screen with pull-to-refresh functionality
  • Includes comprehensive unit tests for service and viewmodel layers

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
lib/domain/github_profile.dart Defines the domain model for GitHub profile data with JSON serialization
lib/repository/github_contoributor_repository.dart Implements repository layer to fetch contributors from GitHub API
lib/feature/github_contributor/github_contributor_service.dart Service layer that wraps repository calls
lib/feature/github_contributor/github_contributor_viewmodel.dart ViewModel managing state and business logic for contributors screen
lib/feature/github_contributor/github_contributor_viewstate.dart View state model holding contributors list
lib/feature/github_contributor/github_contributor_screen.dart UI screen displaying contributors with pull-to-refresh
lib/feature/setting/settings.dart Adds navigation to contributors screen from settings
test/feature/github_contributors/github_contributor_service_test.dart Unit tests for service layer
test/feature/github_contributors/github_contributor_viewmodel_test.dart Unit tests for viewmodel layer
test/feature/github_contributors/github_contributor_service_test.mocks.dart Generated mocks for service tests
test/feature/github_contributors/github_contributor_viewmodel_test.mocks.dart Generated mocks for viewmodel tests

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

@@ -0,0 +1,13 @@
import 'package:dotto/domain/github_profile.dart';
import 'package:dotto/repository/github_contoributor_repository.dart';
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

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

The import path contains a typo: "contoributor" should be "contributor".

Suggested change
import 'package:dotto/repository/github_contoributor_repository.dart';
import 'package:dotto/repository/github_contributor_repository.dart';

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +14
final GitHubContributorServiceProvider = Provider<GitHubContributorService>(
GitHubContributorService.new,
);
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

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

Provider naming should follow Dart naming conventions. Variable names should use lowerCamelCase, not UpperCamelCase. This should be gitHubContributorServiceProvider instead of GitHubContributorServiceProvider.

Copilot uses AI. Check for mistakes.
).thenAnswer((_) async => testGitHubProfiles);

final container = createContainer();
final service = container.read(githubContributionRepositoryProvider);
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

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

Inconsistent provider usage. Line 54 uses githubContributionRepositoryProvider which is the repository provider, but the test should be reading the service provider. This appears to be testing the repository directly instead of the service layer.

Suggested change
final service = container.read(githubContributionRepositoryProvider);
final service = container.read(GitHubContributorServiceProvider);

Copilot uses AI. Check for mistakes.
import 'github_contributor_viewmodel_test.mocks.dart';

abstract interface class Listener<T> {
void call(T? previous, T next);
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

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

The signature for the Listener interface is inconsistent. The call method expects T next (non-nullable) but the mock implementation at line 58 uses T? next (nullable). This creates a mismatch between the interface and its implementation.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +35
throw Exception('Failed to get contributors');
}

final data = response.data;
if (data == null || data is! List) {
throw Exception('Failed to get contributors');
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

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

The error messages for different failure scenarios are identical, making debugging difficult. Consider providing more specific error messages for different cases: status code != 200 vs invalid response data structure.

Suggested change
throw Exception('Failed to get contributors');
}
final data = response.data;
if (data == null || data is! List) {
throw Exception('Failed to get contributors');
throw Exception(
'Failed to get contributors: HTTP ${response.statusCode}',
);
}
final data = response.data;
if (data == null || data is! List) {
throw Exception('Failed to get contributors: invalid response format');

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,46 @@
import 'package:dotto/domain/github_profile.dart';
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

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

The filename contains a typo: "contoributor" should be "contributor". This affects the import path used throughout the codebase.

Copilot uses AI. Check for mistakes.
import 'package:dotto/domain/github_profile.dart';
import 'package:dotto/feature/github_contributor/github_contributor_viewmodel.dart';
import 'package:dotto/feature/github_contributor/github_contributor_viewstate.dart';
import 'package:dotto/repository/github_contoributor_repository.dart';
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

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

The import path contains a typo: "contoributor" should be "contributor".

Suggested change
import 'package:dotto/repository/github_contoributor_repository.dart';
import 'package:dotto/repository/github_contributor_repository.dart';

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,98 @@
import 'package:dotto/domain/github_profile.dart';
import 'package:dotto/feature/github_contributor/github_contributor_service.dart';
import 'package:dotto/repository/github_contoributor_repository.dart';
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

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

The import path contains a typo: "contoributor" should be "contributor".

Suggested change
import 'package:dotto/repository/github_contoributor_repository.dart';
import 'package:dotto/repository/github_contributor_repository.dart';

Copilot uses AI. Check for mistakes.
@override
Future<List<GitHubProfile>> getContributors() async {
try {
final dio = Dio();
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

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

A new Dio instance is created on every API call, which is inefficient and prevents proper configuration reuse (headers, timeouts, interceptors). The Dio instance should be injected as a dependency or created once and reused.

Copilot uses AI. Check for mistakes.
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.

Contributors 表示

3 participants