feat(player): add Amiga filename-style display toggle#39
Merged
Conversation
Adds a Sound-pane preference that controls how module filenames render across all catalog surfaces (Mod Archive, Library, Local drop). Three modes: - Auto (default) — render filenames verbatim from disk - Amiga — Amiga-native formats (.mod/.med/.okt/.ahx/.thx) in scene prefix form (e.g. echoing.mod -> mod.echoing); .thx canonicalizes to ahx. (same engine identity) - Amiga everywhere — extends the prefix transform to PC-era formats (.xm/.it/.s3m/.mptm/.stm/.mtm/.669/.ult) for visual consistency Display-only: download filenames, player title, document title, and sourceKey are untouched. Title tooltips preserve the canonical on-disk basename so it stays copyable. TFMX pair rows render as `<base> (TFMX)` style-independently — the (TFMX) suffix already conveys format identity and a single hardcoded label would misrepresent the various on-disk pair shapes. Implementation: - lib/filename/amiga-style.ts — pure 4-step transform with native + all prefix tables, idempotency guard for base-equals-prefix-letters inputs (Mod.Mod family), THX -> AHX alias canonicalization - lib/filename/context.tsx — React context Provider + useFilenameStyle() hook with safe default for consumers outside the Provider - Vitest coverage: 64 cases across the transform, alias, idempotency, amiga-all mode, and TFMX label Preference persists under display.filenameStyle in localStorage and falls back to "auto" on any invalid value. Assisted-by: ClaudeCode:claude-opus-4-7 Signed-off-by: Ronny Trommer <ronny@no42.org>
When a name carries an unrelated allow-list suffix (e.g. `thx.foo.mod`, `med.foo.mod`), step 2 strips the suffix and remembers the implied canonical prefix, then step 3 used to fire on any matching alias in the working string regardless. That silently dropped the format identity carried by the actual extension: thx.foo.mod -> ahx.foo (lost .mod identity) med.foo.mod -> med.foo (lost .mod identity) Fix: gate the step 3 alias loop with `(impliedPrefix === null || to === impliedPrefix)` so the alias only fires when its canonical output agrees with the suffix's canonical format, or no suffix was stripped. After the gate: thx.foo.mod -> mod.thx.foo (preserves .mod identity) med.foo.mod -> mod.med.foo (preserves .mod identity) thx.foo.ahx -> ahx.foo (alias agrees with suffix, fires) thx.dexter -> ahx.dexter (no suffix, fires) mod.echoing.mod -> mod.echoing (matching prefix+suffix collapses) 9 new Vitest cases cover the gate, including f(f(x)) round-trips for both flagged inputs to lock in idempotency. Found in second-pass adversarial code review of PR #39. Assisted-by: ClaudeCode:claude-opus-4-7 Signed-off-by: Ronny Trommer <ronny@no42.org>
indigo423
added a commit
that referenced
this pull request
May 18, 2026
Ships the Amiga filename-style display toggle (PR #39, closes #36). A user-toggleable Sound-pane preference that renders Amiga-native module filenames in scene prefix form (`mod.echoing` instead of `echoing.mod`) across all catalog surfaces. Three modes: auto / amiga / amiga-everywhere. Display-only — downloads and internal identity unchanged. Assisted-by: ClaudeCode:claude-opus-4-7
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.
Closes #36
Summary
Adds a Sound-pane preference that controls how module filenames render across all catalog surfaces (Mod Archive, Library, Local drop). Three modes:
.mod/.med/.okt/.ahx/.thx) in scene prefix form (e.g.echoing.mod→mod.echoing)..thxcanonicalizes toahx.(same engine identity)..xm/.it/.s3m/.mptm/.stm/.mtm/.669/.ult) for visual consistency.Display-only: download filenames, player title, document title, and
sourceKeyare untouched. Title tooltips preserve the canonical on-disk basename so it stays copyable for search/share. TFMX pair rows render as<base> (TFMX)style-independently — the(TFMX)suffix already conveys format identity and a single hardcoded prefix label would misrepresent the various on-disk pair shapes.Implementation
lib/filename/amiga-style.ts— pure 4-step transform with native + all prefix tables, idempotency guard for base-equals-prefix-letters inputs (Mod.Modfamily), and a recognition-alias map that canonicalizesthx.→ahx.on read. Step 3 alias matching is gated on suffix-derived format identity (a name with prefix + unrelated allow-list extension keeps the extension's format, not the alias's).lib/filename/context.tsx— React Context Provider +useFilenameStyle()hook. Safe defaults so consumers rendered outside the Provider degrade silently toautomode rather than throw.components/SoundPane.tsx— radio group below "Stereo separation"; stays interactive when audio controls are disabled (TFMX) via a:not(.filenameStyleSection)CSS exemption.LibraryCatalog(file rows + mod search rows with path-split + TFMX pair rows),LocalCatalog(file rows + pair rows), and the three Mod Archive list components (ChartList,GenreMods,PersonMods) withtitle=tooltip carrying the canonical name.display.filenameStyleinlocalStorage; falls back to"auto"on any invalid value.Vitest coverage: 73 cases across the transform, alias canonicalization, idempotency guard, format-identity gate,
amiga-allmode, and the TFMX label.Test plan
npm test— 106/106 passnpm run typecheck— cleannpm run lint— stays at 35-baseline warnings (zero new)<base> (TFMX)in all modes; tooltip shows canonical name; player title and downloads unchanged; preference persists across reloadMod.Modidempotency fixes; round 2 surfaced and patched the format-identity gate on step 3; all deferred items recorded in_bmad-output/implementation-artifacts/deferred-work.md🤖 Generated with Claude Code