Skip to content

Centralize Opal logo normalization into shared helper#41

Draft
Copilot wants to merge 3 commits intofix/show-profilefrom
copilot/sub-pr-38-another-one
Draft

Centralize Opal logo normalization into shared helper#41
Copilot wants to merge 3 commits intofix/show-profilefrom
copilot/sub-pr-38-another-one

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 3, 2026

OPAL_CANONICAL_LOGO and normalizeOpalLogo were duplicated across three API routes, creating a drift risk where one endpoint could return a different logo path.

Changes

  • src/lib/branding.ts — new shared module exporting OPAL_CANONICAL_LOGO and normalizeOpalLogo
  • api/apps.ts, api/profile/manage.ts, api/profile/[slug].ts — removed local declarations, import from shared helper; [slug].ts also replaces its inline ternary with normalizeOpalLogo
// src/lib/branding.ts
export const OPAL_CANONICAL_LOGO = '/icons/opal2.png';

export function normalizeOpalLogo<T extends { slug: string | null; logoUrl: string | null }>(app: T): T {
  if (app.slug === 'opal') {
    return { ...app, logoUrl: OPAL_CANONICAL_LOGO };
  }
  return app;
}

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
string-v2 Ready Ready Preview, Comment Mar 4, 2026 2:31pm

…al.ts

Co-authored-by: ghostleek <44336310+ghostleek@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback on profile management UI Centralize Opal logo normalization into shared helper Mar 3, 2026
@ghostleek
Copy link
Copy Markdown
Contributor

can you resolve the merge conflicts @copilot

…opal.ts

Co-authored-by: ghostleek <44336310+ghostleek@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 4, 2026

can you resolve the merge conflicts @copilot

Resolved in commit 72cb61a. The conflict was because the base branch had already introduced src/lib/branding.ts (via PR #40), while my branch created api/_lib/opal.ts. The fix removes api/_lib/opal.ts and updates all three API route imports to use ../../src/lib/branding (or ../src/lib/branding for api/apps.ts) instead.

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.

2 participants