Skip to content

Fix/x link input - #54

Merged
kevincodex1 merged 3 commits into
mainfrom
fix/x-link-input
Sep 17, 2026
Merged

kevincodex1 merged 3 commits into
mainfrom
fix/x-link-input

Conversation

@kevincodex1

@kevincodex1 kevincodex1 commented Sep 17, 2026

Copy link
Copy Markdown
Member

Summary

  • The X field on the launch form and the edit sheet now takes @handle or an x.com / twitter.com profile link.
  • Removed the "Open in pools.trade" link from Robinhood Chain token pages. Base and Arc keep "Open in Uniswap".

Why

A pasted https://x.com/foo was cut to 15 characters (https://x.com/f), failed the handle check, and came back as x: letters, digits, _. On the launch form this only happened after clicking Launch, during the metadata save. The launch and edit validators had also drifted apart.

X field

  • One shared parser, lib/launchpad/xHandle.ts, now backs both validateMeta and validateEdit.
  • Accepts foo, @foo, and links on x.com / twitter.com. Links can use www. or mobile. hosts, carry query strings (?s=21) or fragments, and point at deep paths such as /foo/status/123.
  • Rejects other hosts, lookalikes (x.com.evil.com, x.com@evil.com, x.com\@evil.com), non-web schemes, and links to non-profile pages (/home, /i/…, /intent/…, /search, …).
  • The non-profile list is checked on links only. Typed handles behave exactly as before, so every handle already saved still validates.
  • Only the bare handle is stored, as before: no schema change, no API shape change. The token page still builds https://x.com/<handle> itself, so a pasted URL never becomes a link target.
  • A link and a bare handle normalize to the same value, so signed edit messages are identical and launch retries match the saved row (no false 409).
  • The launch form shows X: enter a handle or an x.com link. inline before Launch. Both forms use the placeholder @handle or x.com link and show @handle on blur.
  • llms.txt notes that x_handle takes a handle or a profile link.

Behavior change for API clients: a handle longer than 15 characters is now a 400. The launch endpoint used to silently cut it to 15, which could point at someone else's account.

pools.trade

  • SWAP_SITES is now partial; a chain without an entry shows no outside swap link. The Robinhood entry is gone.
  • Deleted the unused uniswapSwapUrl helper.
  • The token page skips the links row entirely when a token has no website, no X handle and no swap site, instead of rendering an empty row.

Tests

  • xHandle.test.ts: accepted and rejected forms, host-smuggling cases, legacy handles still pass, no silent truncation, oversized input, form wiring.
  • metaShared.test.ts: link normalizes to the handle; other hosts rejected; a retry with the link or the bare handle matches the saved row.
  • creator.test.ts: a link and a handle produce the same signed edit message.
  • editServer.test.ts: a link is accepted and written; a link to another site is a 400 and leaves the nonce unused.
  • swap-sites.test.ts: Base and Arc link to Uniswap, Robinhood has none, the token page renders the link conditionally.

Summary by CodeRabbit

  • New Features
    • X handle fields now accept bare handles, optional “@” prefixes, and valid X/Twitter profile links.
    • Handles are validated and consistently normalized before launch or edit actions.
    • Token pages show configured swap links and social links only when available.
  • Bug Fixes
    • Invalid handles and unsupported profile links are rejected without saving changes.
    • Robinhood Chain no longer displays an unavailable external swap link.
  • Documentation
    • Updated metadata guidance to describe supported X handle formats and storage behavior.

SWAP_SITES is now partial: a chain without an entry shows no outside swap link.
Base and Arc keep Open in Uniswap. The unused uniswapSwapUrl helper goes with it.
A pasted https://x.com/foo was cut to 15 characters and rejected with a cryptic error,
and only after Launch was clicked. One shared parser now backs both validators: it takes
foo, @foo, or an x.com / twitter.com link (www/mobile hosts, query strings, deep paths),
rejects other hosts and non-profile paths, and stores the bare handle as before, so pages
still build the x.com link themselves. Overlong handles are an error instead of a silent cut.
The launch form shows the error inline and both forms show @handle on blur.
A typed handle is taken as given, so every handle the old validators accepted still passes
and a saved token's edit sheet never opens with an error. The token page skips the links
row when a Robinhood token has no website and no X handle. Adds host-smuggling test cases.
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Essentials

Run ID: b88e2c24-f8e6-44bc-a26c-6c1e1f96aeb0

📥 Commits

Reviewing files that changed from the base of the PR and between fffe32e and 330f3f0.

📒 Files selected for processing (13)
  • app/src/app/llms.txt/route.ts
  • app/src/app/t/[chain]/[token]/page.tsx
  • app/src/components/launchpad/EditTokenSheet.tsx
  • app/src/components/launchpad/LaunchForm.tsx
  • app/src/lib/launchpad/config.ts
  • app/src/lib/launchpad/creator.test.ts
  • app/src/lib/launchpad/editAuth.ts
  • app/src/lib/launchpad/editServer.test.ts
  • app/src/lib/launchpad/metaShared.test.ts
  • app/src/lib/launchpad/metaShared.ts
  • app/src/lib/launchpad/swap-sites.test.ts
  • app/src/lib/launchpad/xHandle.test.ts
  • app/src/lib/launchpad/xHandle.ts

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The PR adds shared X handle parsing for launch and edit flows. It updates metadata validation and tests for normalized handles. It also makes swap links chain-specific and optional, removing the Robinhood external swap link.

Changes

Launchpad integrations

Layer / File(s) Summary
Shared X handle parser
app/src/lib/launchpad/xHandle.ts, app/src/lib/launchpad/xHandle.test.ts
parseXHandle accepts handles and supported X or Twitter profile URLs, normalizes valid values, and rejects invalid input.
Validation and metadata integration
app/src/lib/launchpad/metaShared.ts, app/src/lib/launchpad/editAuth.ts, app/src/lib/launchpad/*test.ts
Metadata and edit validation use the shared parser. Tests cover normalization, signed edits, persistence, nonce handling, and write decisions.
Launch and edit form integration
app/src/components/launchpad/LaunchForm.tsx, app/src/components/launchpad/EditTokenSheet.tsx, app/src/app/llms.txt/route.ts
Forms accept X links, validate submitted values, and normalize valid values to an at-prefixed handle on blur. Documentation describes accepted formats and storage.
Chain-specific swap-site rendering
app/src/lib/launchpad/config.ts, app/src/app/t/[chain]/[token]/page.tsx, app/src/lib/launchpad/swap-sites.test.ts
Swap-site configuration is optional per chain. Token pages render configured swap links only when available. Robinhood no longer has an external swap entry.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant LaunchForm
  participant parseXHandle
  participant MetadataValidation
  LaunchForm->>parseXHandle: Parse submitted X value
  parseXHandle-->>LaunchForm: Return normalized handle or error
  LaunchForm->>MetadataValidation: Submit normalized handle
  MetadataValidation-->>LaunchForm: Accept value or reject validation
Loading

Merge Risk: ⚪ Minimal · up to 330f3

The updated handle and chain-specific swap-link behavior has no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 13 files. 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 clearly identifies the X link input changes, which are a significant part of the pull request. It does not mention the token-page swap link updates, but the title remains relevant and specif…
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/x-link-input

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

@kevincodex1
kevincodex1 merged commit 332ad18 into main Sep 17, 2026
7 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.

1 participant