Skip to content

Add informational message when repository filtering is disabled#544

Open
gurusatsangi wants to merge 1 commit intofossasia:mainfrom
gurusatsangi:feature/filter-disabled-message
Open

Add informational message when repository filtering is disabled#544
gurusatsangi wants to merge 1 commit intofossasia:mainfrom
gurusatsangi:feature/filter-disabled-message

Conversation

@gurusatsangi
Copy link
Copy Markdown
Contributor

@gurusatsangi gurusatsangi commented Apr 14, 2026

📌 Fixes #543

Fixes #


📝 Summary of Changes

  • Added an informational message when repository filtering is disabled
  • Displayed the message below the filtering toggle section
  • Ensured the message is shown on initial load when filtering is disabled
  • Updated the message dynamically based on checkbox toggle state

📸 Screenshots

Before:

  • No indication when filtering was disabled
image

After:

  • Displays message: "Filtering is disabled. All repositories are included."
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 PR improves user experience by clearly indicating the behavior when repository filtering is disabled. It reduces confusion and provides better visual feedback to users.

Summary by Sourcery

Add an informational UI message indicating that repository filtering is disabled and ensure it reflects the current toggle state.

New Features:

  • Display a notice below the repository filtering controls when filtering is disabled, informing users that all repositories are included.

Enhancements:

  • Keep the filtering-disabled message visibility in sync with the repository filter toggle on initial load and when the checkbox state changes.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Apr 14, 2026

Reviewer's Guide

Adds an informational UI message that appears when repository filtering is disabled, both on initial load and when toggling the filter checkbox, and wires it into the existing popup script and HTML markup.

Sequence diagram for popup initialization and filter disabled message toggle

sequenceDiagram
  actor User
  participant PopupScript
  participant BrowserStorage
  participant UseRepoFilterCheckbox
  participant RepoFilterContainer
  participant FilterDisabledMessage

  User->>PopupScript: Open_popup
  PopupScript->>PopupScript: DOMContentLoaded_handler
  PopupScript->>BrowserStorage: get(optionSettings)
  BrowserStorage-->>PopupScript: items_with_useRepoFilter
  PopupScript->>UseRepoFilterCheckbox: set_checked(items.useRepoFilter)
  PopupScript->>RepoFilterContainer: toggle_hidden(!items.useRepoFilter)
  PopupScript->>FilterDisabledMessage: getElementById(filterDisabledMessage)
  alt useRepoFilter_is_false
    PopupScript->>FilterDisabledMessage: remove_class(hidden)
  else useRepoFilter_is_true
    PopupScript->>FilterDisabledMessage: add_class(hidden)
  end

  User->>UseRepoFilterCheckbox: click_toggle
  UseRepoFilterCheckbox-->>PopupScript: change_event
  PopupScript->>UseRepoFilterCheckbox: read_checked_state
  PopupScript->>RepoFilterContainer: toggle_hidden(!enabled)
  PopupScript->>FilterDisabledMessage: getElementById(filterDisabledMessage)
  alt enabled_is_false
    PopupScript->>FilterDisabledMessage: remove_class(hidden)
  else enabled_is_true
    PopupScript->>FilterDisabledMessage: add_class(hidden)
  end
Loading

Flow diagram for deciding visibility of filter disabled message

flowchart TD
  A_start[Start] --> B_context[Determine_context]
  B_context --> C_init_load[Initial_load_with_items.useRepoFilter]
  B_context --> D_toggle_event[Checkbox_toggle_event]

  C_init_load --> C1[enabled = items.useRepoFilter]
  D_toggle_event --> D1[enabled = useRepoFilter.checked]

  C1 --> E{enabled_is_true?}
  D1 --> E

  E -->|Yes| F_hide_msg[Add_class_hidden_to_FilterDisabledMessage]
  E -->|No| G_show_msg[Remove_class_hidden_from_FilterDisabledMessage]

  F_hide_msg --> H_end[End]
  G_show_msg --> H_end
Loading

File-Level Changes

Change Details Files
Show a contextual info message when repository filtering is disabled, synchronized with stored settings and the toggle state.
  • On DOMContentLoaded, fetch the filterDisabledMessage element and toggle its hidden class based on the stored useRepoFilter setting, guarding against the element being absent.
  • In the useRepoFilter checkbox change handler, toggle the filterDisabledMessage visibility in sync with the enabled/disabled state before performing existing token validation and checkbox reset logic.
  • Add a styled info banner element below the existing token warning text in the popup HTML, with an icon and static copy explaining that filtering is disabled and all repositories are included.
src/scripts/popup.js
src/popup.html

Assessment against linked issues

Issue Objective Addressed Explanation
#543 Add a visible informational message below the repository filtering toggle stating that filtering is disabled and all repositories are included, styled as an informational alert for clarity.
#543 Ensure the informational message appears on initial load when filtering is disabled and updates dynamically when the filtering checkbox is toggled.

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 14, 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 found 1 issue, and left some high level feedback:

  • The show/hide logic for filterDisabledMessage is duplicated in both the initial chrome.storage.sync.get callback and the useRepoFilter change handler; consider extracting this into a small helper that takes enabled and the element to reduce repetition and keep behavior consistent.
  • In the useRepoFilter change handler you assume document.getElementById('filterDisabledMessage') exists and use it without a null check, whereas the initial load path guards for this; align these to avoid a potential runtime error if the element is absent.
  • The new informational text is hard-coded in the HTML while nearby strings use data-i18n; consider moving this message into the i18n system for consistency and localization support.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The show/hide logic for `filterDisabledMessage` is duplicated in both the initial `chrome.storage.sync.get` callback and the `useRepoFilter` change handler; consider extracting this into a small helper that takes `enabled` and the element to reduce repetition and keep behavior consistent.
- In the `useRepoFilter` change handler you assume `document.getElementById('filterDisabledMessage')` exists and use it without a null check, whereas the initial load path guards for this; align these to avoid a potential runtime error if the element is absent.
- The new informational text is hard-coded in the HTML while nearby strings use `data-i18n`; consider moving this message into the i18n system for consistency and localization support.

## Individual Comments

### Comment 1
<location path="src/scripts/popup.js" line_range="1190-1196" />
<code_context>
 				const enabled = useRepoFilter.checked;
 				const hasToken = githubTokenInput.value.trim() !== '';
 				repoFilterContainer.classList.toggle('hidden', !enabled);
+				const disabledMsg = document.getElementById('filterDisabledMessage');
+
+				if (!enabled) {
+				disabledMsg.classList.remove('hidden');
+				} else {
+				disabledMsg.classList.add('hidden');
+				}

 				if (enabled && !hasToken) {
</code_context>
<issue_to_address>
**issue (bug_risk):** Guard against missing `filterDisabledMessage` element before toggling classes.

Here you access `disabledMsg.classList` without the null check you used earlier in the `chrome.storage.sync.get` callback. If the `filterDisabledMessage` element is renamed or removed, this will throw at runtime. Please add a null-guard (or early return if not found) before toggling the classes.
</issue_to_address>

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.

Comment thread src/scripts/popup.js
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]: Improve UX by showing message when repository filtering is disabled

1 participant