Sort seed data routes by game progression instead of alphabetically

Add ROUTE_ORDER maps for Kanto (FRLG), Johto (HGSS), and Hoenn (Emerald)
progressions with aliases for related version groups. Add Export Order
button to admin game detail page for iterating on route orderings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 13:27:51 +01:00
parent 110b864e95
commit 73d4a1831c
16 changed files with 66639 additions and 66337 deletions

View File

@@ -1,4 +1,5 @@
import { useState } from 'react'
import { toast } from 'sonner'
import { useParams, useNavigate, Link } from 'react-router-dom'
import {
DndContext,
@@ -158,12 +159,24 @@ export function AdminGameDetail() {
<div className="flex justify-between items-center mb-4">
<h3 className="text-lg font-medium">Routes ({routes.length})</h3>
<button
onClick={() => setShowCreate(true)}
className="px-4 py-2 text-sm font-medium rounded-md bg-blue-600 text-white hover:bg-blue-700"
>
Add Route
</button>
<div className="flex gap-2">
<button
onClick={() => {
const names = routes.map((r) => r.name)
navigator.clipboard.writeText(JSON.stringify(names, null, 2))
toast.success('Route order copied to clipboard')
}}
className="px-4 py-2 text-sm font-medium rounded-md border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800"
>
Export Order
</button>
<button
onClick={() => setShowCreate(true)}
className="px-4 py-2 text-sm font-medium rounded-md bg-blue-600 text-white hover:bg-blue-700"
>
Add Route
</button>
</div>
</div>
{routes.length === 0 ? (