(null);
+ const focusKey = focus?.key ?? 0;
+ // Scroll once per request, not on every list refresh.
+ useEffect(() => {
+ if (focusKey && active) focusedRow.current?.scrollIntoView?.({ block: "center" });
+ }, [focusKey, active]);
const copyMod = mods.find((mod) => mod.id === copying);
// A status refresh may protect or remove a pack while its dialog is open.
const current = confirming ? mods.find((mod) => mod.id === confirming.id) : undefined;
@@ -114,6 +124,12 @@ export function ModList({
) : null}
+ {focus && !focused ? (
+
+ tf/custom/{focus.pack} isn't one of this profile's custom packs.
+
+ ) : null}
+
{mods.length === 0 ? (
{
expect(box.textContent).toContain("so TF2 may show different art");
await click('[data-testid="crosshair-stock-art-notice"] button');
expect(openMods).toHaveBeenCalledTimes(1);
+ expect(openMods).toHaveBeenCalledWith(expect.any(String));
});
it("warns about outside edits and rebuilds on request", async () => {
diff --git a/apps/desktop/src/lib/mods-ui.test.ts b/apps/desktop/src/lib/mods-ui.test.ts
index 2810571e..7ab222a0 100644
--- a/apps/desktop/src/lib/mods-ui.test.ts
+++ b/apps/desktop/src/lib/mods-ui.test.ts
@@ -1,4 +1,5 @@
import { describe, expect, it, vi } from "vitest";
+import type { ModRecord } from "./bridge";
import {
canPreferParticleProvider,
DIRECT_BURNING_OVERLAY_ID,
@@ -13,6 +14,7 @@ import {
type ModSelection,
modDomId,
modMetaLine,
+ modOwnsPack,
modSourceLabel,
modSourceUrl,
modsApplyEnabled,
@@ -458,3 +460,15 @@ describe("particle file overlaps", () => {
expect(particleSkipAdvice("could not parse: bad header")).toContain("damaged");
});
});
+
+describe("modOwnsPack", () => {
+ const mod = { pack: "Cool Hits.vpk", inactivePack: undefined } as ModRecord;
+ it("matches a conflict notice's pack name to its record", () => {
+ expect(modOwnsPack(mod, "cool hits.vpk")).toBe(true);
+ expect(modOwnsPack(mod, "Cool Hits")).toBe(true);
+ expect(modOwnsPack(mod, "other")).toBe(false);
+ expect(modOwnsPack({ ...mod, pack: "stored-1", inactivePack: "creator" }, "creator")).toBe(
+ true,
+ );
+ });
+});
diff --git a/apps/desktop/src/lib/mods-ui.ts b/apps/desktop/src/lib/mods-ui.ts
index 724bdc90..64befa6b 100644
--- a/apps/desktop/src/lib/mods-ui.ts
+++ b/apps/desktop/src/lib/mods-ui.ts
@@ -370,6 +370,16 @@ export function modMetaLine(mod: ModRecord): string {
return `${modSourceLabel(mod.source)} · ${formatModBytes(mod.bytes)}`;
}
+/**
+ * Whether `pack`, a name under `tf/custom` as a conflict notice gives it, is
+ * this record's pack. Case and a `.vpk` ending are ignored, and a disabled
+ * pack still answers to the name it mounts under.
+ */
+export function modOwnsPack(mod: ModRecord, pack: string): boolean {
+ const key = (name: string) => name.toLowerCase().replace(/\.vpk$/, "");
+ return [mod.pack, mod.inactivePack].some((name) => name && key(name) === key(pack));
+}
+
/** A stable, selector-safe suffix for a record's test id. */
export function modDomId(id: string): string {
return id.replace(/[^a-z0-9]+/gi, "-").toLowerCase();
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index ad390712..4d04f612 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -112,7 +112,7 @@ Change install opens the finder with the previous install remembered in memory o
- **Viewmodels** — has two views, In game and Per weapon, and opens on In game: viewmodel FOV, Draw viewmodel, Min viewmodels, left-handed viewmodels and the Comfig transparent-viewmodels addon toggle (the same addon state as Comfig, disabled while TF2 runs or busy and outside Comfig profiles). The four cvars stay in `execs_gameplay.cfg` under a separate `viewmodels` managed-cfg scope that native `managed_cfg` and the frontend agree on, so Gameplay, Crosshair, Sounds and Viewmodels saves never rewrite each other's lines. They autosave like Gameplay and wait for a complete startup cfg read. Per weapon holds the class tables and the saved pack; its apply bar stays in view from either view. Set every class… previews a whole-profile Show all, Hide all or Keep melee visible choice (Hidden or Hands only) as the exact list of rows that change, applies it only to the draft, and offers Undo until the next edit; melee inspect rows count as melee and shared-animation conflicts are disclosed before applying. It builds `tf/custom/execs-viewmodels.vpk` locally from the player's installed class animation MDLs: per class, one Shown / Hidden / Hands only choice per loadout slot (Primary, Secondary, Melee, PDA) and one Shown / Hidden choice covering every inspect animation; a slot reads as what most of its weapons use (a tie follows the stock weapon), and changing it moves only the weapons that follow it. Each class is one table of slot rows under shared Shown / Hidden / Hands only columns, each row naming its weapons. Single weapon groups, with spellbooks and the grappling hook (no slot) under Other, sit beneath it in a Customize weapons fold, each with its own choice; the fold opens by default when a weapon is set on its own, and its summary counts those weapons. A group without a choice stays shown: an animation it shares with a hidden group is left untouched (Soldier's Concheror reuses the Shovel's swings), and each class names hidden rows that stay partly visible this way; a selection whose every animation is shared with a shown group is refused. Shared animations set to Hidden and Hands only at once still refuse the build. The catalog identity includes this rule's version, so a pack built under an earlier rule reads as outdated and its choices return as an unbuilt draft. Groups are derived from installed sources without CompVMInstaller data, and the build recipe still records exact per-group choices. Applying from the pane's apply bar builds the pack (release builds included, without rendered previews); applying an all-shown draft over a built pack removes it. Profile export carries the build recipe and output digest, never the generated model bytes; import rebuilds from the recipient's own install and refuses source differences. It also imports, replaces and removes a user-provided compatible VPK, and earlier Yttrium-style packs retain their saved bytes and options through profile switch and export/import; legacy build and preview commands fail before I/O. Do not copy CompVMInstaller's source archive or group table. Custom viewmodels on Valve Casual need the profile's `+exec` preload launch option (see Launch).
- **Sounds** — hit and kill sounds are exactly `tf/custom/execs-hitsounds/sound/ui/{hitsound,killsound}.wav` (the two names sv_pure exempts). Engine formats: 8/16-bit PCM or 4-bit MS-ADPCM at 11025/22050/44100 Hz; other WAVs are re-encoded, MP3-as-WAV refused. New choices are stock effects from the user's `tf2_sound_misc_dir.vpk`, the user's own WAV, MP3 or Ogg Vorbis clip (decoded by Symphonia in `audio_decode.rs`, at most 30 seconds, then prepared like a WAV; clips over a second carry a note), GameBanana hit and kill sound uploads handed over from Mods (listed as From GameBanana and saved like the player's own file), and comfig.app's hits library, the one retired catalog that came back. Its index is pinned to comfig-app commit `0dd0b076`, fetched from GitHub raw and cached by commit; sounds download on preview or use from `hits.comfig.app/<128-hex id>.wav` (an opaque id, not a byte digest), are validated as MS-ADPCM and cached as rebuildable downloads, and a boosted comfig sound re-encodes from its upload. The TF2Hitsounds catalog stays retired; its installed WAVs stay playable, switchable and exportable, but their baked boost cannot change. Sounds has two views: Hit and kill sound (game and music volume, the two slots, and a Pitch and repeat timing fold holding each sound's pitch and the hit repeat delay) and Sound library (search, filters, the list with one page control beneath it, and Remove sound files). A slot's Browse opens the library for that slot with the search focused, and a GameBanana handoff opens it too. A row's star and Use action show on hover or keyboard focus; a selected Use stays visible. The searchable library always chooses for one slot: a Hit sound / Kill sound switch, set by each slot's Browse, drives one Preview, one favorite star and one Use action per row ("Use [sound] for hits"). Show filters All, Favorites, Built into TF2 and comfig.app (your own file stays listed); Sort offers Suggested (yours, TF2's effects, comfig uploads made for the slot being chosen, then the rest, each in its source's own order), A to Z and Z to A. comfig publishes only names and ids, so there are no date or popularity sorts. Favorites are app-wide `localStorage`, never profile data. A compact preview dock floats at the bottom of Sounds with a preview volume (default 50%, app-wide `localStorage`) applied on top of each slot's Volume, a mute toggle and Stop; it never changes cvars or files. A selected Use stays focusable, and a row names the other slot when it holds that sound. **Boost** (0/6/12 dB, tanh soft clip) re-encodes a user-provided or comfig.app file louder because the engine caps `tf_dingaling_volume` at 1. A saved custom WAV remains dormant when a nonzero built-in effect plays, and Sounds offers Use saved sound; selecting the default file effect or explicitly removing or replacing the file clears it. `sound.cache` is deleted on apply. Sound CVars, autoexec wiring, WAVs and the hitsound record commit in one recoverable profile transaction. Accepted external managed WAV drift marks sound provenance changed until every old installed slot is replaced or removed; Sounds shows a repair warning. Sounds scans other mounted `tf/custom` packs for the two canonical virtual paths and reports candidate competitors and incomplete scans; it does not claim which file TF2 plays in-game.
- Sounds also owns TF2's Game volume (`volume`) and Music volume (`snd_musicvolume`): two 0–100% sliders at the top of the pane write them into the profile's `execs_gameplay.cfg` under the `sounds` managed-cfg scope (native `managed_cfg` and the frontend agree), so they run after `config.cfg` and a replaced or default `config.cfg` cannot reset them. Values keep TF2's exact decimals until a slider moves. The after-game sync updates these lines when TF2's options changed them in `config.cfg` (0–1 only) and never adds them; Copy sound settings carries them.
-- **Mods** opens on three task surfaces: **Browse**, **Custom packs**, and **Casual setup**. Browse uses GameBanana game id **297** through `Mod/Index`, or `Sound/Index` when its Mods / Sounds switch is on Sounds, for listings and name search; each section has its own categories. GameBanana numbers mods and sounds separately, so every id travels with its section, and a saved record names it in its page URL (`/mods/` or `/sounds/`), which update checks follow; `Generic_Name=contains,`, a selected `Generic_Category`, and mature-off `Generic_ContentRatings=-` compose server-side. New is the default; Popular, Likes, Views, Updated and New preserve upstream order and map to `Generic_MostDownloaded`, `Generic_MostLiked`, `Generic_MostViewed`, `Generic_LatestUpdated` and `Generic_Newest`. Added and updated dates stay distinct, unavailable metrics remain unknown, and All-category totals are estimates because non-GUI excluded roots are filtered locally. GUI results in the HUDs subcategory route to HUD; every other GUI mod (menus, icons, fonts, scoreboards, loading screens) installs like any other mod, while the installer still refuses a payload that is a HUD. Direct installs read the mod's immediate category to tell the two apart. Maps install too (Decal Tool, Prefabs and Serverside Weapons stay hidden): a `.bsp` outside any content folder goes into the pack's `maps` folder with the files beside it named after it (`.nav`, `