Skip to content

Show token badge for none english collection#628

Open
CedrikNikita wants to merge 4 commits into
developfrom
feature/show-token-badge-for-none-english-collection
Open

Show token badge for none english collection#628
CedrikNikita wants to merge 4 commits into
developfrom
feature/show-token-badge-for-none-english-collection

Conversation

@CedrikNikita

@CedrikNikita CedrikNikita commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

📸 Screenshots report — updated Thu, 16 Jul 2026 03:04:56 GMT


Note

Medium Risk
Changes token creation validation and which collection is selected at deploy time; list UI is additive. No auth or payment changes, but wrong collection detection could mis-route creates for non-Latin names.

Overview
Adds non-English collection visibility in the trending token list and auto-detects collection/language when creating a token, using new API collection_info on TokenDto.

Token list: Optional Collection column (wide layouts) and compact badges next to the symbol for tokens outside the default WORDS/English collection, driven by isNonEnglishToken / tokenCollectionLabel and collection_info. English tokens show no badge. showCollectionColumn can hide the column (e.g. account “created tokens”).

Create token: Replaces the manual collection radio grid with character-based detection against each collection’s allowed_name_chars, an inline language chip (dropdown when multiple collections match), and an unsupported state that blocks submit. Name normalization is lighter (uppercase/hyphens, IME composition preserved) instead of stripping disallowed chars on every keystroke.

Other: Regenerated OpenAPI types (CollectionInfoDto), i18n tokenListTable.collection, and a pagination fix so empty filtered lists don’t show “Load More” when totalPages is 0.

Reviewed by Cursor Bugbot for commit a99bad5. Bugbot is set up for automated code reviews on this repo. Configure here.

@netlify

netlify Bot commented Jul 15, 2026

Copy link
Copy Markdown

Deploy Preview for fancy-gelato-7cdad5 ready!

Name Link
🔨 Latest commit a99bad5
🔍 Latest deploy log https://app.netlify.com/projects/fancy-gelato-7cdad5/deploys/6a5849be54a38800079a3c85
😎 Deploy Preview https://deploy-preview-628--fancy-gelato-7cdad5.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown
Contributor

🔎️ Preview Link for Commit: 0110d70

https://pr-628-superhero.stg.service.aepps.com

- Remove manual collection selector (radio buttons)
- Auto-detect language based on character input using allowedNameCharsToPattern
- Add inline language chip indicator inside token name input (right side)
- Show dropdown with chevron for multi-language edge cases
- Display 'Unsupported' badge for characters not in any collection
- Reject form submission for unsupported character sets
- Improve UX with real-time language feedback

The language is now detected automatically as users type. A small chip
appears on the right side of the input showing the detected language:
- Green chip: single language match (confident)
- Purple chip with dropdown: multiple languages match (edge case)
- Red badge: unsupported characters (submission blocked)

This works seamlessly with the collection badges from this PR.
@Jeanclaudeaoun

Jeanclaudeaoun commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🎯 Enhancement: Auto-detect Language in Token Creation

I've implemented automatic language detection for the /trends/create page that works perfectly with the collection badges from this PR!

What Changed

Removed:

  • Manual collection selector (radio buttons for English/Chinese/Arabic/Russian)

Added:

  • ✨ Auto-detection based on character input
  • 🎨 Inline language chip inside the input field (right side)
  • 🎯 Smart dropdown for edge cases (multiple language matches)
  • 🚫 "Unsupported" badge blocks invalid characters
  • ⚡ Real-time validation as you type

Visual Example

Before:

[ ] English  [ ] Chinese  [ ] Arabic  [ ] Russian  ← Takes space
#[___INPUT_________________________________]

After:

#[___INPUT__________________] [English ✓]  ← Auto-detected!

Color Coding

  • 🟢 Green chip: Single language detected (confident)
  • 🟣 Purple chip + dropdown: Multiple languages possible (choose manually)
  • 🔴 Red badge: Unsupported characters (submission blocked)

Test Cases

  • Type BITCOIN → Green "English" chip
  • Type 北京 → Green "Chinese" chip
  • Type موسكو → Green "Arabic" chip
  • Type МОСКВА → Green "Russian" chip
  • Type 🚀ROCKET → Red "Unsupported" badge

The collectionNameChars.ts file doesn't exist in this branch yet (it's in PR #629).
This commit inlines the utility function to make the build work independently.
@Jeanclaudeaoun
Jeanclaudeaoun marked this pull request as ready for review July 21, 2026 01:06

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a99bad5. Configure here.

if (detectedCollections.length === 0 && trimmed) {
setNameStatus('unsupported');
return;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Debounced name vs detection

Medium Severity

The availability effect treats a name as unsupported when detectedCollections is empty, but it validates tokenNameDebounced while detectedCollections is derived from immediate tokenName. During the debounce window, a valid debounced prefix can be marked unsupported or skip checks inconsistent with what the user typed.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a99bad5. Configure here.

<th className="cell cell-collection text-xs opacity-50 text-left py-1 px-3 whitespace-nowrap">
{t('tokenListTable.collection', { ns: 'trending' })}
</th>
)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Skeleton missing collection column

Low Severity

With showCollectionColumn enabled, the table header and data rows include a collection column, but loading skeleton rows do not. While data is fetching, desktop columns shift so headers no longer align with skeleton cells.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a99bad5. Configure here.

@Jeanclaudeaoun

Copy link
Copy Markdown
Contributor

@CedrikNikita please merge to prod after your dev review

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