Skip to content

Clear All repos button implementation#518

Open
JaYRaNa213 wants to merge 3 commits intofossasia:mainfrom
JaYRaNa213:Feature/Add-ClearAll-repos-button
Open

Clear All repos button implementation#518
JaYRaNa213 wants to merge 3 commits intofossasia:mainfrom
JaYRaNa213:Feature/Add-ClearAll-repos-button

Conversation

@JaYRaNa213
Copy link
Copy Markdown

@JaYRaNa213 JaYRaNa213 commented Apr 5, 2026

📌 Fixes

Fixes #411


📝 Summary of Changes

  • Added a "Clear All" button near the selected repository tags section.
  • Implemented functionality to remove all selected repositories in a single click.
  • Reset the repository selection state after clearing.
  • Improved usability when handling multiple selected repositories.

📸 Screenshots / Demo (if UI-related)

Before:
Users could only remove repositories one by one.

Image Image

After:
A "Clear All" button is available next to the selected repository tags, allowing users to remove all selections at once.

image Image ---

✅ Checklist

  • I’ve tested my changes locally
  • I’ve added tests (if applicable)
  • I’ve updated documentation (if applicable)
  • My code follows the project’s code style guidelines

👀 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:

  • Introduce a "Clear All" button in the repository selection section to remove all selected repositories with a single action.

Enhancements:

  • Automatically toggle visibility of the "Clear All" control based on whether any repositories are selected and persist the cleared state.
  • Extend i18n message catalogs to support the new "Clear All" button label across locales.

Summary by Sourcery

Add a control in the popup UI to clear all selected repositories at once and keep the selection state and display in sync.

New Features:

  • Introduce a "Clear All" button in the repository selection area to remove all selected repositories with a single action.

Enhancements:

  • Toggle visibility of the "Clear All" control based on whether any repositories are selected.
  • Refresh the displayed repository list after clearing selections when a search filter is active.
  • Extend locale message catalogs to provide translations for the new "Clear All" button label across supported languages.

Summary by Sourcery

Add a control in the popup UI to clear all selected repositories at once and keep the selection state and display in sync.

New Features:

  • Introduce a "Clear All" button in the repository selection section to remove all selected repositories in a single action.

Enhancements:

  • Show or hide the "Clear All" button based on whether any repositories are selected.
  • Ensure clearing selections updates the displayed repository list and persists the empty selection state.
  • Extend i18n message catalogs to provide translations for the new "Clear All" button label across supported locales.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Apr 5, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a localized "Clear All" control to the popup’s repository selection area and wires it to clear, persist, and visually reflect an empty repository selection state, including dynamic visibility of the control based on current selections.

Sequence diagram for Clear All repositories behavior

sequenceDiagram
  actor User
  participant PopupUI
  participant PopupScript
  participant BrowserStorage

  User->>PopupUI: Click clearAllReposBtn
  PopupUI->>PopupScript: clearAllReposBtn click event
  PopupScript->>PopupScript: Set selectedRepos = []
  PopupScript->>PopupScript: updateRepoDisplay()
  PopupScript->>PopupScript: repoTags innerHTML placeholder
  PopupScript->>PopupScript: repoCount set repoCountNone
  PopupScript->>PopupScript: clearAllReposBtn add class hidden
  PopupScript->>PopupScript: saveRepoSelection()
  PopupScript->>BrowserStorage: storage.local.set(selectedRepos = [])
  BrowserStorage-->>PopupScript: Persisted selection
  PopupScript-->>PopupUI: Updated UI rendered
  PopupUI-->>User: Empty selection and hidden Clear All button
Loading

Flow diagram for Clear All button visibility and state updates

flowchart TD
  A[selectedRepos changed] --> B{selectedRepos length > 0}
  B -- No --> C[Set repoTags placeholder]
  C --> D[Set repoCount to repoCountNone]
  D --> E[Add hidden class to clearAllReposBtn]
  E --> F[UI shows no repositories and no Clear All button]
  B -- Yes --> G[Render tags for each selected repository]
  G --> H[Set repoCount with selectedRepos length]
  H --> I[Remove hidden class from clearAllReposBtn]
  I --> J[UI shows repositories and Clear All button]

  K[User clicks clearAllReposBtn] --> L[Set selectedRepos to empty array]
  L --> M[Call updateRepoDisplay]
  M --> N[Call saveRepoSelection]
  N --> O[Persist empty selection in storage]
  O --> A
Loading

File-Level Changes

Change Details Files
Add a Clear All button to the repository selection UI and wire it to the existing selection state.
  • Insert a Clear All button next to the repository status text in the popup, styled as a hidden text button that appears inline with the status
  • Look up the Clear All button element on DOMContentLoaded and keep a reference for later use
  • Attach a click handler that empties the selectedRepos array, refreshes the displayed tags/count, and persists the cleared selection
src/popup.html
src/scripts/popup.js
Keep Clear All button visibility in sync with the selection state.
  • Hide the Clear All button when no repositories are selected, including when the selection becomes empty after updates
  • Show the Clear All button whenever at least one repository is selected, tied into the existing updateRepoDisplay flow so it responds to all selection changes
src/scripts/popup.js
Add i18n support for the Clear All button label across locales.
  • Introduce a new clearAllBtn message key for the Clear All button label in the English locale
  • Add corresponding clearAllBtn entries to all other supported locale message catalogs to keep them in sync
src/_locales/de/messages.json
src/_locales/en/messages.json
src/_locales/es/messages.json
src/_locales/fr/messages.json
src/_locales/he/messages.json
src/_locales/hi/messages.json
src/_locales/id/messages.json
src/_locales/it/messages.json
src/_locales/ja/messages.json
src/_locales/ml/messages.json
src/_locales/my/messages.json
src/_locales/nb/messages.json
src/_locales/pt/messages.json
src/_locales/pt_BR/messages.json
src/_locales/ru/messages.json
src/_locales/te/messages.json
src/_locales/uk/messages.json
src/_locales/vi/messages.json
src/_locales/zh_CN/messages.json

Assessment against linked issues

Issue Objective Addressed Explanation
#411 Add a visible "Clear All" button near the selected repository tags section in the popup UI.
#411 Implement functionality so that clicking "Clear All" removes all selected repository tags at once and resets the repository selection state (including persisted state).

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions bot added javascript Pull requests that update javascript code frontend extension labels Apr 5, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@JaYRaNa213
Copy link
Copy Markdown
Author

@vedansh-5 sir
i created this New PR to solve the Issue #411
this PR have not any conflicts

thank you sir

@JaYRaNa213
Copy link
Copy Markdown
Author

JaYRaNa213 commented Apr 9, 2026

@Mateeb-Haider
@vedansh-5 sir
Please Review
And give feedback

Thank you

@mariobehling mariobehling requested a review from Copilot April 11, 2026 11:11
@mariobehling
Copy link
Copy Markdown
Member

Thanks for the contribution!

A process note.

We have automatic Copilot PR reviews enabled on this repository. These reviews are only triggered if the contributor has GitHub Copilot enabled and an active license on their own account.

Please enable Copilot in your GitHub settings if you have access. In many regions, free licenses are available through educational institutions or developer programs. Enabling Copilot helps us speed up the auto review process and reduces manual review overhead for the core team.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements a “Clear All” control in the popup’s repository filter UI so users can remove all selected repository tags at once, with i18n support across locales.

Changes:

  • Added a “Clear All” button next to the selected repository count/status area in the popup UI.
  • Implemented click handling to clear selectedRepos, re-render the selected tags, and persist the cleared selection.
  • Added clearAllBtn translations across supported locale message catalogs.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/scripts/popup.js Adds DOM hook-up and click handler to clear selected repos; toggles button visibility based on selection count.
src/popup.html Adds the “Clear All” button next to repo status/count in the repo filter UI.
src/_locales/en/messages.json Adds clearAllBtn message for English.
src/_locales/de/messages.json Adds clearAllBtn translation.
src/_locales/es/messages.json Adds clearAllBtn translation.
src/_locales/fr/messages.json Adds clearAllBtn translation.
src/_locales/he/messages.json Adds clearAllBtn translation.
src/_locales/hi/messages.json Adds clearAllBtn translation.
src/_locales/id/messages.json Adds clearAllBtn translation.
src/_locales/it/messages.json Adds clearAllBtn translation.
src/_locales/ja/messages.json Adds clearAllBtn translation.
src/_locales/ml/messages.json Adds clearAllBtn translation.
src/_locales/my/messages.json Adds clearAllBtn translation.
src/_locales/nb/messages.json Adds clearAllBtn translation.
src/_locales/pt/messages.json Adds clearAllBtn translation.
src/_locales/pt_BR/messages.json Adds clearAllBtn translation.
src/_locales/ru/messages.json Adds clearAllBtn translation.
src/_locales/te/messages.json Adds clearAllBtn translation.
src/_locales/uk/messages.json Adds clearAllBtn translation.
src/_locales/vi/messages.json Adds clearAllBtn translation.
src/_locales/zh_CN/messages.json Adds clearAllBtn translation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/scripts/popup.js Outdated
Copy link
Copy Markdown
Member

@mariobehling mariobehling left a comment

Choose a reason for hiding this comment

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

Please address AI reviews or comment if not applicable.

@JaYRaNa213
Copy link
Copy Markdown
Author

Please address AI reviews or comment if not applicable.

Ok sir

@JaYRaNa213
Copy link
Copy Markdown
Author

JaYRaNa213 commented Apr 11, 2026

@mariobehling sir
please review and also
require @copilot review for latest updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension frontend javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Add "Clear All" Button for Selected Repositories

4 participants