feat(filter): multi-select source-repo include filter#175
Conversation
Replace the single-select source-repo filter (selectedSource: RepositoryId | null) with a multi-select INCLUDE filter (selectedSources: RepositoryId[]). Empty selection shows all skills, including source-less local skills; a non-empty selection shows only skills whose source is in the selection and hides source-less local skills. - uiSlice: selectedSources[] with setSelectedSources / toggleSource / clearSelectedSources; selectedSources pruned when its repos disappear; SourceFilterSummary (repositoryIds + localHiddenCount) feeds the bulk-delete confirm scope - selectors: selectSourceFilterViewModel builds the compact trigger label, dropdown rows, filter pills, and localHiddenCount, memoized via reselect - MainContent: dropdown migrated from RadioGroup to DropdownMenuCheckboxItem rows plus Show all / Select all items; pills collapse past SOURCE_FILTER_MAX_VISIBLE_REPOS into a "from N repos" summary; inline "N local skills hidden" metadata hint - bulkDeleteCopy: appends a repo-scope sentence and a hidden-locals reassurance to the destructive confirm; a single repo is named in full (never the truncated trigger label) - formatRepositoryFacetLabel: new util, middle-ellipsis past REPOSITORY_FACET_LABEL_MAX_CHARS (28) for the compact trigger only Two deliberate design decisions: - single-row delete passes sourceSummary: null — a single row carries no repo-filter scope to surface in the confirm dialog - SourceLink uses setSelectedSources([source]) (replace, not toggle): a focused "show me this repo" jump, not an additive selection validate green (1123 tests); e2e green (43 passed). Version intentionally unchanged — release bumps are owned by /electron-release.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Walkthroughリポジトリフィルタを単一選択(ラジオ)からマルチ選択(チェックボックス)へ移行。Redux state を ChangesRepository filter: single-select to multi-select refactor
🎯 4 (Complex) | ⏱️ ~45 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 #175 +/- ##
==========================================
+ Coverage 56.17% 56.77% +0.60%
==========================================
Files 184 185 +1
Lines 4691 4766 +75
Branches 986 1002 +16
==========================================
+ Hits 2635 2706 +71
- Misses 1832 1836 +4
Partials 224 224
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@src/renderer/src/utils/formatRepositoryFacetLabel.ts`:
- Around line 24-25: 現在の実装はハードコードした 12/13 を使っているため
REPOSITORY_FACET_LABEL_MAX_CHARS を変更すると不整合が起きます。formatRepositoryFacetLabel 内で
REPOSITORY_FACET_LABEL_MAX_CHARS と省略記号長("..." の長さ、3)から headChars と tailChars
を算出し(例: head = Math.floor((MAX - ellipsis)/2), tail = (MAX - ellipsis) -
head)、その headChars/tailChars を使って source.slice(0, headChars) と
source.slice(-tailChars) を組み合わせて返すように修正してください。Ensure you reference
REPOSITORY_FACET_LABEL_MAX_CHARS and the existing slice-based return when
locating where to change.
🪄 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: b17471a8-5f55-44bb-bacf-d21506a708a4
📒 Files selected for processing (20)
.gitignoresrc/renderer/src/components/layout/MainContent.browser.test.tsxsrc/renderer/src/components/layout/MainContent.tsxsrc/renderer/src/components/sidebar/SourceCard.tsxsrc/renderer/src/components/skills/SkillItem.browser.test.tsxsrc/renderer/src/components/skills/SkillItem.tsxsrc/renderer/src/components/skills/SkillsList.tsxsrc/renderer/src/components/skills/SourceLink.browser.test.tsxsrc/renderer/src/components/skills/SourceLink.tsxsrc/renderer/src/components/skills/bulkDeleteCopy.test.tssrc/renderer/src/components/skills/bulkDeleteCopy.tsxsrc/renderer/src/components/skills/skillsListHelpers.test.tssrc/renderer/src/components/skills/skillsListHelpers.tssrc/renderer/src/redux/selectors.test.tssrc/renderer/src/redux/selectors.tssrc/renderer/src/redux/slices/uiSlice.test.tssrc/renderer/src/redux/slices/uiSlice.tssrc/renderer/src/utils/formatRepositoryFacetLabel.test.tssrc/renderer/src/utils/formatRepositoryFacetLabel.tssrc/shared/constants.ts
…onstant CodeRabbit flagged the hardcoded 12/13 head/tail split in formatRepositoryFacetLabel as decoupled from REPOSITORY_FACET_LABEL_MAX_CHARS: changing the constant would silently break the "exactly MAX chars" invariant. Derive head/tail from the constant (head = floor(budget/2), tail = the remainder) so the split re-balances automatically. Output is unchanged for the current value (12 + "..." + 13 = 28), so the existing test and JSDoc example stay valid.
What & why
Replaces the single-select source-repo filter (
selectedSource: RepositoryId | null) with a multi-select INCLUDE filter (selectedSources: RepositoryId[]).sourceis in the selection; source-less local skills are hidden.When the filter hides local skills, an inline metadata hint surfaces the count ("N local skills hidden"), and the bulk-delete confirm dialog names the in-scope repositories plus reassures that hidden locals stay untouched.
Key changes
uiSlice—selectedSources[]withsetSelectedSources/toggleSource/clearSelectedSources; the selection is pruned when its repos disappear.SourceFilterSummary(repositoryIds+localHiddenCount) feeds the bulk-delete confirm scope.selectors—selectSourceFilterViewModelbuilds the compact trigger label, dropdown rows, filter pills, andlocalHiddenCount, memoized via reselect.MainContent— dropdown migrated fromRadioGroup→DropdownMenuCheckboxItemrows plus Show all / Select all items; pills collapse pastSOURCE_FILTER_MAX_VISIBLE_REPOSinto a "from N repos" summary.bulkDeleteCopy— appends a repo-scope sentence + hidden-locals reassurance to the destructive confirm.formatRepositoryFacetLabel— new util, middle-ellipsis pastREPOSITORY_FACET_LABEL_MAX_CHARS(28), used by the compact trigger label only.Deliberate design decisions
sourceSummary: null. A single-row delete carries no repo-filter scope to surface — the confirm dialog stays focused on that one row, so it intentionally omits the multi-repo scope/hidden-locals sentences that the bulk path appends.SourceLinkusessetSelectedSources([source])(replace, not toggle). Clicking a skill's source link is a focused "show me this repo" jump — it replaces the active selection rather than additively toggling, matching the intent of navigating to a single repo's skills.A matching nuance: the destructive bulk-delete confirm names a single repo in full (never the truncated trigger label) — width is unconstrained there and knowing the exact source matters most before a destructive action. Truncation is reserved for the space-constrained toolbar trigger.
Quality gates
pnpm validate— ✅ green (1123 tests across lint, test, typecheck, dead-code, dupes, health, storybook build)pnpm test:e2e— ✅ green (43 passed)Version is intentionally unchanged — release version bumps are owned exclusively by
/electron-releaseper project policy.Summary by CodeRabbit
新機能
改善
テスト