fix: duel domain plumbing + manual fame_score overrides#66
Merged
Conversation
DuelView used to mount Grid with the page's prop domain (hardcoded
paris-metro on /duel) regardless of which domain the duel actually
belonged to. A RER duel link opened from /paris-metro therefore ran in
paris-metro mode and clobbered the wrong localStorage key.
Two state vars now back the screen:
- viewDomain: read from GET /api/duels/{id}.domain, drives the playing
screen
- createDomain: drives the landing screen's POST /api/duels body,
starts at the page prop but the new fieldset picker lets the player
change it
The fieldset (kd-domain-picker) sits above the 'Create' CTA on the
landing screen and renders one pill per DOMAINS entry. Hidden when
only one domain is configured.
i18n: duel_create_pick_domain key, fr + en.
The Svelte rule svelte/valid-compile flags the prop captures as
initial-only references, which is the intent — the page is a single
mount and the picker mutates the local state from there. Disabled
inline with a comment explaining.
Saint-Sulpice (paris-metro) and 7 RER stations (Auber, CDG, Antony,
Cergy, Issy + Val-de-Seine, Saint-Michel Notre-Dame) were either
eclipsed by a more popular Wikipedia article (église Saint-Sulpice,
commune d'Antony) or dropped by the topic-keyword filter (Auber,
Issy, CDG terminus). Their fame_score read as 1 or null even though
they are unambiguously major stations.
Add a domains/<id>/fame_overrides.json convention: a JSON file with
{overrides: {entity_id: int 0..=100}} that the ingest scripts merge in
after the percentile-rank pass. Curator decisions survive a re-ingest
because the override is applied last.
Rationale lines stay in the JSON _rationale block so a future
re-ingest can audit why each override exists. The entities.json values
are patched in this commit too so the change is visible without
re-running the ingest scripts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two related fixes after the phase 3 multi-domain ship.
domains/<id>/fame_overrides.jsonconvention.Why
These are the two real-world bugs that surfaced once the phase 3 multi-domain UI hit prod. The duel one was structural (any future RER duel was broken); the fame one was cosmetic but visible — Saint-Sulpice at fame=1 on a station obviously well-known.
How
ceafeae fix(web): duel uses duel.domain, not the page default`DuelView.svelte` now tracks two state vars:
The fieldset (`kd-domain-picker`) renders one pill per DOMAINS entry above the Create CTA. Hidden when only one domain is configured. Active pill = primary background.
`` is now mounted with `domain={viewDomain}` — never `{domain}` (the page prop). i18n: `duel_create_pick_domain` key fr + en.
ESLint's `svelte/valid-compile` flags both prop captures as initial-only references; that's intentional and disabled inline with a comment.
`7bf409f feat(domains): manual fame_score overrides`
New file `domains//fame_overrides.json` shape:
```json
{
"_doc": "...",
"_rationale": { "": "explanation" },
"overrides": { "": 80 }
}
```
Loaded by both ingest scripts (`fame_score_paris_metro.py`, `fame_score_rer.py`) after the percentile-rank pass:
8 entries shipped:
The `entities.json` files are patched in this commit too so the change is visible in prod without waiting for the next manual ingest run.
Checklist
Test plan