Skip to content

Media type and mint visibility#2202

Merged
prxt6529 merged 6 commits intomainfrom
media-type-and-mint-visibility
Apr 2, 2026
Merged

Media type and mint visibility#2202
prxt6529 merged 6 commits intomainfrom
media-type-and-mint-visibility

Conversation

@prxt6529
Copy link
Copy Markdown
Collaborator

@prxt6529 prxt6529 commented Apr 2, 2026

Summary by CodeRabbit

  • New Features

    • Media type badges added across galleries, lists, and detail pages (e.g., "Image - PNG", "Interactive - HTML").
    • Next Mint now shows canonical card number plus local date/time and author pill with media badge.
  • Improvements

    • Smarter iframe fallback for interactive media to try alternate gateways only when appropriate.
    • Cleaner "File Type" labels, TDH rate formatting, and more robust handling of missing media metadata.
    • UI typography and responsive alignment refinements.
  • Tests

    • New/expanded tests for media fallback, MIME detection, and mint-visibility logic.

prxt6529 added 2 commits April 2, 2026 13:48
…e HTML gateway fallback behavior, and drive next-mint visibility from drop completion

Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 2, 2026

📝 Walkthrough

Walkthrough

Adds MIME-type inference utilities, integrates a MediaTypeBadge across NFT UIs, gates iframe fallback timeouts by gateway type (Arweave vs IPFS), updates now-minting status usage, normalizes nft-image imports, and expands tests for gateway fallback and MIME behavior.

Changes

Cohort / File(s) Summary
MIME utilities & helpers
helpers/nft.helpers.ts, __tests__/helpers/nft.helpers.test.ts
New MIME inference APIs (getMimeTypeFromFormat, getAnimationMimeTypeFromMetadata, getImageMimeTypeFromMetadata, getFileMimeTypeFromMetadata, getNftMimeType) and tests validating mapping, metadata extraction, URL fallback, and precedence.
Gateway fallback & iframe timeout
components/nft-image/utils/gateway-fallback.ts, __tests__/components/nft-image/utils/gateway-fallback.test.ts, components/nft-image/renderers/NFTHTMLRenderer.tsx, components/drops/view/item/content/media/MediaDisplay.tsx, __tests__/components/drops/view/item/content/media/MediaDisplay.test.tsx
Adds URL classifier and shouldUseIframeFallbackTimeout(url); getArweaveGatewayFallbackUrls refactored to use classifier; HTML iframe renderers/MediaDisplay now skip scheduling fallback timeout for non-Arweave URLs. Tests cover classification and timer-driven fallback behavior.
MediaTypeBadge component & integration
components/drops/media/MediaTypeBadge.tsx, components/home/now-minting/LatestDropNextMintSection.tsx, components/home/now-minting/NowMintingHeader.tsx, components/memelab/MemeLab.tsx, components/memelab/MemeLabPage.tsx, components/the-memes/MemePageArt.tsx, components/the-memes/MemePageLive.tsx, components/the-memes/TheMemes.tsx
Makes dropId optional; adds showTooltip, showLabel, tone, and className props; conditionally renders tooltip/label; propagated badge usage across next-mint, meme lists, and detail pages with MIME-driven rendering.
Now-minting status & visibility
hooks/useNowMintingStatus.ts, __tests__/helpers/mint-visibility.helpers.test.ts, components/home/next-mint-leading/NextMintLeadingSection.tsx, components/home/now-minting/LatestDropSection.tsx
Hook now returns isDropComplete boolean; components switched to use that boolean for mint-complete checks; new tests for shouldShowNextMintInLatestDrop and shouldShowNextWinnerInComingUp.
NFT-image import path normalization
components/nft-image/... (multiple files)
Replaced relative imports with absolute @/components/nft-image/... aliases across image/renderers/util files; no behavioral changes.
Renderer tweaks for HTML iframe
components/nft-image/renderers/NFTHTMLRenderer.tsx, components/drops/view/item/content/media/MediaDisplay.tsx
Renderer effect now early-returns when shouldUseIframeFallbackTimeout(activeUrl) is false, preventing fallback timeout scheduling for non-Arweave sources.
Test updates & coverage
__tests__/components/memelab/MemeLabPage.test.tsx, __tests__/components/the-memes/*.test.tsx, __tests__/components/drops/.../MediaDisplay.test.tsx
Updated expectations for file-type label formats (e.g., "Image - PNG", "Interactive - HTML"), added edge-case tests for missing media metadata, enhanced mocks for gateway-fallback utilities, and added timer-driven iframe fallback tests.
UI layout & typography changes
components/nft-attributes/ArweaveLinksTable.tsx, components/nft-attributes/MetadataLink.tsx, components/nft-attributes/NftStats.tsx, components/the-memes/MemePageArt.tsx
Minor alignment and typographic class changes (sm:tw-items-center, tw-font-medium), NftStats gains afterMetadata prop; large refactor of MemePageArt card details to dynamic rows and MediaTypeBadge usage.
Misc. small updates
components/nft-image/NFTImage.tsx, components/nft-image/NFTImageBalance.tsx, components/nft-image/NFTModel.tsx, components/nft-image/RememeImage.tsx
SCSS/module import path adjustments and small className template cleanup; no behavioral changes.

Sequence Diagram(s)

sequenceDiagram
  participant UI as MediaDisplay / NFTHTMLRenderer
  participant Gateway as gateway-fallback util
  participant Iframe as SandboxedIframe
  participant Timer as setTimeout

  UI->>Gateway: getArweaveGatewayFallbackUrls(activeUrl) / shouldUseIframeFallbackTimeout(activeUrl)
  Gateway-->>UI: fallback URLs + boolean decision
  alt shouldUseIframeFallbackTimeout == true
    UI->>Timer: schedule IFRAME_FALLBACK_TIMEOUT_MS
    Timer-->>UI: timeout fires
    UI->>Iframe: update data-src to next fallback URL
  else shouldUseIframeFallbackTimeout == false
    UI-->>Iframe: leave iframe data-src unchanged (no timeout scheduled)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • ragnep
  • simo6529
  • GelatoGenesis

Poem

🐰 I sniffed the MIME and found the perfect badge,
I waited on the iframe, let gateways make no splash,
Arweave earns the timeout, IPFS stays still,
Badges hop into titles, details all fit the bill,
A rabbit’s tiny patch — tidy, clever, and rash. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: new MIME type inference helpers, media type badge display across components, and mint visibility logic refactoring.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch media-type-and-mint-visibility

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.

Signed-off-by: prxt6529 <prxt@6529.io>
Copy link
Copy Markdown

@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: 3

🧹 Nitpick comments (4)
components/nft-image/utils/gateway-fallback.ts (1)

121-132: Consider centralizing URL classification to avoid drift.

This helper duplicates the same IPFS-vs-Arweave branching used in getArweaveGatewayFallbackUrls. A shared classifier would reduce future divergence risk between timeout gating and fallback URL generation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/nft-image/utils/gateway-fallback.ts` around lines 121 - 132,
Centralize the URL classification logic into a single shared helper (e.g.,
classifyAssetUrl or isArweaveAsset) and replace the branching in both
shouldUseIframeFallbackTimeout and getArweaveGatewayFallbackUrls to call that
helper; the new helper should encapsulate the current checks that use
isIpfsProtocolUrl, getIpfsProtocolUrlFromGatewayUrl, and isArweaveUrl so both
functions use the same decision logic and avoid future drift.
__tests__/components/nft-image/utils/gateway-fallback.test.ts (1)

51-64: Consider adding edge case tests for shouldUseIframeFallbackTimeout.

The current tests cover the happy paths well. Consider adding tests for edge cases like empty strings and ipfs:// protocol URLs to ensure full coverage of the guard conditions in shouldUseIframeFallbackTimeout.

📝 Suggested additional test cases
   it("does not use timeout fallback for ipfs gateways", () => {
     expect(
       shouldUseIframeFallbackTimeout("https://ipfs.6529.io/ipfs/bafy-test")
     ).toBe(false);
     expect(
       shouldUseIframeFallbackTimeout("https://ipfs.io/ipfs/bafy-test")
     ).toBe(false);
   });
+
+  it("does not use timeout fallback for empty or whitespace-only strings", () => {
+    expect(shouldUseIframeFallbackTimeout("")).toBe(false);
+    expect(shouldUseIframeFallbackTimeout("   ")).toBe(false);
+  });
+
+  it("does not use timeout fallback for ipfs protocol urls", () => {
+    expect(shouldUseIframeFallbackTimeout("ipfs://bafy-test")).toBe(false);
+  });
 });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@__tests__/components/nft-image/utils/gateway-fallback.test.ts` around lines
51 - 64, Add edge-case unit tests for shouldUseIframeFallbackTimeout: include a
test asserting that an empty string returns false and a test asserting that an
ipfs:// protocol URL (e.g., "ipfs://bafy-test" or similar) returns false; place
them alongside the existing cases so the guard conditions in
shouldUseIframeFallbackTimeout are fully covered.
__tests__/helpers/mint-visibility.helpers.test.ts (1)

7-37: Add nextMintExists: false cases to complete branch coverage.

Current tests only cover nextMintExists: true. Adding the false branch for both helpers will lock down the guard-path behavior too.

✅ Suggested test additions
 describe("mint visibility helpers", () => {
   it("shows latest drop next mint only when the overall mint is complete", () => {
@@
     expect(
       shouldShowNextMintInLatestDrop({
         isMintEnded: true,
         nextMintExists: true,
       })
     ).toBe(true);
+
+    expect(
+      shouldShowNextMintInLatestDrop({
+        isMintEnded: true,
+        nextMintExists: false,
+      })
+    ).toBe(false);
   });

   it("keeps coming-up next mint visible while the overall mint is not complete", () => {
@@
     expect(
       shouldShowNextWinnerInComingUp({
         isMintEnded: true,
         nextMintExists: true,
       })
     ).toBe(false);
+
+    expect(
+      shouldShowNextWinnerInComingUp({
+        isMintEnded: false,
+        nextMintExists: false,
+      })
+    ).toBe(false);
   });
 });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@__tests__/helpers/mint-visibility.helpers.test.ts` around lines 7 - 37, Add
tests for the missing branch where nextMintExists is false for both helpers:
call shouldShowNextMintInLatestDrop and shouldShowNextWinnerInComingUp with
isMintEnded true/false and nextMintExists: false and assert the expected boolean
outcomes (both should be false when nextMintExists is false regardless of
isMintEnded for each helper's guard path). Update the existing test block to
include these two cases so both true and false branches for nextMintExists are
covered for shouldShowNextMintInLatestDrop and shouldShowNextWinnerInComingUp.
components/the-memes/MemePageLive.tsx (1)

224-243: Consider simplifying the nullish coalescing on line 232.

The fileMimeType ?? undefined is redundant since the enclosing ternary fileMimeType ? ... : null already guarantees fileMimeType is truthy when MediaTypeBadge renders. You can pass mimeType={fileMimeType} directly.

♻️ Optional simplification
             <MediaTypeBadge
-              mimeType={fileMimeType ?? undefined}
+              mimeType={fileMimeType}
               size="sm"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/the-memes/MemePageLive.tsx` around lines 224 - 243, The
MediaTypeBadge's mimeType prop is being passed redundantly as fileMimeType ??
undefined inside the afterMetadata conditional; since the ternary only renders
when fileMimeType is truthy, change the prop to mimeType={fileMimeType}
directly. Update the JSX inside NftPageStats -> afterMetadata (the
MediaTypeBadge instantiation) to remove the nullish coalescing and pass
fileMimeType as-is, leaving other props (size, showTooltip, showLabel, tone,
labelClassName) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/home/now-minting/LatestDropNextMintSection.tsx`:
- Around line 33-45: The fallback inline element inside the JSX "content" pill
uses a <div> which breaks inline semantics; replace the fallback <div> with an
inline <span aria-hidden="true"> element (keeping the same class names and
sizing) so the pfp conditional (pfp ? <Image ... resolveIpfsUrl(pfp) ... label
/> : <fallback/>) preserves inline layout and avoids DOM reshaping/warnings in
LatestDropNextMintSection.tsx.

In `@components/memelab/MemeLabPage.tsx`:
- Around line 1204-1218: The current guard `fileType && fileMimeType` hides the
entire File Type row when MIME lookup fails even though
`get*FileTypeFromMetadata()` may have returned a usable raw `fileType`; change
the rendering to keep the <tr> whenever `fileType` exists and inside it render
the <MediaTypeBadge> only when `fileMimeType` is present, otherwise render the
textual `fileType` fallback (use the same cell styling as the badge cell).
Update the JSX around `fileType`, `fileMimeType`, and `MediaTypeBadge` so the
row always renders when `fileType` is truthy and falls back to plain text when
`fileMimeType` is null.

In `@helpers/nft.helpers.ts`:
- Around line 187-199: The fallback logic in the MIME detection prefers imageSrc
over animationSrc when getMimeTypeFromFormat(getUrlExtension(imageSrc)) returns
falsy, causing animated NFTs to be misclassified; update the logic in the block
around getResolvedImageSrc, getMimeTypeFromFormat and getUrlExtension to check
animationSrc first (e.g., attempt to derive MIME from animationSrc or, if
animationSrc exists, return "video/mp4" before falling back to imageSrc) so that
animation takes precedence even when image extension is unmapped.

---

Nitpick comments:
In `@__tests__/components/nft-image/utils/gateway-fallback.test.ts`:
- Around line 51-64: Add edge-case unit tests for
shouldUseIframeFallbackTimeout: include a test asserting that an empty string
returns false and a test asserting that an ipfs:// protocol URL (e.g.,
"ipfs://bafy-test" or similar) returns false; place them alongside the existing
cases so the guard conditions in shouldUseIframeFallbackTimeout are fully
covered.

In `@__tests__/helpers/mint-visibility.helpers.test.ts`:
- Around line 7-37: Add tests for the missing branch where nextMintExists is
false for both helpers: call shouldShowNextMintInLatestDrop and
shouldShowNextWinnerInComingUp with isMintEnded true/false and nextMintExists:
false and assert the expected boolean outcomes (both should be false when
nextMintExists is false regardless of isMintEnded for each helper's guard path).
Update the existing test block to include these two cases so both true and false
branches for nextMintExists are covered for shouldShowNextMintInLatestDrop and
shouldShowNextWinnerInComingUp.

In `@components/nft-image/utils/gateway-fallback.ts`:
- Around line 121-132: Centralize the URL classification logic into a single
shared helper (e.g., classifyAssetUrl or isArweaveAsset) and replace the
branching in both shouldUseIframeFallbackTimeout and
getArweaveGatewayFallbackUrls to call that helper; the new helper should
encapsulate the current checks that use isIpfsProtocolUrl,
getIpfsProtocolUrlFromGatewayUrl, and isArweaveUrl so both functions use the
same decision logic and avoid future drift.

In `@components/the-memes/MemePageLive.tsx`:
- Around line 224-243: The MediaTypeBadge's mimeType prop is being passed
redundantly as fileMimeType ?? undefined inside the afterMetadata conditional;
since the ternary only renders when fileMimeType is truthy, change the prop to
mimeType={fileMimeType} directly. Update the JSX inside NftPageStats ->
afterMetadata (the MediaTypeBadge instantiation) to remove the nullish
coalescing and pass fileMimeType as-is, leaving other props (size, showTooltip,
showLabel, tone, labelClassName) unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3b2e49e9-42bc-4de4-a045-8e4ef2105709

📥 Commits

Reviewing files that changed from the base of the PR and between 5fae065 and 4b75249.

📒 Files selected for processing (34)
  • __tests__/components/drops/view/item/content/media/MediaDisplay.test.tsx
  • __tests__/components/memelab/MemeLabPage.test.tsx
  • __tests__/components/nft-image/utils/gateway-fallback.test.ts
  • __tests__/components/the-memes/MemePageArt.test.tsx
  • __tests__/components/the-memes/MemePageLive.test.tsx
  • __tests__/helpers/mint-visibility.helpers.test.ts
  • __tests__/helpers/nft.helpers.test.ts
  • components/drops/media/MediaTypeBadge.tsx
  • components/drops/view/item/content/media/MediaDisplay.tsx
  • components/home/next-mint-leading/NextMintLeadingSection.tsx
  • components/home/now-minting/LatestDropNextMintSection.tsx
  • components/home/now-minting/LatestDropSection.tsx
  • components/home/now-minting/NowMintingDetails.tsx
  • components/home/now-minting/NowMintingHeader.tsx
  • components/memelab/MemeLab.tsx
  • components/memelab/MemeLabPage.tsx
  • components/nft-attributes/ArweaveLinksTable.tsx
  • components/nft-attributes/MetadataLink.tsx
  • components/nft-attributes/NftStats.tsx
  • components/nft-image/NFTImage.tsx
  • components/nft-image/NFTImageBalance.tsx
  • components/nft-image/NFTModel.tsx
  • components/nft-image/RememeImage.tsx
  • components/nft-image/renderers/NFTHTMLRenderer.tsx
  • components/nft-image/renderers/NFTImageRenderer.tsx
  • components/nft-image/renderers/NFTModelRenderer.tsx
  • components/nft-image/renderers/NFTVideoRenderer.tsx
  • components/nft-image/utils/gateway-fallback.ts
  • components/nft-image/utils/media-type.ts
  • components/the-memes/MemePageArt.tsx
  • components/the-memes/MemePageLive.tsx
  • components/the-memes/TheMemes.tsx
  • helpers/nft.helpers.ts
  • hooks/useNowMintingStatus.ts

Comment thread components/home/now-minting/LatestDropNextMintSection.tsx
Comment thread components/memelab/MemeLabPage.tsx Outdated
Comment thread helpers/nft.helpers.ts
prxt6529 added 2 commits April 2, 2026 15:54
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Copy link
Copy Markdown

@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: 2

🧹 Nitpick comments (1)
components/home/now-minting/LatestDropNextMintSection.tsx (1)

44-47: Remove unused tw-object-contain from placeholder span.

The object-contain CSS property only applies to replaced elements (images, videos, iframes). On a <span>, it has no effect and is vestigial from copying the <Image> styling.

Suggested fix
       <span
         aria-hidden="true"
-        className="tw-size-4 tw-flex-shrink-0 tw-rounded-sm tw-bg-iron-900 tw-object-contain"
+        className="tw-size-4 tw-flex-shrink-0 tw-rounded-sm tw-bg-iron-900"
       />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/home/now-minting/LatestDropNextMintSection.tsx` around lines 44 -
47, In LatestDropNextMintSection remove the unused utility "tw-object-contain"
from the placeholder <span> (the span with aria-hidden="true" and classes
"tw-size-4 tw-flex-shrink-0 tw-rounded-sm tw-bg-iron-900..."); edit the
className to drop "tw-object-contain" so the span only keeps relevant utilities
(e.g., tw-size-4 tw-flex-shrink-0 tw-rounded-sm tw-bg-iron-900) since
object-contain only applies to replaced elements like <Image>.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/home/now-minting/LatestDropNextMintSection.tsx`:
- Around line 174-179: The MediaTypeBadge usage sets size="sm" (badge container
is tw-size-6 / 24px) but iconClassName="tw-size-[26px]" makes the icon 26px and
overflows; fix by making the icon match the container or the container match the
icon: either change iconClassName to tw-size-6 (or remove the explicit size so
it defaults to the badge's internal sizing) or bump the badge size prop (e.g.,
size="md") or pass a matching container class via className to accommodate
tw-size-[26px]; update the MediaTypeBadge invocation accordingly (the component
name and props: MediaTypeBadge, mimeType, dropId, size, iconClassName).

In `@components/the-memes/MemePageArt.tsx`:
- Around line 198-217: The File Type row is currently rendered only when
fileType is truthy but the badge uses fileTypeMimeType, causing the row to be
omitted when a MIME is present but fileType is not; update the conditional that
wraps the "file-type" row to check fileTypeMimeType instead of fileType and
ensure the MediaTypeBadge remains passed fileTypeMimeType (keep size="sm",
showTooltip/Label, tone and labelClassName as-is) so MemePageArt's output
matches MemePageLive's behavior.

---

Nitpick comments:
In `@components/home/now-minting/LatestDropNextMintSection.tsx`:
- Around line 44-47: In LatestDropNextMintSection remove the unused utility
"tw-object-contain" from the placeholder <span> (the span with
aria-hidden="true" and classes "tw-size-4 tw-flex-shrink-0 tw-rounded-sm
tw-bg-iron-900..."); edit the className to drop "tw-object-contain" so the span
only keeps relevant utilities (e.g., tw-size-4 tw-flex-shrink-0 tw-rounded-sm
tw-bg-iron-900) since object-contain only applies to replaced elements like
<Image>.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 047df656-caa8-44f2-97bc-e49740399314

📥 Commits

Reviewing files that changed from the base of the PR and between 4b75249 and 7dd4bac.

📒 Files selected for processing (9)
  • __tests__/components/nft-image/utils/gateway-fallback.test.ts
  • __tests__/helpers/mint-visibility.helpers.test.ts
  • __tests__/helpers/nft.helpers.test.ts
  • components/home/now-minting/LatestDropNextMintSection.tsx
  • components/memelab/MemeLabPage.tsx
  • components/nft-image/utils/gateway-fallback.ts
  • components/the-memes/MemePageArt.tsx
  • components/the-memes/MemePageLive.tsx
  • helpers/nft.helpers.ts
✅ Files skipped from review due to trivial changes (3)
  • tests/helpers/mint-visibility.helpers.test.ts
  • tests/components/nft-image/utils/gateway-fallback.test.ts
  • tests/helpers/nft.helpers.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • helpers/nft.helpers.ts
  • components/nft-image/utils/gateway-fallback.ts
  • components/memelab/MemeLabPage.tsx

Comment thread components/home/now-minting/LatestDropNextMintSection.tsx
Comment thread components/the-memes/MemePageArt.tsx
Signed-off-by: prxt6529 <prxt@6529.io>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 2, 2026

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (2)
components/the-memes/MemePageLive.tsx (1)

82-191: Optional: reduce repeated tw-font-medium literals.

You now repeat the same class string across many <td> cells; consider a shared utility class/constant for easier future edits and lower churn.

Also applies to: 210-222

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/the-memes/MemePageLive.tsx` around lines 82 - 191, Many <td> cells
repeat the "tw-font-medium" (and in some cases "text-right tw-font-medium")
literal; define a single shared class constant or small helper (e.g.,
FONT_MEDIUM or TD_RIGHT_CLASS) inside MemePageLive.tsx and replace the repeated
class strings used in the rows that render props.nftMeta (including the blocks
showing burnt, museum, cleaned, percent_unique, etc.) with that constant to
centralize styling and reduce churn when updating the class name.
components/memelab/MemeLabPage.tsx (1)

1013-1017: Optional simplification: MIME fallback logic is currently redundant.

getAnimationMimeTypeFromMetadata / getImageMimeTypeFromMetadata already resolve via format mapping, so the extra getMimeTypeFromFormat(...) fallback likely repeats the same work.

♻️ Suggested simplification
-  const fileMimeType = isShowingAnimation
-    ? (getAnimationMimeTypeFromMetadata(nft?.metadata) ??
-      getMimeTypeFromFormat(animationFormat))
-    : (getImageMimeTypeFromMetadata(nft?.metadata) ??
-      getMimeTypeFromFormat(imageFormat));
+  const fileMimeType = isShowingAnimation
+    ? getAnimationMimeTypeFromMetadata(nft?.metadata)
+    : getImageMimeTypeFromMetadata(nft?.metadata);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/memelab/MemeLabPage.tsx` around lines 1013 - 1017, The MIME-type
fallback is redundant: remove the extra getMimeTypeFromFormat(...) calls and
rely solely on getAnimationMimeTypeFromMetadata and getImageMimeTypeFromMetadata
which already map to formats; update the fileMimeType assignment in
MemeLabPage.tsx so it sets fileMimeType = isShowingAnimation ?
getAnimationMimeTypeFromMetadata(nft?.metadata) :
getImageMimeTypeFromMetadata(nft?.metadata), keeping the existing
isShowingAnimation, nft, animationFormat and imageFormat context intact and
ensuring any null coalescing behavior remains consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@components/memelab/MemeLabPage.tsx`:
- Around line 1013-1017: The MIME-type fallback is redundant: remove the extra
getMimeTypeFromFormat(...) calls and rely solely on
getAnimationMimeTypeFromMetadata and getImageMimeTypeFromMetadata which already
map to formats; update the fileMimeType assignment in MemeLabPage.tsx so it sets
fileMimeType = isShowingAnimation ?
getAnimationMimeTypeFromMetadata(nft?.metadata) :
getImageMimeTypeFromMetadata(nft?.metadata), keeping the existing
isShowingAnimation, nft, animationFormat and imageFormat context intact and
ensuring any null coalescing behavior remains consistent.

In `@components/the-memes/MemePageLive.tsx`:
- Around line 82-191: Many <td> cells repeat the "tw-font-medium" (and in some
cases "text-right tw-font-medium") literal; define a single shared class
constant or small helper (e.g., FONT_MEDIUM or TD_RIGHT_CLASS) inside
MemePageLive.tsx and replace the repeated class strings used in the rows that
render props.nftMeta (including the blocks showing burnt, museum, cleaned,
percent_unique, etc.) with that constant to centralize styling and reduce churn
when updating the class name.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d4eea4ac-28ae-4a44-b637-5702a66378f9

📥 Commits

Reviewing files that changed from the base of the PR and between 7dd4bac and 35f7682.

📒 Files selected for processing (3)
  • components/home/now-minting/LatestDropNextMintSection.tsx
  • components/memelab/MemeLabPage.tsx
  • components/the-memes/MemePageLive.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/home/now-minting/LatestDropNextMintSection.tsx

@prxt6529 prxt6529 merged commit cae9920 into main Apr 2, 2026
8 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.

2 participants