feat(installed): add search count display setting#207
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughInstalledスキル検索結果数の表示位置を切り替える機能を実装。 ChangesInstalled検索結果数表示位置の設定機能
🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs:
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
📒 Files selected for processing (12)
e2e/spec/installed-search-count.e2e.tssrc/main/ipc/ipc-schemas.test.tssrc/main/ipc/ipc-schemas.tssrc/main/services/settings.test.tssrc/renderer/settings/sections/Appearance.browser.test.tsxsrc/renderer/settings/sections/Appearance.tsxsrc/renderer/src/components/layout/MainContent.browser.test.tsxsrc/renderer/src/components/layout/MainContent.selectionToolbar.browser.test.tsxsrc/renderer/src/components/layout/MainContent.tsxsrc/renderer/src/redux/selectors.tssrc/shared/settings.test.tssrc/shared/settings.ts
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
e2e/spec/installed-search-count.e2e.tssrc/renderer/settings/sections/Appearance.tsx
Summary
tabas the default andinlineas an alternate placement.Verification
pnpm test:e2e e2e/spec/installed-search-count.e2e.tspnpm exec eslint e2e/spec/installed-search-count.e2e.tspnpm exec tsc --noEmit --pretty falsepnpm validatepnpm test:e2eQA
Summary by CodeRabbit
新機能
テスト
設定