Skip to content

gamma.io support#2392

Merged
prxt6529 merged 17 commits into
mainfrom
gamma-io-support
May 15, 2026
Merged

gamma.io support#2392
prxt6529 merged 17 commits into
mainfrom
gamma-io-support

Conversation

@prxt6529
Copy link
Copy Markdown
Collaborator

@prxt6529 prxt6529 commented May 14, 2026

Summary by CodeRabbit

  • New Features

    • Added Gamma.io marketplace support (ordinals, inscriptions, collections, tokens, Stacks NFTs) with unified preview UI and Gamma.io-branded CTAs
    • Gamma.io-specific media rendering for image/video previews (pixelated image frames where applicable)
  • Bug Fixes

    • Improved paragraph/blank-line rendering and spacing in markdown content
    • Treat .jpg paths as static assets to avoid proxy interception
  • Tests

    • Expanded tests for Gamma.io URL recognition, curation validation, CTA branding, and preview layout expectations

Review Change Stack

prxt6529 added 3 commits May 14, 2026 17:15
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds Gamma.io URL recognition and curation validation, renders gamma.io images with a pixelated fixed-height frame, centralizes preview rendering in MarketplacePreview (with per-marketplace wrappers delegating to it), updates related tests, adjusts markdown blank-line rendering, and treats .jpg as static in the proxy.

Changes

Gamma.io Marketplace Preview Support

Layer / File(s) Summary
URL kinds and host matchers
components/waves/marketplace/urlKind.ts
Adds gammaio.* MarketplaceUrlKind variants, Gamma.io pathname regexes, GAMMAIO_HOST, and a gamma.io entry in host matchers so URL parsing recognizes Gamma.io patterns.
Curation URL validation
components/waves/utils/validateCurationDropUrl.ts, __tests__/components/waves/utils/validateCurationDropUrl.test.ts
Add Gamma.io examples, introduce GAMMAIO_ID_PART_REGEX, and allow Gamma.io pathname patterns; extend tests to accept supported gamma.io formats and reject incomplete collection/token paths.
MarketplacePreview implementation
components/waves/marketplace/MarketplacePreview.tsx, components/waves/marketplace/MarketplaceGammaioPreview.tsx
Add client-side MarketplacePreview that calls useMarketplacePreviewState and conditionally renders placeholder/unavailable/item preview; wire Gamma.io kinds to render MarketplaceGammaioPreview.
Media frame CSS & item CTA tests
components/waves/marketplace/previewLayout.ts, __tests__/components/waves/MarketplaceItemPreviewCard.test.tsx
Replace aspect-ratio/min-height classes with fixed height/padding (tw-h-64, tw-p-4, responsive variants) and update tests to assert new frame classes and Gamma.io CTA branding.
Media rendering for Gamma.io
components/waves/marketplace/MarketplaceItemPreviewMediaLink.tsx, components/waves/marketplace/MarketplaceItemPreviewCard.utils.ts
Add MIME-type helpers and gamma.io host detection to render direct pixelated <img> for gamma.io images, handle videos via <video>, fallback to MediaDisplay, and map gammaio kinds to /gammaio.jpg branding.
Preview component delegations
components/waves/marketplace/*Preview.tsx (Gammaio, Manifold, OpenSea, Foundation, Superrare, Transient variants)
Simplify per-marketplace preview components to delegate rendering to MarketplacePreview, removing local useMarketplacePreviewState and placeholder/unavailable card logic.
Markdown blank-line rendering
components/drops/view/part/dropPartMarkdown/content.tsx, __tests__/components/drops/view/part/DropPartMarkdown.test.tsx
Detect blank-only paragraphs and render an aria-hidden placeholder <p> with tw-my-1 tw-h-2 tw-leading-none; update tests to assert new spacing classes and paragraph styles.
Proxy static suffix
proxy.ts
Add .jpg to STATIC_PATH_SUFFIXES so .jpg requests bypass proxy enforcement.

Sequence Diagram:

sequenceDiagram
  participant Page
  participant MarketplacePreview
  participant useMarketplacePreviewState
  participant MarketplaceGammaioPreview

  Page->>MarketplacePreview: render(href, mode?, compact?)
  MarketplacePreview->>useMarketplacePreviewState: resolve preview state for href
  MarketplacePreview->>MarketplaceGammaioPreview: delegate render(href, compact) when kind startsWith "gammaio."
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested Reviewers

  • ragnep
  • simo6529

Poem

🐰 I hopped through links and found a glow,

Gamma banners in a tidy row,
Frames now steady, pixels bright,
CTAs wink in Gamma's light,
A rabbit cheers, "The previews show!"

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'gamma.io support' directly and specifically describes the main feature addition across the changeset: comprehensive support for Gamma.io marketplace URLs, preview rendering, and branding.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gamma-io-support

Comment @coderabbitai help to get the list of available commands and usage tips.

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 (2)
__tests__/components/waves/utils/validateCurationDropUrl.test.ts (1)

17-24: ⚡ Quick win

Add a negative regression case for gamma.io/collections/<slug>/tokens.

Please add an explicit rejection assertion for the no-token-id path so the generic collection matcher cannot regress and accept this section URL as a valid item URL.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@__tests__/components/waves/utils/validateCurationDropUrl.test.ts` around
lines 17 - 24, Add a negative test case in validateCurationDropUrl.test.ts that
asserts the no-token-id path "gamma.io/collections/example-collection/tokens" is
rejected by the validator to prevent the generic collection matcher from
accepting it; update the existing test array (near the entries with
`gamma.io/collections/example-collection/${id}` and
`gamma.io/collections/example-collection/tokens/${id}`) to include the
standalone "gamma.io/collections/example-collection/tokens" string and add an
explicit expect/assert that validateCurationDropUrl (or the tested function used
in this file) returns false / rejects for that input.
__tests__/components/waves/marketplace/urlKind.test.ts (1)

69-73: ⚡ Quick win

Add https://gamma.io/collections/example-collection/tokens to unsupported URLs.

This is the key ambiguity case for the collection matcher and should be pinned in the negative matrix.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@__tests__/components/waves/marketplace/urlKind.test.ts` around lines 69 - 73,
Add the ambiguous collection URL
"https://gamma.io/collections/example-collection/tokens" to the unsupported URLs
test matrix: update the unsupported URLs array in urlKind.test.ts (the array
containing "https://gamma.io/collections",
"https://gamma.io/ordinals/collections/example-collection", etc.) to include
that exact URL so the collection matcher is asserted negative for this case.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@components/waves/marketplace/MarketplaceItemPreviewCard.utils.ts`:
- Around line 43-50: The displayName for Gamma should use proper branding:
change the return value in the switch cases handling "gammaio.collection",
"gammaio.collection-token", "gammaio.inscription", "gammaio.ordinal",
"gammaio.ordinal-inscription", "gammaio.ordinal-collection-inscription", and
"gammaio.stacks-nft" so that displayName is "Gamma.io" (not "gammaio") and keep
logoSrc as "/gammaio.jpg"; update any consumers that derive CTA/ARIA text from
displayName (e.g., code that renders "Open on {displayName}") to ensure they
pick up the new branded text.

In `@components/waves/marketplace/urlKind.ts`:
- Around line 28-30: The GAMMAIO_COLLECTION_PATH_PATTERN currently matches
/collections/<slug>/tokens (missing token id); update the regex in the constant
GAMMAIO_COLLECTION_PATH_PATTERN so the second path segment cannot be the literal
"tokens" (e.g. use a negative lookahead like /(?!tokens$)/ for that segment)
while keeping GAMMAIO_COLLECTION_TOKEN_PATH_PATTERN as the explicit
tokens-with-id pattern; replace the existing pattern with one such as
^\/collections\/[^\/?#]+\/(?!tokens$)[^\/?#]+\/?$ (preserve the i flag).

In `@components/waves/utils/validateCurationDropUrl.ts`:
- Around line 96-101: The first collection regex in validateCurationDropUrl
allows the literal segment "tokens" to be matched as the second path part (so
/collections/<slug>/tokens is wrongly accepted); update the RegExp that uses
SLUG_ID_PART_REGEX and GAMMAIO_ID_PART_REGEX so the segment matched by
GAMMAIO_ID_PART_REGEX is not the literal "tokens" (e.g. add a negative lookahead
before GAMMAIO_ID_PART_REGEX or otherwise exclude the exact string "tokens");
modify the RegExp expression(s) where SLUG_ID_PART_REGEX and
GAMMAIO_ID_PART_REGEX are combined to enforce that exclusion.

---

Nitpick comments:
In `@__tests__/components/waves/marketplace/urlKind.test.ts`:
- Around line 69-73: Add the ambiguous collection URL
"https://gamma.io/collections/example-collection/tokens" to the unsupported URLs
test matrix: update the unsupported URLs array in urlKind.test.ts (the array
containing "https://gamma.io/collections",
"https://gamma.io/ordinals/collections/example-collection", etc.) to include
that exact URL so the collection matcher is asserted negative for this case.

In `@__tests__/components/waves/utils/validateCurationDropUrl.test.ts`:
- Around line 17-24: Add a negative test case in validateCurationDropUrl.test.ts
that asserts the no-token-id path
"gamma.io/collections/example-collection/tokens" is rejected by the validator to
prevent the generic collection matcher from accepting it; update the existing
test array (near the entries with
`gamma.io/collections/example-collection/${id}` and
`gamma.io/collections/example-collection/tokens/${id}`) to include the
standalone "gamma.io/collections/example-collection/tokens" string and add an
explicit expect/assert that validateCurationDropUrl (or the tested function used
in this file) returns false / rejects for that input.
🪄 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: 35194f66-876e-4ce6-b863-fb89ec3f4b5f

📥 Commits

Reviewing files that changed from the base of the PR and between 6f76e89 and 2f902e4.

⛔ Files ignored due to path filters (1)
  • public/gammaio.jpg is excluded by !**/*.jpg
📒 Files selected for processing (10)
  • __tests__/components/waves/MarketplaceItemPreviewCard.test.tsx
  • __tests__/components/waves/marketplace/urlKind.test.ts
  • __tests__/components/waves/utils/validateCurationDropUrl.test.ts
  • components/waves/MarketplacePreview.tsx
  • components/waves/marketplace/MarketplaceGammaioPreview.tsx
  • components/waves/marketplace/MarketplaceItemPreviewCard.utils.ts
  • components/waves/marketplace/MarketplaceItemPreviewMediaLink.tsx
  • components/waves/marketplace/previewLayout.ts
  • components/waves/marketplace/urlKind.ts
  • components/waves/utils/validateCurationDropUrl.ts

Comment thread components/waves/marketplace/MarketplaceItemPreviewCard.utils.ts Outdated
Comment thread components/waves/marketplace/urlKind.ts Outdated
Comment thread components/waves/utils/validateCurationDropUrl.ts
prxt6529 added 14 commits May 15, 2026 08:48
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
@sonarqubecloud
Copy link
Copy Markdown

@prxt6529 prxt6529 merged commit 56bf724 into main May 15, 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.

3 participants