Skip to content

Remove references to missing CDN assets: Slider.woff2 and xxchahero-te.webp#113

Open
Copilot wants to merge 2 commits intomainfrom
copilot/remove-missing-cdn-assets
Open

Remove references to missing CDN assets: Slider.woff2 and xxchahero-te.webp#113
Copilot wants to merge 2 commits intomainfrom
copilot/remove-missing-cdn-assets

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

Two assets are referenced in the codebase but absent from the CDN: /font/Slider.woff2 and /leaders/xxchahero-te.webp.

Font

  • src/styles/fonts.css: Drop the woff2 src line from the Slider @font-face rule; keep the woff fallback.

Leader image

xxchahero-te (Thunder's Edge variant of xxchahero) shares the same art but has no dedicated image on the CDN.

  • LeaderData type: Add optional imageID?: string to allow a leader to redirect its image to a different ID.
  • leaders.ts: Set imageID: "xxchahero" on the xxchahero-te entry. Add getLeaderImageId(id) utility that returns leader.imageID ?? id.
  • CompactLeader, LeaderChip, LeaderDetailsCard: Use getLeaderImageId(id) when constructing the /leaders/*.webp URL.
// leaders.ts
export function getLeaderImageId(id: string): string {
  const leader = leaders.find((l) => l.id === id);
  return leader?.imageID ?? id;
}

// xxchahero-te entry
{ id: "xxchahero-te", imageID: "xxchahero", homebrewReplacesID: "xxchahero", ... }
Original prompt

these files are referenced somewhere but don't appear to exist on the cdn. Can we remove or fix the references to them?

/font/Slider.woff2
/leaders/xxchahero-te.webp


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…e.webp

Co-authored-by: adam133 <20442729+adam133@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove or fix references to missing CDN assets Remove references to missing CDN assets: Slider.woff2 and xxchahero-te.webp Mar 3, 2026
@adam133 adam133 marked this pull request as ready for review March 3, 2026 02:29
@adam133 adam133 requested a review from Copilot March 3, 2026 02:29
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

Removes broken CDN asset references by dropping a missing Slider.woff2 font source and introducing a leader-image redirect mechanism so xxchahero-te reuses the existing xxchahero image.

Changes:

  • Remove Slider.woff2 from the @font-face src list, leaving the woff fallback.
  • Add optional imageID?: string to LeaderData, set imageID: "xxchahero" for xxchahero-te, and add a getLeaderImageId() helper.
  • Update leader UI components to use getLeaderImageId(id) when constructing /leaders/*.webp URLs.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
yarn.lock Large lockfile churn (platform-specific binaries / reordering) included alongside the asset-reference fix.
src/styles/fonts.css Removes reference to missing /font/Slider.woff2.
src/entities/data/types.ts Extends LeaderData with optional imageID redirect field.
src/entities/data/leaders.ts Adds imageID for xxchahero-te and exports getLeaderImageId().
src/domains/player/components/LeaderDetailsCard.tsx Uses getLeaderImageId() for leader image URL.
src/domains/player/components/Leader/LeaderChip.tsx Uses getLeaderImageId() for leader image URL.
src/domains/player/components/Leader/CompactLeader.tsx Uses getLeaderImageId() for leader image URL.

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

Comment on lines 53 to 55
<div className={styles.leaderImageContainer}>
<Image src={`/leaders/${id}.webp`} className={styles.leaderImage} />
<Image src={`/leaders/${getLeaderImageId(id)}.webp`} className={styles.leaderImage} />
</div>
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

LeaderChip already calls getLeaderData(id) which does leaders.find(...). Using getLeaderImageId(id) in the image src adds a second linear search over the same array during render. Prefer using leaderData.imageID ?? id (or have getLeaderData return the resolved image id) to avoid the extra lookup.

Copilot uses AI. Check for mistakes.
Comment on lines 181 to 186
"Place any combination of up to 4 PDS or mechs onto planets you control; ready each planet that you place a unit on. Then, purge this card.",
unlockCondition: "Have 3 scored objectives.",
homebrewReplacesID: "xxchahero",
imageID: "xxchahero",
source: "thunders_edge",
},
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

This file is marked as auto-generated ("Do not edit manually"). Adding imageID directly in the generated leaders array will likely be overwritten the next time the data is regenerated. Prefer updating the upstream JSON/generator that produces leaders.ts, or move overrides into a separate non-generated layer (e.g., a small map of image redirects keyed by leader id).

Copilot uses AI. Check for mistakes.
Comment on lines +5248 to +5249
export function getLeaderImageId(id: string): string {
const leader = leaders.find((l) => l.id === id);
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

getLeaderImageId does a linear leaders.find(...) over a ~5k-entry array on every call. Since this will be invoked during rendering (and some callers already do their own leaders.find), consider switching to an O(1) lookup (e.g., build/export a leadersById map once) or accept a LeaderData object so callers can use leaderData.imageID ?? leaderData.id without an extra search.

Suggested change
export function getLeaderImageId(id: string): string {
const leader = leaders.find((l) => l.id === id);
const leadersById: Record<string, LeaderData> = leaders.reduce(
(acc, leader) => {
acc[leader.id] = leader;
return acc;
},
{} as Record<string, LeaderData>,
);
export function getLeaderImageId(id: string): string {
const leader = leadersById[id];

Copilot uses AI. Check for mistakes.
Comment on lines 29 to 31
return (
<Image src={`/leaders/${leaderId}.webp`} w={60} h={80} radius="50%" />
<Image src={`/leaders/${getLeaderImageId(leaderId)}.webp`} w={60} h={80} radius="50%" />
);
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

LeaderDetailsCard already looks up leaderData via leaders.find(...), but the image src now calls getLeaderImageId(leaderId) which performs another leaders.find(...). To avoid duplicate work per render, use leaderData.imageID ?? leaderId (or pass leaderData into a helper) when constructing the image URL.

Copilot uses AI. Check for mistakes.
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