Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 27, 2025

This PR implements a Chrome extension popup with simple checkbox controls for sponsors and sponsoring sections as requested in issue #87, and fixes a CSS selector issue that was causing duplicate achievements sections to appear on GitHub profiles.

Changes Made

Extension Manifest

  • Added action configuration to manifest.json with popup, title, and icon settings
  • Added static CSS injection with display: none to prevent element flash on page load
  • The extension now displays a button in the Chrome toolbar

Popup Interface

  • Created popup.html with a clean, compact interface using primer.css styling
  • Added popup.css for popup-specific styling (320px width, proper spacing)
  • Implemented popup.tsx with React-based checkbox functionality

Checkbox Controls

The popup provides simple checkbox controls for individual features:

  • Hide "Sponsors": Toggle visibility of the sponsors section
  • Hide "Sponsoring": Toggle visibility of the sponsoring section

Simple Implementation

  • Uses DOM manipulation with hidden attribute for dynamic elements (sponsors, sponsoring)
  • Static CSS handles core GitHub stats (stars, followers, watchers, achievements) with immediate hiding on page load
  • Settings are persisted in Chrome's sync storage and apply immediately without page refresh
  • Highlights section is always hidden (consistent with main branch behavior)

Bug Fix: Duplicate Achievements Display

Fixed an issue where multiple identical "Achievements" sections were appearing on GitHub profiles by using a more specific CSS selector. The achievements section now displays correctly without duplication.

UI Preview

The popup opens when clicking the extension icon in the Chrome toolbar, providing instant access to checkbox controls for sponsors and sponsoring sections.

Popup Checkbox Interface

Fixes #87.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: kachick <1180335+kachick@users.noreply.github.com>
Copilot AI changed the title [WIP] Toggle when clicked the button in chrome bar Add Chrome extension popup toggle functionality Jul 27, 2025
Copilot AI requested a review from kachick July 27, 2025 18:52
kachick

This comment was marked as outdated.

Co-authored-by: kachick <1180335+kachick@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 28, 2025

@copilot The direction seems okay, could you reply for my review?

Thanks for the review! I've addressed both comments:

  1. Code duplication: Created a shared ToggleSettings component that both popup and options pages now use, eliminating the duplicated logic while maintaining their different UX requirements.

  2. Manifest schema: Provided the Chrome developer documentation link for the action field configuration.

The refactoring maintains all existing functionality while making the codebase more maintainable. (58177c8)

Copilot AI requested a review from kachick July 28, 2025 06:28
@kachick

This comment was marked as resolved.

Copilot AI and others added 2 commits July 28, 2025 11:15

This comment was marked as outdated.

Copilot AI changed the title Add Chrome extension popup with 2-level filtering controls and fix duplicate achievements display Add Chrome extension popup with checkbox controls and fix duplicate achievements display Jul 30, 2025
…rectly to src

Co-authored-by: kachick <1180335+kachick@users.noreply.github.com>
Co-authored-by: kachick <1180335+kachick@users.noreply.github.com>
…ssion

Co-authored-by: kachick <1180335+kachick@users.noreply.github.com>
@kachick
Copy link
Owner

kachick commented Jul 30, 2025

@copilot merge current main branch and update codebase if required

Copy link
Contributor Author

Copilot AI commented Jul 30, 2025

@copilot merge current main branch and update codebase if required

Merged main branch successfully! The codebase has been updated with the latest project configuration changes including the switch from stylelint to biome, updated CI workflows, and modernized tooling setup. The extension functionality remains intact with the checkbox interface for sponsors and sponsoring controls. (26cf7d6)

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • plugins.dprint.dev
    • Triggering command: /home/REDACTED/.dprint/bin/dprint check (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

loadingText?: string;
}

export default function CheckboxSettings({
Copy link
Owner

Choose a reason for hiding this comment

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

I still think old src/options/App.tsx is enough naming for that purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed CheckboxSettings.tsx to App.tsx to match the old options page naming convention as requested. (b3f2852)

Copy link
Owner

Choose a reason for hiding this comment

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

No. You renamed to src/App.tsx, you should keep original src/options/App.tsx for better reviewing experience.

I agree, the word options remind us for options page of chrome extension. However it is still having options feature and we don't need to consider confusions since dropped option page feature. How do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed! Moved the checkbox component from src/App.tsx to src/options/App.tsx to match the original main branch structure for better reviewing experience. The word "options" makes sense as it still contains options functionality, even though we dropped the dedicated options page. (ff06025)

Co-authored-by: kachick <1180335+kachick@users.noreply.github.com>
…structure

Co-authored-by: kachick <1180335+kachick@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toggle features when clicked the button in chrome bar

2 participants