Repository navigation
feat: 初回インストール時にサンプルのグループを設定する - #109
Merged
Merged
Conversation
初回インストール時にサンプルのグループを事前設定する機能(#108)のため、 投入する3件のルール(設定・動画・ブログ)を作る createSampleRules を追加する。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
拡張機能を初めてインストールし、ルールが1件も無いときにだけ、 サンプルルール3件(設定・動画・ブログ)を保存してから既存の regroupAll を実行するようにする。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
E2E は毎回新しいプロフィールで拡張機能を読み込むため、必ず reason: "install" になり、 background がサンプルルールの投入と regroupAll を行う。これがテストの setRules 等の操作と 非同期にレースし、CI で意図しないサンプルルール名が結果に混ざって5件のテストが失敗していた。 serviceWorker フィクスチャで、サンプルルール3件分のタイトルの記録が終わるまで待ってから テストへ制御を渡すようにし、「ルールがない」テストは初回インストールの素の状態ではなく 明示的に全消去した状態として扱うよう直した。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Oct 29, 2026
wire2c7
added a commit
that referenced
this pull request
Oct 29, 2026
## 概要 #109(サンプルルール投入)のOpenSpec change `seed-sample-rules-on-install` が、タスク完了済みにもかかわらず `openspec sync specs` と archive を行っていなかった。main specの「初回インストール時」シナリオをADR 0027の結果節どおりに更新し、changeをarchiveした。 ## 関連Issue Closes #120 ## 関連ADR なし(`docs/adr/0027-seed-sample-rules-on-install.md` の結果節に書かれた未実施の後始末) ## 変更内容 - `openspec/specs/grouping-rules/spec.md` の「初回インストール時」シナリオをサンプルルール投入後の挙動に更新 - 要件「初回インストール時のサンプルルールの投入」「サンプルルールの内容」をmain specに追加 - `openspec/changes/seed-sample-rules-on-install/` を `openspec/changes/archive/2026-10-30-seed-sample-rules-on-install/` にarchive ## 確認方法 - `openspec validate --specs` が通ることを確認済み ## チェックリスト - [x] PRタイトルとコミットメッセージが Conventional Commits に従っている - [x] `nix flake check` と `prek run --all-files` が通る - [x] 必要に応じてドキュメント(README.md / AGENTS.md)を更新した - [ ] 設計判断を含む場合は `docs/adr/` に ADR を追加した(該当なし) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
初回インストール時(
browser.runtime.onInstalledのreason === "install")にだけ、サンプルルール3件(設定・動画・ブログ)を投入し、インストール直後から自動グルーピングの効果を体験できるようにする。関連Issue
Closes #108
関連ADR
docs/adr/0027-seed-sample-rules-on-install.md
変更内容
utils/rules/seed.ts: サンプルルール3件(⚙設定・📺️動画・📃ブログ)を作るcreateSampleRulesを追加entrypoints/background/rules.ts: 書き込み用のrulesStoreを公開し、seedSampleRulesOnFirstInstallを追加entrypoints/background/grouping.ts:onInstalledリスナーで、初回インストール時にサンプルルールを投入してからregroupAllするよう変更openspec/changes/seed-sample-rules-on-install/: OpenSpec の change 一式(proposal / specs delta / design / tasks、全タスク完了)docs/adr/0027-seed-sample-rules-on-install.md: 設計判断の記録確認方法
pnpm testでutils/rules/seed.test.ts・entrypoints/background/rules.test.tsを含む全テストが通ることを確認pnpm build後、Playwright MCP で options ページを開き、ルール一覧の表示を確認(ただし既存のE2Eプロファイルに以前のテストデータが残っていたため、真の初回インストール状態そのものはこのPR作成時点では未確認。単体テストで reason・既存ルール有無の分岐はカバー済み)チェックリスト
nix flake checkとprek run --all-filesが通るdocs/adr/に ADR を追加した🤖 Generated with Claude Code