Skip to content

feat(installed): add search count display setting#207

Merged
ryota-murakami merged 3 commits into
mainfrom
codex/installed-search-count-display
Jun 12, 2026
Merged

feat(installed): add search count display setting#207
ryota-murakami merged 3 commits into
mainfrom
codex/installed-search-count-display

Conversation

@ryota-murakami

@ryota-murakami ryota-murakami commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add an Installed search count display setting with tab as the default and inline as an alternate placement.
  • Show the current visible Installed count from the filtered skill list while keeping Marketplace count-free.
  • Add Settings → Appearance controls, IPC/schema validation, browser tests, and deterministic Electron E2E coverage.

Verification

  • pnpm test:e2e e2e/spec/installed-search-count.e2e.ts
  • pnpm exec eslint e2e/spec/installed-search-count.e2e.ts
  • pnpm exec tsc --noEmit --pretty false
  • pnpm validate
  • pnpm test:e2e

QA

  • Manual Electron QA completed for tab badge, inline toolbar, filtered zero state, filter updates, Marketplace count-free behavior, and persistence.

Summary by CodeRabbit

  • 新機能

    • Appearance設定でInstalled検索結果数の表示位置を「タブ内バッジ」または「インライン(ツールバー)」から切替可能に。メイン画面と検索欄で選択に応じて表示が切り替わります。
  • テスト

    • 表示切替・永続化・可視性(件数0/1/3など)を検証する単体/統合/E2Eテストを追加しました。
  • 設定

    • 表示設定の既定値は「タブ」になっています。

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
skills-desktop Ready Ready Preview, Comment Jun 12, 2026 3:27am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Installedスキル検索結果数の表示位置を切り替える機能を実装。'tab'(デフォルト、タブ内バッジ)と'inline'(ツールバー下テキスト)の2モードをスキーマで定義し、IPC検証、設定UI、表示ロジック、テスト、E2E検証で統合的に対応。

Changes

Installed検索結果数表示位置の設定機能

Layer / File(s) Summary
共有スキーマと定数
src/shared/settings.ts, src/shared/settings.test.ts
INSTALLED_SEARCH_COUNT_DISPLAY_OPTIONS'tab' | 'inline')を追加し、SettingsSchemaに installedSearchCountDisplay を z.enum で定義、デフォルト 'tab' を DEFAULT_SETTINGS に反映。テストでデフォルト値・保持・不正値拒否を検証。
Main process IPC検証スキーマ
src/main/ipc/ipc-schemas.ts, src/main/ipc/ipc-schemas.test.ts
settings:set IPC 引数スキーマに installedSearchCountDisplay を追加。許可値('inline''tab')の受理、未知値('marketplace')の拒否、他設定保存時に既存値が消えないことをテスト。
Appearance設定UI実装
src/renderer/settings/sections/Appearance.tsx, src/renderer/settings/sections/Appearance.browser.test.tsx
Appearance に「Installed search count display」ToggleGroup を追加。store から値を読み、updateSettings/electron.settings.set で永続化するハンドラとブラウザテストを追加。
MainContent表示モード切り替え
src/renderer/src/redux/selectors.ts, src/renderer/src/components/layout/MainContent.tsx
selectFilteredSkillCount セレクタを追加。MainContent に InstalledTabLabel(バッジ)と InstalledInlineCount(aria-live テキスト)を追加し、設定に応じて表示を切替。SearchBox 下にインライン領域を追加。
テスト基盤の統一化
src/main/services/settings.test.ts, src/renderer/src/components/layout/MainContent.browser.test.tsx, src/renderer/src/components/layout/MainContent.selectionToolbar.browser.test.tsx
複数テストで DEFAULT_SETTINGS を参照し、テスト用ストアに settingsSlice を組み込む初期化へ変更。settings.test.ts も DEFAULT_SETTINGS を利用。
MainContent統合テスト
src/renderer/src/components/layout/MainContent.browser.test.tsx
Installed 表示数に関するテストスイート(デフォルト表示、フィルタ変更時の更新、installedSearchCountDisplay: 'inline' の切替検証)を追加。
E2E実装全体の検証
e2e/spec/installed-search-count.e2e.ts
隔離HOMEにスキルと .skill-lock.json をステージするユーティリティ、レンダラ側で検索クエリと選択ソースを同一トランザクションで適用する helper を追加。tab/inline 両モードで可視件数と設定永続化を検証する E2E テストを追加。

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs:

  • laststance/skills-desktop#168: selectFilteredSkills に関連する変更があり、selectFilteredSkillCount および Installed カウント挙動と直接関連。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは、メイン機能である「Installed検索結果数の表示位置設定」を正確に説明しており、変更セット全体(スキーマ、IPC検証、UI、テスト)を適切に代表している。
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/installed-search-count-display

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter

codecov-commenter commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 66.68%. Comparing base (a3b2d3b) to head (6f9aa3e).

Files with missing lines Patch % Lines
src/renderer/settings/sections/Appearance.tsx 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #207      +/-   ##
==========================================
+ Coverage   66.56%   66.68%   +0.12%     
==========================================
  Files         198      198              
  Lines        6101     6127      +26     
  Branches     1380     1384       +4     
==========================================
+ Hits         4061     4086      +25     
  Misses       1623     1623              
- Partials      417      418       +1     
Flag Coverage Δ
unittests 66.68% <96.15%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/spec/installed-search-count.e2e.ts`:
- Around line 119-121: Inside the page.evaluate callback the expression
"window.__store__ ?? window.__store" is redundant; replace it with a single
property access so that the store is obtained as "const store =
window.__store__" (update the code inside the page.evaluate(({ query, sources })
=> { ... }) callback that references window.__store__ and the variable store).
- Around line 208-210: The waitForFunction callback redundantly uses the same
nullish coalescing expression window.__store__ ?? window.__store (in
appWindow.waitForFunction); replace the redundant expression with a single
property access (e.g., use window.__store__ only) so the check mirrors the
earlier fix at line 120 and returns the same store variable without duplicate
operands.
- Line 22: Replace the hard-coded union type SearchCountDisplaySetting with a
derived type from the shared settings to avoid drift: import the Settings type
from the shared settings module (referencing Settings) and set
SearchCountDisplaySetting = Settings['installedSearchCountDisplay'] so the test
derives its allowed values from the source of truth
(INSTALLED_SEARCH_COUNT_DISPLAY_OPTIONS /
SettingsSchema.installedSearchCountDisplay) rather than duplicating the literal
union.

In `@src/shared/settings.ts`:
- Around line 35-39: Shared constant INSTALLED_SEARCH_COUNT_DISPLAY_OPTIONS is
duplicated in the renderer; update the renderer (Appearance.tsx) to import
INSTALLED_SEARCH_COUNT_DISPLAY_OPTIONS from src/shared/settings.ts and remove
the local duplicate, then build a label metadata mapping from that imported
tuple (e.g., map each value to its display label in the renderer's UI code such
as the options list for the Installed view) so the shared schema remains the
single source of truth.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3b3d4611-506d-438e-b573-bba9a307e230

📥 Commits

Reviewing files that changed from the base of the PR and between a3b2d3b and c6c22eb.

📒 Files selected for processing (12)
  • e2e/spec/installed-search-count.e2e.ts
  • src/main/ipc/ipc-schemas.test.ts
  • src/main/ipc/ipc-schemas.ts
  • src/main/services/settings.test.ts
  • src/renderer/settings/sections/Appearance.browser.test.tsx
  • src/renderer/settings/sections/Appearance.tsx
  • src/renderer/src/components/layout/MainContent.browser.test.tsx
  • src/renderer/src/components/layout/MainContent.selectionToolbar.browser.test.tsx
  • src/renderer/src/components/layout/MainContent.tsx
  • src/renderer/src/redux/selectors.ts
  • src/shared/settings.test.ts
  • src/shared/settings.ts

Comment thread e2e/spec/installed-search-count.e2e.ts Outdated
Comment thread e2e/spec/installed-search-count.e2e.ts
Comment thread e2e/spec/installed-search-count.e2e.ts
Comment thread src/shared/settings.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/settings/sections/Appearance.tsx (1)

134-140: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

手動バリデーションの値がハードコードされており、共有定数との同期リスクがある

Line 136 の if (nextValue !== 'tab' && nextValue !== 'inline') は、INSTALLED_SEARCH_COUNT_DISPLAY_VALUES の実体とは独立してリテラルをチェックしている。共有定数が拡張された場合に手動更新が必要になり、ドリフトの原因となる。

INSTALLED_SEARCH_COUNT_DISPLAY_VALUES.includes(nextValue as any) による型ガードに置き換えることで、共有スキーマとの同期を機械的に保証できる。

🔧 提案される修正
 const handleSearchCountDisplayChange = React.useCallback(
   (nextValue: string): void => {
-    if (nextValue !== 'tab' && nextValue !== 'inline') return
+    if (!INSTALLED_SEARCH_COUNT_DISPLAY_VALUES.includes(nextValue as any)) return
     updateSettings({ installedSearchCountDisplay: nextValue })
   },
   [updateSettings],
 )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/renderer/settings/sections/Appearance.tsx` around lines 134 - 140, The
manual validation in handleSearchCountDisplayChange currently hardcodes the
allowed strings; replace the literal check (nextValue !== 'tab' && nextValue !==
'inline') with a membership check against the shared constant
INSTALLED_SEARCH_COUNT_DISPLAY_VALUES (e.g. use
INSTALLED_SEARCH_COUNT_DISPLAY_VALUES.includes(nextValue as any) or a proper
typed guard) so the handler uses the canonical allowed values before calling
updateSettings({ installedSearchCountDisplay: nextValue }).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/renderer/settings/sections/Appearance.tsx`:
- Around line 134-140: The manual validation in handleSearchCountDisplayChange
currently hardcodes the allowed strings; replace the literal check (nextValue
!== 'tab' && nextValue !== 'inline') with a membership check against the shared
constant INSTALLED_SEARCH_COUNT_DISPLAY_VALUES (e.g. use
INSTALLED_SEARCH_COUNT_DISPLAY_VALUES.includes(nextValue as any) or a proper
typed guard) so the handler uses the canonical allowed values before calling
updateSettings({ installedSearchCountDisplay: nextValue }).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d1c0e7ca-0fdb-4283-946a-51181ac4ab6a

📥 Commits

Reviewing files that changed from the base of the PR and between c6c22eb and 6f9aa3e.

📒 Files selected for processing (2)
  • e2e/spec/installed-search-count.e2e.ts
  • src/renderer/settings/sections/Appearance.tsx

@ryota-murakami ryota-murakami merged commit c92887e into main Jun 12, 2026
11 checks passed
@ryota-murakami ryota-murakami deleted the codex/installed-search-count-display branch June 12, 2026 03:34
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