From 6ce92b290ca3391338caaffad8b820aba169fb9b Mon Sep 17 00:00:00 2001 From: Faroe Games Date: Tue, 17 Nov 2026 16:18:59 -0700 Subject: [PATCH] Add custom SVG favicons, Gitea issue links and templates, and API triage script --- .dockerignore | 1 + .gitea/ISSUE_TEMPLATE/bug_report.md | 24 ++++++++ .gitea/ISSUE_TEMPLATE/data_correction.md | 21 +++++++ .gitea/ISSUE_TEMPLATE/feature_request.md | 13 +++++ Dockerfile | 2 + assets/favicon.svg | 13 +++++ assets/landing.css | 33 +++++++++++ index.html | 15 +++++ luminescent-platinum/favicon.svg | 14 +++++ luminescent-platinum/index.html | 1 + luminescent-platinum/src/ui/header.js | 7 +++ oras/favicon.svg | 20 +++++++ oras/index.html | 1 + oras/src/ui/header.js | 7 +++ package.json | 3 +- scripts/check-gitea.mjs | 71 ++++++++++++++++++++++++ tests/portal.test.mjs | 18 ++++++ 17 files changed, 263 insertions(+), 1 deletion(-) create mode 100644 .gitea/ISSUE_TEMPLATE/bug_report.md create mode 100644 .gitea/ISSUE_TEMPLATE/data_correction.md create mode 100644 .gitea/ISSUE_TEMPLATE/feature_request.md create mode 100644 assets/favicon.svg create mode 100644 luminescent-platinum/favicon.svg create mode 100644 oras/favicon.svg create mode 100644 scripts/check-gitea.mjs diff --git a/.dockerignore b/.dockerignore index fb07621..769260b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,6 +4,7 @@ node_modules **/tests *.xlsx docs +scripts README.md **/README.md package.json diff --git a/.gitea/ISSUE_TEMPLATE/bug_report.md b/.gitea/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..bc046c1 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,24 @@ +--- +name: 🐛 Bug Report +about: Report a UI bug, broken link, save issue, or unexpected behavior +title: "[Bug] " +labels: + - bug +--- + +### Which tracker page? +- [ ] Unified Hub (`/`) +- [ ] Omega Ruby & Alpha Sapphire (`/oras/`) +- [ ] Luminescent Platinum v2.1 (`/luminescent-platinum/`) + +### What happened? + + +### Steps to reproduce +1. Go to '...' +2. Click / toggle '...' +3. See error + +### Browser & Device +- Browser: [e.g. Chrome, Edge, Safari, Firefox] +- Device: [e.g. Windows PC, iPhone, Android] diff --git a/.gitea/ISSUE_TEMPLATE/data_correction.md b/.gitea/ISSUE_TEMPLATE/data_correction.md new file mode 100644 index 0000000..b234a3e --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/data_correction.md @@ -0,0 +1,21 @@ +--- +name: 📊 Pokédex / Encounter Data Correction +about: Report a wrong spawn rate, level range, trainer team, move, or evolution gate +title: "[Data] " +labels: + - data +--- + +### Which tracker & version? +- [ ] Alpha Sapphire / Omega Ruby +- [ ] Luminescent Platinum v2.1 + +### Location / Section / Pokémon +- **Badge Section:** [e.g. Pre-Badge 1] +- **Route / Area:** [e.g. Route 116 / Route 201] +- **Pokémon / Trainer:** [e.g. Abra / Rival Barry] + +### Current vs. Expected Data +- **Currently shown in tracker:** +- **Correct in-game value:** +- **Source / Verification (Serebii, Team Luminescent Docs, in-game check):** diff --git a/.gitea/ISSUE_TEMPLATE/feature_request.md b/.gitea/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..b5bdd02 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,13 @@ +--- +name: 💡 Feature or New Game Request +about: Suggest an improvement, quality-of-life toggle, or another Pokémon game tracker +title: "[Feature] " +labels: + - enhancement +--- + +### Summary + + +### Details / Notes + diff --git a/Dockerfile b/Dockerfile index 54e37dd..3f95599 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,10 @@ COPY docker/nginx.conf /etc/nginx/conf.d/default.conf COPY index.html /usr/share/nginx/html/index.html COPY assets/ /usr/share/nginx/html/assets/ COPY oras/index.html /usr/share/nginx/html/oras/index.html +COPY oras/favicon.svg /usr/share/nginx/html/oras/favicon.svg COPY oras/src/ /usr/share/nginx/html/oras/src/ COPY luminescent-platinum/index.html /usr/share/nginx/html/luminescent-platinum/index.html +COPY luminescent-platinum/favicon.svg /usr/share/nginx/html/luminescent-platinum/favicon.svg COPY luminescent-platinum/src/ /usr/share/nginx/html/luminescent-platinum/src/ EXPOSE 28473 diff --git a/assets/favicon.svg b/assets/favicon.svg new file mode 100644 index 0000000..c894a60 --- /dev/null +++ b/assets/favicon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/landing.css b/assets/landing.css index c593e25..e818a94 100644 --- a/assets/landing.css +++ b/assets/landing.css @@ -255,3 +255,36 @@ body { border-radius: 4px; color: #e5e7eb; } + +.hub-footer-links { + display: flex; + justify-content: center; + flex-wrap: wrap; + gap: 10px; + margin-top: 12px; +} + +.hub-ext-link { + display: inline-flex; + align-items: center; + gap: 5px; + padding: 5px 12px; + border-radius: 999px; + background: var(--bg-elevated); + border: 1px solid var(--border); + color: var(--text-main); + font-size: 12px; + font-weight: 700; + text-decoration: none; + transition: border-color 0.15s ease, color 0.15s ease; +} + +.hub-ext-link:hover { + border-color: rgba(56, 189, 248, 0.55); + color: #7dd3fc; +} + +.hub-ext-issue:hover { + border-color: rgba(52, 211, 153, 0.55); + color: var(--mint); +} diff --git a/index.html b/index.html index d0796a1..3753189 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ Professor Oak Challenge Trackers + @@ -114,6 +115,20 @@

Progress saves locally in your browser per game (poc-tracker:v1 for ORAS, lumi-poc-tracker:v1 for Luminescent Platinum). If moving from a local port to a new domain, use Export Save → Import inside each tracker.

+ diff --git a/luminescent-platinum/favicon.svg b/luminescent-platinum/favicon.svg new file mode 100644 index 0000000..7608f01 --- /dev/null +++ b/luminescent-platinum/favicon.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/luminescent-platinum/index.html b/luminescent-platinum/index.html index 5258815..6b257c5 100644 --- a/luminescent-platinum/index.html +++ b/luminescent-platinum/index.html @@ -4,6 +4,7 @@ Luminescent Platinum v2.1 — Professor Oak Challenge Tracker + diff --git a/luminescent-platinum/src/ui/header.js b/luminescent-platinum/src/ui/header.js index 6633ff5..dee49e8 100644 --- a/luminescent-platinum/src/ui/header.js +++ b/luminescent-platinum/src/ui/header.js @@ -73,6 +73,13 @@ export function renderHeader(game, state, progress, profilesWithCounts = null) {
← Hub + Report Issue ↗
${versionPills}
diff --git a/oras/favicon.svg b/oras/favicon.svg new file mode 100644 index 0000000..3280a56 --- /dev/null +++ b/oras/favicon.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/oras/index.html b/oras/index.html index 4e03205..e866a90 100644 --- a/oras/index.html +++ b/oras/index.html @@ -4,6 +4,7 @@ Omega Ruby & Alpha Sapphire — Professor Oak Challenge Tracker + diff --git a/oras/src/ui/header.js b/oras/src/ui/header.js index 53f3b2f..ac68441 100644 --- a/oras/src/ui/header.js +++ b/oras/src/ui/header.js @@ -68,6 +68,13 @@ export function renderHeader(game, state, progress, profilesWithCounts = null) {
← Hub + Report Issue ↗
${versionPills}
diff --git a/package.json b/package.json index d5afdd7..d51020a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "type": "module", "scripts": { "start": "node server.mjs", - "test": "node --test tests/*.test.mjs && node --test oras/tests/*.test.mjs && node --test luminescent-platinum/tests/*.test.mjs" + "test": "node --test tests/*.test.mjs && node --test oras/tests/*.test.mjs && node --test luminescent-platinum/tests/*.test.mjs", + "gitea:issues": "node scripts/check-gitea.mjs" }, "engines": { "node": ">=20.0.0" diff --git a/scripts/check-gitea.mjs b/scripts/check-gitea.mjs new file mode 100644 index 0000000..e20748f --- /dev/null +++ b/scripts/check-gitea.mjs @@ -0,0 +1,71 @@ +#!/usr/bin/env node +/** + * Queries Gitea REST API for open issues & pull requests on FaroeGames/oaktracker. + * Usage: + * node scripts/check-gitea.mjs + * node scripts/check-gitea.mjs --issue 12 + * + * For private repos, set GITEA_TOKEN in your environment before running. + */ + +const GITEA_BASE = (process.env.GITEA_URL || 'https://git.trevorstocks.ca').replace(/\/+$/, ''); +const REPO = process.env.GITEA_REPO || 'FaroeGames/oaktracker'; +const TOKEN = process.env.GITEA_TOKEN || ''; + +async function apiGet(endpoint) { + const headers = { Accept: 'application/json' }; + if (TOKEN) headers.Authorization = `token ${TOKEN}`; + const url = `${GITEA_BASE}/api/v1/repos/${REPO}${endpoint}`; + const res = await fetch(url, { headers }); + if (!res.ok) { + throw new Error(`Gitea API ${res.status} ${res.statusText} at ${url}`); + } + return res.json(); +} + +const args = process.argv.slice(2); +const issueFlagIdx = args.indexOf('--issue'); + +try { + if (issueFlagIdx !== -1 && args[issueFlagIdx + 1]) { + const num = Number(args[issueFlagIdx + 1]); + const issue = await apiGet(`/issues/${num}`); + const comments = await apiGet(`/issues/${num}/comments`); + console.log(`#${issue.number} [${issue.state.toUpperCase()}] ${issue.title}`); + console.log(`URL: ${issue.html_url}`); + console.log(`Author: ${issue.user?.login} | Updated: ${issue.updated_at}`); + console.log('\n--- Body ---\n' + (issue.body || '(empty)')); + if (comments.length) { + console.log(`\n--- Comments (${comments.length}) ---`); + for (const c of comments) { + console.log(`\n@${c.user?.login} (${c.created_at}):\n${c.body}`); + } + } + } else { + const [issues, pulls] = await Promise.all([ + apiGet('/issues?state=open&type=issues&limit=50'), + apiGet('/pulls?state=open&limit=50'), + ]); + + console.log(`Repository: ${GITEA_BASE}/${REPO}`); + console.log(`Open Issues: ${issues.length} | Open PRs: ${pulls.length}\n`); + + if (issues.length) { + console.log('=== Open Issues ==='); + for (const i of issues) { + const labels = (i.labels || []).map((l) => l.name).join(', '); + console.log(`#${i.number}${labels ? ` [${labels}]` : ''} ${i.title} (@${i.user?.login}) -> ${i.html_url}`); + } + console.log(''); + } + if (pulls.length) { + console.log('=== Open Pull Requests ==='); + for (const p of pulls) { + console.log(`PR #${p.number} ${p.title} (@${p.user?.login}) -> ${p.html_url}`); + } + } + } +} catch (err) { + console.error(err.message); + process.exitCode = 1; +} diff --git a/tests/portal.test.mjs b/tests/portal.test.mjs index b23db7d..3c3275a 100644 --- a/tests/portal.test.mjs +++ b/tests/portal.test.mjs @@ -43,6 +43,16 @@ test('Unified hub server serves landing page, trailing-slash redirects, both sub const hubHtml = await hubRes.text(); assert.ok(hubHtml.includes('href="./oras/"')); assert.ok(hubHtml.includes('href="./luminescent-platinum/"')); + assert.ok(hubHtml.includes('href="./assets/favicon.svg"')); + assert.ok(hubHtml.includes('https://git.trevorstocks.ca/FaroeGames/oaktracker/issues')); + + for (const iconPath of ['/assets/favicon.svg', '/oras/favicon.svg', '/luminescent-platinum/favicon.svg']) { + const iconRes = await fetch(`http://127.0.0.1:${port}${iconPath}`); + assert.equal(iconRes.status, 200); + assert.match(iconRes.headers.get('content-type') || '', /image\/svg\+xml/); + const svgBody = await iconRes.text(); + assert.ok(svgBody.includes('