Skip to content

feat(ui): show project social links across update, what's new and welcome modals#353

Merged
debba merged 1 commit into
mainfrom
feat/social-links
Jun 22, 2026
Merged

feat(ui): show project social links across update, what's new and welcome modals#353
debba merged 1 commit into
mainfrom
feat/social-links

Conversation

@debba

@debba debba commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Adds the project's social links (GitHub, Discord, X, Bluesky, Mastodon) to the places where users already look for the project online, matching what's on the website.

Where they show up

  • Info tab in Settings — new "Follow Us" section with labelled buttons.
  • Update notification modal — compact icon row under the release notes.
  • What's New modal — replaces the old GitHub + Discord pair in the footer with the full set.
  • Welcome screen — icon row centered below the Discord card. GitHub and Discord are skipped here since they already have their own cards above.

How it's wired

  • New SocialLinks component renders the buttons and opens each URL externally. It takes iconSize, showLabels and exclude props so the same component fits every spot.
  • The link list lives in src/config/socialLinks.ts and pulls URLs from the generated src/config/links.ts (single source of truth).
  • scripts/sync-links.js now emits any entry from the links section of package.json instead of hardcoding Discord/GitHub, so the three new URLs are generated automatically. Also dropped a few stray leftover lines in that script.
  • Added the X/Bluesky/Mastodon brand icons (src/components/icons/BrandIcons.tsx); Discord already existed and GitHub uses lucide.

i18n

settings.followUs and settings.followUsDesc added to all 8 locales.

Tests

Unit tests for SocialLinks (link data, rendering, label toggle, exclude prop, click → open URL). tsc, eslint and vitest all pass.

…come modals

Add a shared SocialLinks component (GitHub, Discord, X, Bluesky,
Mastodon) sourced from the auto-generated links config, and surface it
in the Info settings tab, the update notification modal, the what's new
modal and the welcome screen.

Make scripts/sync-links.js generic so any link in package.json is
emitted to src/config/links.ts, and add the X/Bluesky/Mastodon URLs.
@debba debba merged commit 97576d1 into main Jun 22, 2026
2 checks passed
import { LINKS } from "../config/links";

const openUrl = vi.fn();
vi.mock("@tauri-apps/plugin-opener", () => ({

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: vi.mock factory references module-scope variable

The factory captures openUrl which is declared after the hoisted vi.mock. Vitest explicitly recommends using vi.hoisted() for variables used inside mock factories. Consider removing the local vi.mock block and relying on the existing mock from tests/setup.ts (import openUrl from @tauri-apps/plugin-opener to assert on it), or use vi.hoisted(() => ({ openUrl: vi.fn() })).


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread scripts/sync-links.js
}

// 2. Create/update src/config/links.ts
const constKey = (key) => key.toUpperCase().replace(/[^A-Z0-9]+/g, '_');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: constKey can produce invalid JS identifiers

If a package.json link key starts with a digit (e.g., "123link": "..."), constKey returns "123LINK" which is an invalid JavaScript identifier and would cause a syntax error in the generated src/config/links.ts.

Suggested change
const constKey = (key) => key.toUpperCase().replace(/[^A-Z0-9]+/g, '_');
const constKey = (key) => key.toUpperCase().replace(/[^A-Z0-9]+/g, '_').replace(/^\d/, '_$&');

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

}: SocialLinksProps) {
const links = exclude?.length
? SOCIAL_LINKS.filter((link) => !exclude.includes(link.label))
: SOCIAL_LINKS;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: Filtering exclude by display label is brittle

If a social network's display label changes in SOCIAL_LINKS (e.g., "X""Twitter"), exclude={ ["X"] } calls silently fail to exclude anything because the filter matches against link.label. Consider adding a stable id field to SocialLink and filtering by that instead.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

import { LINKS } from "../config/links";

const openUrl = vi.fn();
vi.mock("@tauri-apps/plugin-opener", () => ({

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: vi.mock factory references module-scope variable

The factory captures openUrl which is declared after the hoisted vi.mock. Vitest explicitly recommends using vi.hoisted() for variables used inside mock factories. Consider removing the local vi.mock block and relying on the existing mock from tests/setup.ts (import openUrl from @tauri-apps/plugin-opener to assert on it), or use vi.hoisted(() => ({ openUrl: vi.fn() })).


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread scripts/sync-links.js
}

// 2. Create/update src/config/links.ts
const constKey = (key) => key.toUpperCase().replace(/[^A-Z0-9]+/g, '_');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: constKey can produce invalid JS identifiers

If a package.json link key starts with a digit (e.g., "123link": "..."), constKey returns "123LINK" which is an invalid JavaScript identifier and would cause a syntax error in the generated src/config/links.ts.

Suggested change
const constKey = (key) => key.toUpperCase().replace(/[^A-Z0-9]+/g, '_');
const constKey = (key) => key.toUpperCase().replace(/[^A-Z0-9]+/g, '_').replace(/^\d/, '_$&');

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

}: SocialLinksProps) {
const links = exclude?.length
? SOCIAL_LINKS.filter((link) => !exclude.includes(link.label))
: SOCIAL_LINKS;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: Filtering exclude by display label is brittle

If a social network's display label changes in SOCIAL_LINKS (e.g., "X""Twitter"), exclude={ ["X"] } calls silently fail to exclude anything because the filter matches against link.label. Consider adding a stable id field to SocialLink and filtering by that instead.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
src/components/SocialLinks.test.tsx 8 vi.mock factory references module-scope variable, may not work as expected; rely on existing tests/setup.ts mock or use vi.hoisted()
scripts/sync-links.js 28 constKey can produce invalid JS identifiers (e.g., 123LINK); should prefix leading digits

SUGGESTION

File Line Issue
src/components/SocialLinks.tsx 28 exclude filtering by display label is brittle; consider adding a stable id field
Files Reviewed (17 files)
  • package.json - added X, Bluesky, Mastodon links
  • scripts/sync-links.js - 1 issue: constKey can generate invalid identifiers
  • src/components/SocialLinks.test.tsx - 1 issue: vi.mock references module-scope variable
  • src/components/SocialLinks.tsx - 1 issue: exclude filters by brittle display label
  • src/components/icons/BrandIcons.tsx
  • src/components/modals/CommunityModal.tsx
  • src/components/modals/UpdateNotificationModal.tsx
  • src/components/modals/WhatsNewModal.tsx
  • src/components/settings/InfoTab.tsx
  • src/config/links.ts
  • src/config/socialLinks.ts
  • src/i18n/locales/de.json
  • src/i18n/locales/en.json
  • src/i18n/locales/es.json
  • src/i18n/locales/fr.json
  • src/i18n/locales/it.json
  • src/i18n/locales/ja.json
  • src/i18n/locales/ru.json
  • src/i18n/locales/zh.json
  • tests/setup.ts

Fix these issues in Kilo Cloud


Reviewed by kimi-k2.6-20260420 · Input: 54.1K · Output: 33.8K · Cached: 252.4K

@kilo-code-bot

kilo-code-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
src/components/SocialLinks.test.tsx 8 vi.mock factory references module-scope variable, may not work as expected; rely on existing tests/setup.ts mock or use vi.hoisted()
scripts/sync-links.js 28 constKey can produce invalid JS identifiers (e.g., 123LINK); should prefix leading digits

SUGGESTION

File Line Issue
src/components/SocialLinks.tsx 28 exclude filtering by display label is brittle; consider adding a stable id field
Files Reviewed (17 files)
  • package.json - added X, Bluesky, Mastodon links
  • scripts/sync-links.js - 1 issue: constKey can generate invalid identifiers
  • src/components/SocialLinks.test.tsx - 1 issue: vi.mock references module-scope variable
  • src/components/SocialLinks.tsx - 1 issue: exclude filters by brittle display label
  • src/components/icons/BrandIcons.tsx
  • src/components/modals/CommunityModal.tsx
  • src/components/modals/UpdateNotificationModal.tsx
  • src/components/modals/WhatsNewModal.tsx
  • src/components/settings/InfoTab.tsx
  • src/config/links.ts
  • src/config/socialLinks.ts
  • src/i18n/locales/de.json
  • src/i18n/locales/en.json
  • src/i18n/locales/es.json
  • src/i18n/locales/fr.json
  • src/i18n/locales/it.json
  • src/i18n/locales/ja.json
  • src/i18n/locales/ru.json
  • src/i18n/locales/zh.json
  • tests/setup.ts

Fix these issues in Kilo Cloud

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.

1 participant