Skip to content

Conversation

@gocanto
Copy link
Contributor

@gocanto gocanto commented Oct 16, 2025

Summary

  • export the social platform icon and label definitions from the shared support module
  • update the widget social component to consume the shared platform configuration
  • reuse the shared icons when building header social link definitions

Testing

  • make format

https://chatgpt.com/codex/tasks/task_e_68f08334c06c8333afe03eebffe3967e

Summary by CodeRabbit

  • Style
    • Standardized icon sizing across header controls for improved visual consistency.
    • Enhanced theme toggle icons with refined styling and better responsive behavior.

@coderabbitai
Copy link

coderabbitai bot commented Oct 16, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

This PR centralizes social platform configuration by extracting socialPlatforms data into a dedicated support module, updates component references to use the external source, standardizes SVG icon sizes from 16×16 to 24×24 viewBox in the header, and expands test coverage for header social links and icon rendering.

Changes

Cohort / File(s) Summary
Social platform configuration centralization
src/support/social.ts
Introduces SocialPlatformConfig interface and socialPlatforms constant with icon/text data for x, youtube, instagram, linkedin, github; adds HeaderSocialLink and HeaderPlatformConfig interfaces for header-specific link wiring; refactors header platform references to use centralized icons.
Component refactoring to use external social config
src/partials/WidgetSocialPartial.vue
Imports socialPlatforms from src/support/social.ts instead of declaring locally; template references remain unchanged.
Header UI icon standardization
src/partials/HeaderPartial.vue
Updates social link SVG viewBox from 16×16 to 24×24; updates light/dark toggle SVG viewBox to 24×24 with added sizing classes (h-4 w-4) and responsive visibility variants.
Test suite expansion for header social links
tests/partials/HeaderPartial.test.ts, tests/support/header-social-links.test.ts
Adds beforeEach mock reset in HeaderPartial tests; introduces new test cases for SVG viewBox attributes (24×24), theme-switch icon presence, and search field clearing behavior; creates new test file for useHeaderSocialLinks composable verifying link building, metadata handling, and reactivity.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Multiple interconnected changes across component refactoring, data structure introduction, UI updates, and test additions require reviewing logic flow across files, but changes follow consistent patterns with moderate logic density.

Possibly related PRs

Poem

🐰 A rabbit's rhyme for social springs,
Icons unified, hearts take wing,
From 16 to 24, the view expands,
Platform links now holding hands,
Centralized hearts, tests running bright!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “chore: Centralise social platform metadata” directly reflects the core change of centralising icon and label definitions for social platforms into a shared module. It is concise, specific, and uses the “chore:” prefix appropriately to denote a non-functional refactoring. The phrasing gives enough context for a reviewer to understand the primary update without unnecessary detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch gus/use-same-icons-from-widgetsocialpartial-2025-10-16

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 81f57c4 and c570146.

📒 Files selected for processing (3)
  • src/partials/HeaderPartial.vue (2 hunks)
  • tests/partials/HeaderPartial.test.ts (3 hunks)
  • tests/support/header-social-links.test.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
tests/partials/HeaderPartial.test.ts (1)
src/stores/api/store.ts (2)
  • setSearchTerm (34-36)
  • getSocial (87-95)
tests/support/header-social-links.test.ts (1)
src/support/social.ts (2)
  • useHeaderSocialLinks (60-91)
  • socialPlatforms (10-31)
🔇 Additional comments (8)
tests/support/header-social-links.test.ts (3)

1-5: LGTM!

Imports are well-organized and correctly reference the centralized social data and composable.


52-99: LGTM!

The reactivity test is well-structured and thoroughly validates:

  • Computed property updates when the ref changes
  • Proper fallback to platform name when handle/description are blank
  • Multiple state transitions work correctly

7-50: No issues found. The test is correct.

The verification confirms that iconClass is properly defined in the HeaderSocialLink interface (line 44 in src/support/social.ts) and includes complete styling values in the platform configuration (e.g., line 50). The test expectations at lines 41 and 48 are valid and correctly assert the presence of the icon class containing text-slate-600.

src/partials/HeaderPartial.vue (2)

39-39: LGTM!

Icon sizing standardized to 24×24 viewBox with h-4 w-4 classes, consistent with the centralized social platform data and theme controls.


50-64: LGTM!

Theme toggle icons correctly updated to:

  • 24×24 viewBox with h-4 w-4 sizing for both light/dark variants
  • Updated path geometry aligned with the new viewBox
  • Maintained proper visibility classes for theme switching
tests/partials/HeaderPartial.test.ts (3)

4-4: LGTM!

Adding beforeEach to clear mocks between tests is a best practice that ensures test isolation and prevents state leakage.

Also applies to: 36-40


88-94: LGTM!

ViewBox assertions comprehensively validate the icon sizing standardization:

  • Social link icons: 24×24 viewBox
  • Theme toggle icons: both variants use 24×24 viewBox

97-118: LGTM!

Comprehensive test coverage for the search clear functionality:

  • Validates error state triggering
  • Verifies clear button appearance
  • Tests complete reset flow (error, query, store term)
  • Properly handles async updates with nextTick and Promise.resolve

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.

@gemini-code-assist
Copy link

Summary of Changes

Hello @gocanto, 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 focuses on enhancing code maintainability and consistency by centralizing the metadata for social media platforms. It extracts icon paths and descriptive text into a dedicated shared module, allowing various UI components to consume these standardized definitions. This approach reduces duplication and streamlines future updates to social platform information across the application.

Highlights

  • Centralized Social Platform Metadata: The definitions for social platform icons and labels (like 'x', 'youtube', 'instagram', 'linkedin', 'github') have been moved from individual components into a new, shared support module (src/support/social.ts).
  • Widget Social Component Update: The WidgetSocialPartial.vue component has been updated to import and utilize the newly centralized social platform configuration, removing its previously local definitions.
  • Header Social Link Reuse: The header social link definitions now reuse the icons from the centralized socialPlatforms object, ensuring consistency across different parts of the application that display social links.
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.

@gocanto gocanto removed the codex label Oct 16, 2025
@gocanto gocanto changed the title Centralize social platform metadata chore: Centralise social platform metadata Oct 16, 2025
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 centralizes the social platform metadata, including icons and labels, into a shared support/social.ts module. This is a great improvement for maintainability, as it removes duplicated data from WidgetSocialPartial.vue and reuses the icons in HeaderPartial.vue. The changes are well-structured. I've found one potential issue related to case-sensitivity when looking up platform data, which could lead to social links not being displayed correctly. I've left a comment with details.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

@gocanto gocanto marked this pull request as draft October 16, 2025 05:53
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
tests/support/social.test.ts (4)

6-44: Consider structure-only validation to reduce brittleness.

The tests correctly validate that each platform exports the expected icon and text properties. However, using expect.stringContaining() with specific icon path fragments makes the tests brittle to icon updates.

Consider validating just the structure (that icon and text exist and are non-empty strings) rather than checking specific icon content, unless the exact icon paths are critical to the API contract.

Example refactor:

-    expect(socialPlatforms.x).toEqual(
-      expect.objectContaining({
-        text: 'Latest Updates',
-        icon: expect.stringContaining('M13.3174 10.7749'),
-      }),
-    );
+    expect(socialPlatforms.x).toEqual(
+      expect.objectContaining({
+        text: expect.any(String),
+        icon: expect.any(String),
+      }),
+    );
+    expect(socialPlatforms.x.text).toBeTruthy();
+    expect(socialPlatforms.x.icon).toBeTruthy();

58-102: Clarify why only 2 of 3 platforms are included.

The test provides 3 social entries (github, linkedin, instagram) but expects only 2 links (line 85). This filtering behavior depends on headerSocialOrder or headerSocialPlatforms from the implementation, but there's no explanation in the test.

Add a comment explaining that the test validates the ordering and filtering behavior based on the header configuration, or explicitly verify the expected order.

Example comment:

  it('builds ordered header social links with accessible copy', () => {
+    // Note: Only platforms defined in headerSocialOrder and headerSocialPlatforms
+    // will appear in results. Instagram is omitted because it's not in the header configuration.
    social.value = [

92-92: Extract hardcoded iconClass to reduce duplication.

The iconClass value is duplicated across multiple assertions. Consider extracting it to a constant or referencing it from the source module to avoid brittleness if the class changes.

Example refactor:

+const expectedIconClass = 'fill-current text-slate-600 transition-colors hover:text-fuchsia-600 dark:text-teal-200 dark:hover:text-teal-300';
+
  expectLink(links[0], {
    name: 'github',
    url: 'https://github.com/example',
    label: 'Portfolio',
    title: 'Portfolio',
    icon: socialPlatforms.github.icon,
-    iconClass: 'fill-current text-slate-600 transition-colors hover:text-fuchsia-600 dark:text-teal-200 dark:hover:text-teal-300',
+    iconClass: expectedIconClass,
  });

Also applies to: 100-100


104-142: Good coverage of fallback logic.

The test correctly validates the fallback behavior when description is empty (falls back to handle) and when both are empty (falls back to platform name). The trimming behavior is also well-tested.

Optional: Consider adding an edge case for whitespace-only strings:

{
  uuid: '7',
  name: 'youtube',
  url: 'https://youtube.com/example',
  description: '   ',  // whitespace-only
  handle: '   ',       // whitespace-only
}

This would verify that whitespace-only strings are treated the same as empty strings and fall back to the platform name.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0166f32 and 81f57c4.

📒 Files selected for processing (1)
  • tests/support/social.test.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/support/social.test.ts (1)
src/support/social.ts (3)
  • socialPlatforms (10-31)
  • HeaderSocialLink (38-45)
  • useHeaderSocialLinks (60-91)
🔇 Additional comments (1)
tests/support/social.test.ts (1)

1-5: LGTM!

The imports are correct and appropriately use the path aliases.

@gocanto gocanto added testing and removed testing labels Oct 16, 2025
@gocanto gocanto marked this pull request as ready for review October 16, 2025 06:19
@gocanto gocanto merged commit adbd22b into main Oct 16, 2025
7 checks passed
@gocanto gocanto deleted the gus/use-same-icons-from-widgetsocialpartial-2025-10-16 branch October 16, 2025 06:26
@coderabbitai coderabbitai bot mentioned this pull request Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants