Skip to content

Fix/show profile#45

Merged
ghostleek merged 9 commits intomainfrom
fix/show-profile
Mar 21, 2026
Merged

Fix/show profile#45
ghostleek merged 9 commits intomainfrom
fix/show-profile

Conversation

@ghostleek
Copy link
Copy Markdown
Contributor

This pull request refactors how the canonical Opal logo and normalization logic are managed across the codebase. The main improvement is centralizing the OPAL_CANONICAL_LOGO constant and the normalizeOpalLogo function in a new branding utility, reducing duplication and improving maintainability. Additionally, there is a minor fix in the app pinning logic in the PersonalProfile component.

Branding logic centralization:

  • Moved the OPAL_CANONICAL_LOGO constant and the normalizeOpalLogo function to a new file, src/lib/branding.ts, to serve as a single source of truth for branding-related utilities.
  • Updated imports in api/apps.ts and api/profile/manage.ts to use normalizeOpalLogo from the new branding utility, and removed their local definitions. [1] [2]
  • Updated import in api/profile/[slug].ts to use OPAL_CANONICAL_LOGO from the branding utility, removing the local constant. (api/profile/[slug].tsR5-L11)

Bug fix in component logic:

  • Fixed the order of operations in the handleAddExistingApp function in PersonalProfile.tsx so that pinning logic only runs after a successful app addition.

Copilot AI and others added 6 commits March 3, 2026 15:21
Co-authored-by: ghostleek <44336310+ghostleek@users.noreply.github.com>
…randing.ts

Co-authored-by: ghostleek <44336310+ghostleek@users.noreply.github.com>
Fix premature pin on failed profile add
Extract OPAL branding helpers into shared module
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 4, 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 3:16pm

Copy link
Copy Markdown
Contributor

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 pull request centralizes Opal branding normalization into a shared utility and adjusts profile UI logic to only pin apps after they’ve been successfully added to a profile.

Changes:

  • Introduces src/lib/branding.ts as the single source of truth for OPAL_CANONICAL_LOGO and normalizeOpalLogo.
  • Updates edge API routes to import branding utilities instead of maintaining local copies.
  • Fixes PersonalProfile pinning flow to run only after a successful add.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/lib/branding.ts Adds centralized Opal logo constant + normalization helper.
api/apps.ts Switches to shared normalizeOpalLogo import for app list responses.
api/profile/manage.ts Switches to shared normalizeOpalLogo import for pinned app details.
api/profile/[slug].ts Switches to shared OPAL_CANONICAL_LOGO import for pinned app logo override.
src/components/PersonalProfile.tsx Pins an app only after addAppToProfile succeeds.
package-lock.json Updates lockfile dependency metadata, including concurrently placement/flags.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +3 to +8
export function normalizeOpalLogo<T extends { slug: string | null; logoUrl: string | null }>(app: T): T {
if (app.slug === 'opal') {
return {
...app,
logoUrl: OPAL_CANONICAL_LOGO,
};
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

normalizeOpalLogo is declared to return T, but it can change logoUrl to a string literal. If a caller ever uses a narrower T (e.g. logoUrl: null), the type signature becomes unsound and can mislead downstream code. Consider changing the return type to widen logoUrl (e.g. Omit<T, 'logoUrl'> & { logoUrl: string | null }) so the type accurately reflects the mutation.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment on lines +5 to 7
import { OPAL_CANONICAL_LOGO } from '../../src/lib/branding';

export const config = {
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

This file still hard-codes Opal logo normalization inline (item.appSlug === 'opal' ? OPAL_CANONICAL_LOGO : ...). Since normalizeOpalLogo now exists as the centralized normalizer, consider applying it to the pinned-app objects here as well to avoid duplicating the normalization rule in multiple places.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 4, 2026

@ghostleek I've opened a new pull request, #46, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 4, 2026

@ghostleek I've opened a new pull request, #47, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits March 4, 2026 14:54
Co-authored-by: ghostleek <44336310+ghostleek@users.noreply.github.com>
Fix unsound return type on `normalizeOpalLogo`
@ghostleek ghostleek merged commit 923fceb into main Mar 21, 2026
3 checks passed
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.

3 participants