Skip to content

Conversation

yuubinnkyoku
Copy link
Collaborator

No description provided.

google-labs-jules bot and others added 16 commits August 13, 2025 05:25
This patch introduces a feature to save and restore the history of code written in the editor.

Key features:
- Code history is automatically saved when you stop typing for 2 seconds.
- A new screen is added to view the list of saved histories, sorted by timestamp.
- You can select a history entry to view the full code and restore it to the editor.
- The history is stored locally on your device, with each problem having its own history.

Note on tests:
The existing test suite has some failing tests (`widget_test.dart` and `update_service_test.dart`). These failures appear to be caused by pre-existing issues in the test setup, specifically related to network requests in the test environment. I have made an effort to fix the `widget_test.dart` by providing the necessary providers, but the underlying issue with async operations during app startup in tests remains. These failing tests are unrelated to the new code history feature.
…en.dart and widget_test.dart; adopt dev styles and test setup
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

📋レビュー概要

このプルリクエストは新しいコード履歴機能を導入し、ユーザーが問題ごとにコードを自動的に保存・復元できるようにします。実装には、新しいデータモデル、ファイルベースの履歴保存のためのサービス、履歴を表示するための新しい画面が含まれます。エディタ画面も大幅にリファクタリングされ、新しいUIレイアウトと自動保存機能が追加された。

全体として、これはユーザー体験を大幅に改善する素晴らしい機能追加である。コードは全般的によく構造化されている。私のレビューは、堅牢性、保守性、テストの改善に重点を置いています。

ᔍ 一般的なフィードバック

  • エラー処理**: 新しいファイルベースサービスには、I/O例外によるクラッシュを防ぐためのエラーハンドリングを含めるべきです。
  • CI/CD**: GitHub Actions ワークフローには、正しく実行するために対処すべき設定上の問題があります。
  • テスト: 新機能は、その正しさを保証し、将来のリグレッションを防ぐために、専用のウィジェットテストが役立つでしょう。
  • コードのクリーン化**: 削除されるべきデバッグログが残っています。

エディター画面のUI改善は素晴らしく、インターフェイスをより直感的にしています。よくやった!
*** Translated with www.DeepL.com/Translator (free version) ***

- '.github/workflows/build.yml'
# このファイル名に合わせてパスを更新
- '.github/workflows/flutter-ci.yml'
- 'android/**'
Copy link
Contributor

Choose a reason for hiding this comment

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

  • 🔴 critical: The trigger path for this workflow file is incorrect. The file is named build.yaml, but the path in the trigger is set to .github/workflows/flutter-ci.yml. This will prevent the workflow from running when this file itself is changed.
Suggested change
- 'android/**'
- '.github/workflows/build.yaml'

steps:
# Step 1: リポジトリのコードをチェックアウト
- name: Checkout code
uses: actions/checkout@v4
Copy link
Contributor

Choose a reason for hiding this comment

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

  • 🟡 medium: The contains function is not necessary here and makes the condition harder to read. A direct string comparison is simpler and achieves the same result. This comment applies to the other if conditions in this job as well.
Suggested change
uses: actions/checkout@v4
if: (github.event.inputs.build_type || 'split') == 'split'

# <--- 変更点: 以下の2つのステップでアップロードするファイルを分岐 --- >

# 分割APKをアップロード
- name: Upload Split APKs Artifact
Copy link
Contributor

Choose a reason for hiding this comment

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

  • 🟡 medium: The contains function is not necessary here. A direct string comparison is simpler and more readable. This comment also applies to the Release with Single APK step.
Suggested change
- name: Upload Split APKs Artifact
if: needs.build_android.outputs.build_type == 'split'

// CodeController の言語も更新
_codeController.language = _getHighlightLanguage(_selectedLanguage);
developer.log('Language changed to: $_selectedLanguage, loading code...', name: 'EditorScreen');
developer.log(
Copy link
Contributor

Choose a reason for hiding this comment

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

  • 🟢 low: This file contains a large number of developer.log and print statements. While useful for debugging, they should be removed or replaced with a more structured logging solution before this feature is released to production to avoid cluttering the console logs.
Suggested change
developer.log(
// developer.log('Language changed to: $_selectedLanguage, loading code...', name: 'EditorScreen');

import '../services/code_history_service.dart';
import 'code_history_screen.dart';

// 3点メニュー用のアクション列挙体(トップレベルに定義)
Copy link
Contributor

Choose a reason for hiding this comment

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

  • 🟢 low: For better encapsulation, you could define this enum inside the _EditorScreenState class, as it's only used there. However, since it's a private enum (_ToolbarAction), its scope is already limited to this file, so this is a minor stylistic suggestion.
Suggested change
// 3点メニュー用のアクション列挙体(トップレベルに定義)
enum _ToolbarAction { save, history, restore, reset, share }
class _EditorScreenState extends State<EditorScreen> {

@yuubinnkyoku yuubinnkyoku merged commit 0d6ec2f into dev Aug 14, 2025
1 check failed
@yuubinnkyoku yuubinnkyoku deleted the new-code-save branch August 14, 2025 00:22
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