remove github star feature#51
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds an unstar feature: RepositoryCard can unstar a GitHub repo via GitHubApiService and removes the repository from the app store using a new deleteRepository action. Changes
Sequence DiagramsequenceDiagram
actor User
participant RC as RepositoryCard
participant API as GitHubApiService
participant Store as useAppStore
User->>RC: Click "Unstar"
RC->>RC: Show confirmation prompt
User->>RC: Confirm
RC->>API: unstarRepository(owner, repo)
API->>API: DELETE /user/starred/{owner}/{repo}
API-->>RC: Success (204)
RC->>Store: deleteRepository(repoId)
Store->>Store: Remove repo, prune releases/subscriptions
Store-->>RC: Acknowledge
RC->>User: Update UI (remove card / success alert)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/RepositoryCard.tsx`:
- Around line 317-319: The hardcoded English alert in the missing-token branch
(the if (!githubToken) { alert(...) } in RepositoryCard.tsx) should be replaced
with a localized message; update the code that shows the alert to use the
project's i18n API (e.g., useTranslation/t or intl.formatMessage) and a proper
message key like "errors.githubTokenMissing" so the new unstar flow shows a
translated string for users (replace the literal alert text with a call to the
translation function and pass the translated text to alert).
In `@src/store/useAppStore.ts`:
- Line 17: The deleteRepository implementation currently only removes the repo
from repositories and searchResults but leaves any matching releaseSubscriptions
and cached releases, causing stale ReleaseTimeline rendering; update the
deleteRepository method (and the similar handler around the other occurrence) to
also remove entries keyed by repoId from releaseSubscriptions and releases
(e.g., delete releaseSubscriptions[repoId] and delete releases[repoId] or use
the store's remove methods) so the store no longer retains subscriptions or
cached release lists for the deleted repo.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 300f2dc3-87ab-4408-af85-696ee0c61711
⛔ Files ignored due to path filters (1)
dist/index.htmlis excluded by!**/dist/**
📒 Files selected for processing (3)
src/components/RepositoryCard.tsxsrc/services/githubApi.tssrc/store/useAppStore.ts
|
审计完毕,我按 review 点做了修复并已 push 到这个 PR 分支(milo-container/main)。\n\n### ✅ 已修复\n1. deleteRepository 状态清理不完整\n - 现在删除仓库时会同时清理:\n - 中对应 \n - 中属于该仓库的 release\n - 中已不再存在的 release id\n - 避免仓库删除后 release 视图残留脏数据。\n\n2. Unstar 缺 token 提示文案未本地化\n - 将硬编码英文提示替换为中英双语分支:\n - 中文:\n - 英文:\n\n### ℹ️ 额外说明\n- 的 API 响应处理(DELETE unstar)这部分实现是正确的,已保持不变。\n- PR 标题建议从 调整为更准确的 (非阻塞)。\n\n如果你愿意,我也可以顺手把 PR 标题一起改了。 |
|
审计完毕,我按 review 点做了修复并已 push 到这个 PR 分支(milo-container/main)。 ✅ 已修复
ℹ️ 额外说明
如果你愿意,我也可以顺手把 PR 标题一起改了。 |
remove github star feature
Summary by CodeRabbit
New Features
Bug Fixes