Skip to content

fix: correct casing for site adapter display names#933

Open
PeterDaveHello wants to merge 1 commit intoChatGPTBox-dev:masterfrom
PeterDaveHello:fix/site-adapter-display-names
Open

fix: correct casing for site adapter display names#933
PeterDaveHello wants to merge 1 commit intoChatGPTBox-dev:masterfrom
PeterDaveHello:fix/site-adapter-display-names

Conversation

@PeterDaveHello
Copy link
Member

@PeterDaveHello PeterDaveHello commented Feb 28, 2026

User description

This adds a display name mapping to the SiteAdapters component to show proper capitalization (e.g., 'GitHub' instead of 'github') while preserving internal config keys.


PR Type

Bug fix, Enhancement


Description

  • Add display name mapping for site adapters with proper capitalization

  • Replace raw config keys with user-friendly display names in UI

  • Fallback to original key if display name not found


Diagram Walkthrough

flowchart LR
  A["Site adapter config keys<br/>github, youtube, etc."] -- "siteDisplayNames mapping" --> B["Display names<br/>GitHub, YouTube, etc."]
  B -- "render in UI" --> C["User-friendly labels"]
Loading

File Walkthrough

Relevant files
Enhancement
SiteAdapters.jsx
Add display name mapping for site adapters                             

src/popup/sections/SiteAdapters.jsx

  • Added siteDisplayNames object mapping 14 site adapter keys to properly
    capitalized display names
  • Updated render logic to use siteDisplayNames[key] || key for fallback
    support
  • Improves UI readability by showing 'GitHub' instead of 'github',
    'YouTube' instead of 'youtube', etc.
+16/-1   

Summary by CodeRabbit

  • Bug Fixes
    • Site adapter labels now display user-friendly names (e.g., "Bilibili" instead of "bilibili", "GitHub" instead of "github") for improved clarity and readability.

This adds a display name mapping to the SiteAdapters component to show proper capitalization (e.g., 'GitHub' instead of 'github') while preserving internal config keys.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user interface of the SiteAdapters component by ensuring that site names are displayed with correct capitalization. It achieves this by adding a dedicated mapping for display names, which allows for improved readability for users while maintaining the existing internal configuration keys. The change focuses purely on presentation, making the interface more polished and professional.

Highlights

  • Improved Display Names: Introduced a siteDisplayNames constant to map internal site keys (e.g., 'github') to properly capitalized display names (e.g., 'GitHub').
  • UI Enhancement: Updated the SiteAdapters component to use these new display names, ensuring a more user-friendly presentation without changing the underlying configuration keys.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/popup/sections/SiteAdapters.jsx
    • Added a new constant siteDisplayNames to store mappings from internal site keys to their capitalized display versions.
    • Modified the rendering logic within the SiteAdapters component to retrieve and display the capitalized names from the siteDisplayNames map, falling back to the original key if a mapping is not found.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 31331b7 and 1c2e6b4.

📒 Files selected for processing (1)
  • src/popup/sections/SiteAdapters.jsx

📝 Walkthrough

Walkthrough

Introduces user-friendly display names for site keys in the SiteAdapters component via a new siteDisplayNames mapping object. Updates the UI to render these display names instead of raw site keys, with fallback to original keys when mappings are unavailable.

Changes

Cohort / File(s) Summary
Site Display Names Mapping
src/popup/sections/SiteAdapters.jsx
Added siteDisplayNames object to map site keys (e.g., bilibili, github, mp.weixin.qq) to user-friendly display names. Updated rendering logic to use mapped display names with fallback to original key.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A mapping most fine, from code names obscure,
To labels that sparkle, friendly and pure!
Bilibili blooms, and GitHub does gleam,
WeChat appears—a UI dream! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: correct casing for site adapter display names' is fully related to the changeset, which adds a display name mapping to show site adapters with proper capitalization.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a mapping to display properly capitalized names for site adapters in the UI, which is a nice enhancement for readability. The implementation is straightforward, using a map object and falling back to the original key if a display name isn't found. My main feedback is that the list of display names is incomplete, which would lead to an inconsistent UI. I've suggested completing the list for all supported site adapters.

@qodo-code-review
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Use i18n for site names

Refactor the hardcoded siteDisplayNames object to use the existing
internationalization (i18n) system for better translation support and
accessibility.

src/popup/sections/SiteAdapters.jsx [3-16]

-const siteDisplayNames = {
-  bilibili: 'Bilibili',
-  github: 'GitHub',
-  gitlab: 'GitLab',
-  quora: 'Quora',
-  reddit: 'Reddit',
-  youtube: 'YouTube',
-  zhihu: 'Zhihu',
-  stackoverflow: 'Stack Overflow',
-  juejin: 'Juejin',
-  'mp.weixin.qq': 'WeChat MP',
-  followin: 'Followin',
-  arxiv: 'arXiv',
-}
+// The siteDisplayNames object should be removed.
+// The display names should be moved to localization files (e.g., `src/_locales/en/main.json`).
+// For example, in `main.json`:
+// {
+//   "site_github": "GitHub",
+//   "site_youtube": "YouTube",
+//   ...
+// }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that hardcoding user-facing strings is poor practice and proposes using an i18n system, which is a significant architectural improvement for maintainability and accessibility.

Medium
Use i18n for dynamic labels

Replace the direct lookup in siteDisplayNames with a call to a translation
function (e.g., t(</code>site_${key}<code>)) to support internationalization.

src/popup/sections/SiteAdapters.jsx [38]

-{siteDisplayNames[key] || key}
+{t(`site_${key}`) || key}
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: This suggestion provides a concrete implementation for using an i18n system at the rendering site, which is a best practice for handling user-facing strings and improves the application's internationalization.

Medium
Possible issue
Fix WeChat mapping key

Correct the mapping key for 'WeChat MP' from 'mp.weixin.qq' to
'mp.weixin.qq.com' to ensure the display name is applied correctly.

src/popup/sections/SiteAdapters.jsx [13]

-'mp.weixin.qq': 'WeChat MP',
+'mp.weixin.qq.com': 'WeChat MP',
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: This suggestion correctly identifies a potential bug where the mapping key for 'WeChat MP' might be incorrect, preventing the display name from being shown. It provides a specific and plausible fix.

Medium
  • More

Copy link

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

This PR improves the popup “Sites” (SiteAdapters) UI by rendering user-friendly, properly-capitalized site names (e.g., “GitHub”) while keeping the underlying configuration keys unchanged.

Changes:

  • Add a siteDisplayNames mapping for known site adapter keys.
  • Render mapped display names in the SiteAdapters list, falling back to the raw key when no mapping exists.

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants