added "Clear All" button to clrear repos in one shot#412
added "Clear All" button to clrear repos in one shot#412JaYRaNa213 wants to merge 6 commits intofossasia:mainfrom
Conversation
Reviewer's GuideImplements a new "Clear All" control in the popup UI to clear all selected repositories at once, wiring it into the existing selection state, persistence, and localization system. Sequence diagram for Clear All repositories interactionsequenceDiagram
actor User
participant ClearAllReposButton
participant PopupScript
participant ChromeStorage
User->>ClearAllReposButton: Click
ClearAllReposButton->>PopupScript: click_event_listener
PopupScript->>PopupScript: clearAllRepos()
PopupScript->>PopupScript: selectedRepos = []
PopupScript->>PopupScript: updateRepoDisplay()
PopupScript->>PopupScript: toggle_clearAllReposBtn_visibility
PopupScript->>PopupScript: update_repo_tags_placeholder
PopupScript->>PopupScript: update_repo_count
PopupScript->>ChromeStorage: saveRepoSelection()
ChromeStorage-->>PopupScript: confirmation
PopupScript-->>User: UI_updated_with_no_repositories_selected
Flow diagram for repository selection state and Clear All button visibilityflowchart TD
A_start["Start in popup with repository filter"]
B_hasRepos{Are any repositories selected?}
C_showPlaceholder["Show repoPlaceholder text"]
D_setCountNone["Set repoCount to repoCountNone"]
E_hideClearAll["Add hidden class to clearAllReposBtn"]
F_renderTags["Render selected repository tags"]
G_setCountSome["Set repoCount to selected count message"]
H_showClearAll["Remove hidden class from clearAllReposBtn"]
I_userClicksClearAll["User clicks Clear All button"]
J_clearAllRepos["Set selectedRepos to empty array"]
K_saveSelection["saveRepoSelection to chrome.storage.local"]
A_start --> B_hasRepos
B_hasRepos -->|No| C_showPlaceholder
C_showPlaceholder --> D_setCountNone
D_setCountNone --> E_hideClearAll
B_hasRepos -->|Yes| F_renderTags
F_renderTags --> G_setCountSome
G_setCountSome --> H_showClearAll
H_showClearAll --> I_userClicksClearAll
I_userClicksClearAll --> J_clearAllRepos
J_clearAllRepos --> K_saveSelection
J_clearAllRepos --> B_hasRepos
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- If
clearAllReposis only used as an event handler and not referenced from inline HTML, you can keep it scoped and avoid assigning it towindowto reduce global surface area. - When clearing all repos, consider whether any additional UI state (e.g.,
repoStatustext) should also be reset to avoid showing stale status messages after the list is emptied.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- If `clearAllRepos` is only used as an event handler and not referenced from inline HTML, you can keep it scoped and avoid assigning it to `window` to reduce global surface area.
- When clearing all repos, consider whether any additional UI state (e.g., `repoStatus` text) should also be reset to avoid showing stale status messages after the list is emptied.
## Individual Comments
### Comment 1
<location path="src/scripts/popup.js" line_range="1335" />
<code_context>
}
window.removeRepo = removeRepo;
+ window.clearAllRepos = clearAllRepos;
+
+ if (clearAllReposBtn) {
</code_context>
<issue_to_address>
**question:** Re-evaluate whether `clearAllRepos` needs to be exposed on `window`.
Since `clearAllRepos` is already bound to `clearAllReposBtn`, consider keeping it local unless it’s explicitly needed by inline handlers or other scripts. Avoiding a `window` attachment reduces global surface area and risk of name collisions.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
i will resolve all conflict shorlty |
There was a problem hiding this comment.
Pull request overview
Adds a “Clear All” control to the popup’s repository filter UI so users can remove all selected repositories with one click, and updates i18n catalogs to support the new label across locales.
Changes:
- Add a “Clear All” button to the selected-repositories status row in
popup.html. - Implement clear-all selection behavior and show/hide logic in
src/scripts/popup.js. - Add
clearAllReposButtoni18n message across all locale catalogs updated in this PR.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/scripts/popup.js | Adds clearAllRepos() behavior and toggles “Clear All” button visibility based on selection state. |
| src/popup.html | Adds the “Clear All” button near the selected repository count/status area. |
| src/_locales/en/messages.json | Adds clearAllReposButton string. |
| src/_locales/de/messages.json | Adds clearAllReposButton string. |
| src/_locales/es/messages.json | Adds clearAllReposButton string. |
| src/_locales/fr/messages.json | Adds clearAllReposButton string. |
| src/_locales/he/messages.json | Adds clearAllReposButton string. |
| src/_locales/hi/messages.json | Adds clearAllReposButton string. |
| src/_locales/id/messages.json | Adds clearAllReposButton string. |
| src/_locales/it/messages.json | Adds clearAllReposButton string. |
| src/_locales/ja/messages.json | Adds clearAllReposButton string. |
| src/_locales/ml/messages.json | Adds clearAllReposButton string. |
| src/_locales/my/messages.json | Adds clearAllReposButton string. |
| src/_locales/nb/messages.json | Adds clearAllReposButton string. |
| src/_locales/pt/messages.json | Adds clearAllReposButton string (but also removes another key—see comments). |
| src/_locales/pt_BR/messages.json | Adds clearAllReposButton string. |
| src/_locales/ru/messages.json | Adds clearAllReposButton string. |
| src/_locales/te/messages.json | Adds clearAllReposButton string. |
| src/_locales/uk/messages.json | Adds clearAllReposButton string. |
| src/_locales/vi/messages.json | Adds clearAllReposButton string. |
| src/_locales/zh_CN/messages.json | Adds clearAllReposButton string. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks @JaYRaNa213 for your contribution. Please address copilots' concerns/ |
|
@vedansh-5 sir please review all copilot concerns are resolved only getting security issues ( can be ignore ) if you want sir |
📌 Fixes
Fixes #411
📝 Summary of Changes
📸 Screenshots / Demo (if UI-related)
Before:
Users could only remove repositories one by one.
After:
A "Clear All" button is available next to the selected repository tags, allowing users to remove all selections at once.
✅ Checklist
👀 Reviewer Notes
This is a small UI enhancement focused on improving usability.
The existing functionality for removing individual repositories remains unchanged.
The "Clear All" button only resets the selected repository state and does not affect other extension settings.
Summary by Sourcery
Add a dedicated control in the popup to clear all selected repositories at once and keep the selection state and UI in sync.
New Features:
Enhancements: