Skip to content

Add Exclude collections in collection - #219

Open
Norphirion wants to merge 7 commits into
SteamClientHomebrew:mainfrom
Norphirion:add-exclude-collections-in-collection
Open

Add Exclude collections in collection#219
Norphirion wants to merge 7 commits into
SteamClientHomebrew:mainfrom
Norphirion:add-exclude-collections-in-collection

Conversation

@Norphirion

@Norphirion Norphirion commented Aug 5, 2026

Copy link
Copy Markdown

Exclude collections in collection

Adds collection membership as a criterion for dynamic collections. Pick a dynamic collection, then either exclude every game that already belongs to other collections, or keep only those.

Steam's dynamic collections filter on tags, features, platforms and playtime, but not on other collections — so there is no way to express "everything I'm playing, minus everything I've already finished". This fills that gap. Rules are set per dynamic collection, stack on top of that collection's existing Steam criteria rather than replacing them, and refresh on their own when a source collection changes.

Notes for review

The plugin never touches Steam's cloud-synced filter definition. It replaces the collection's in-memory filter object with a stand-in that inherits the same prototype, forwards every own property back to the original (MobX administration symbols included), and overrides only Matches and bIsEmpty. Disabling the plugin restores every collection exactly as it was, and nothing is written to the user's Steam Cloud data.

Only dynamic collections can be targeted: a static collection has no filter of its own, and routing one through the filtering path would discard hand-curated membership. Rules are stored in localStorage.

Task Checklist

Developer

  • I am the original author or an authorized maintainer of this plugin.
  • I have complied with all license requirements for the libraries used, including providing appropriate notices where necessary.
  • My plugin is fully open source and does not depend on any external paid services, except for widely trusted and well-known platforms. Additionally, neither I nor anyone associated with me profits from any such services.

Plugin Functionality

  • I have tested the plugin on both the Stable and Beta Steam update channels.
  • My plugin is unique, or provides additional or alternative functionality to plugins already on the store.
    • The functionality of my plugin exists in the plugin "Collection+", but I wanted to have a standalone version of this options, with a user interface easier to use than adding some commands in the category settings

Backend Configuration

  • No: I use a standard Millennium python backend in my plugin.
  • No: I use custom binaries that or rely on other FOSS projects that aren't written directly using Millennium's python backend.

Community Contribution

  • I have tested and left feedback on two other plugin pull requests.
  • I have added links to those feedback comments in this PR.

Testing Instructions

  • Verified by a third party on Steam Client Stable.
  • Verified by a third party on Steam Client Beta.

@github-actions github-actions Bot changed the title feat: add exclude-collections-in-collection Add Exclude collections in collection Aug 5, 2026
@Norphirion

Copy link
Copy Markdown
Author

Heads up: this plugin was written by the same person, with the same toolchain, as date-added (#218 ), so it shipped with exactly the same defects. Rather than wait for a reviewer to find them a second time, I've applied the same fixes here:

  • Reproducible build. Every devDependency pinned to an exact version, typescript declared explicitly at 5.9.3 with a pnpm.overrides entry, pnpm-lock.yaml committed, and moduleResolution switched from node to bundler so the build survives TypeScript 7. Verified from a clean checkout with pnpm install --frozen-lockfile && pnpm run build.
  • Unload cleanup. The plugin now returns onDismount, which stops the watch timer and restores every collection's original filter object. Previously both were left running after a disable or reload. The async startup is also guarded, so an initialisation still pending when the plugin is dismounted can no longer reinstall filters afterwards.
  • $schema removed. The referenced file no longer exists upstream; see the discussion in the other PR.
  • LICENSE added (MIT), matching the README and package.json.
  • Unused dependencies dropped (@steambrew/api, @steambrew/webkit).
  • Also fixed a bug I found while doing this: the settings panel still displayed the plugin's former name.

For the record on what this plugin touches, since it is more invasive than a display-only plugin: it never writes to Steam's cloud-synced collection data. It substitutes the collection's in-memory filter object with a stand-in that inherits the same prototype, forwards every own property back to the original - MobX administration symbols included - and overrides only Matches and bIsEmpty. onDismount puts the originals back, so disabling the plugin restores every collection exactly as it was.

I'm not a developer and this was written with Claude Code, so I'd rather over-explain the mechanism than have it look like magic. Happy to answer anything or change the approach if it raises concerns.

@Norphirion

Copy link
Copy Markdown
Author

Applied the same fix about .millennium/ as #218

Brings in the rules being editable from Steam's own filter UI, and a fix for
the filter wrapper being silently discarded when Steam rebuilds a collection's
filter object.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Norphirion

Copy link
Copy Markdown
Author

Pushed 1.1.0. Two changes, one user-facing and one a bug fix.

Rules are now set inside Steam's own filter UI

Previously the rules lived only in the Millennium settings panel, away from the filters they extend. Two buckets : Exclude collections and Include collections are now injected into Steam's filter area, in two places:

  • the filter editor of an existing dynamic collection
  • the pane used to create a new dynamic collection, where the choices are held until Steam assigns the collection an id, then applied to it

Pick collections from a dropdown, click a chip to remove one. A collection already used by one bucket is greyed out in the other. The settings panel is kept — it is the only place that lists every rule at once — and both paths write through the same function.

The injection is append-only: no element of Steam's own is modified, moved or restyled, so disabling the plugin leaves the panel exactly as it was. Two layout details turned out to be load-bearing and are documented in the README:

  • Steam gives its buckets an explicit CSS order, so ours need one too or they render first.
  • The filter area is a repeat(4, 1fr) grid with no imposed width, which makes 1fr resolve against max-content. The max-content of a wrapping chip row is every chip on a single line, so each chip added widened all four columns (425px instead of 271px with seven chips). The chip container now carries a definite width: 0 — which contributes nothing to that measurement — plus min-width: 100% to fill the column once the track has been sized.

Fix: the filter wrapper could be silently discarded

The engine wrapped a collection's m_filter once and then trusted its own bookkeeping. Steam rebuilds that object in at least two situations — when a collection is edited and saved, and while it finishes its own start-up after the plugin has wrapped — which dropped the stand-in while the plugin still believed it was installed. The rule then stopped applying, most visibly as stale, unfiltered collections right after launch.

Each poll now re-checks that the wrapper is still in place and reinstalls it otherwise, and the watcher starts as soon as any rule exists rather than only once a wrap has succeeded, so a collection that was not ready at start-up is picked up on a later pass.

Verified after a cold restart by comparing, for every rule, the collection's actual contents against what the native filter plus the rule should produce — exact match on all of them.

Unchanged

Nothing about what the plugin touches has changed: the cloud-synced filterSpec is never written, only dynamic collections can be targeted, and onDismount still restores every original filter object.

pnpm install --frozen-lockfile && pnpm run build from a clean export of the tracked files produces a bundle byte-identical to my local build.

Layout fix: the injected buckets no longer sit inside Steam's filter grid,
where their height was multiplied by the grid's `2fr 1fr` row ratio and
inflated the whole filter panel.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Norphirion

Copy link
Copy Markdown
Author

1.1.1 — a layout fix on the buckets added in 1.1.0.

The bug. The filter panel grew far more than the buckets needed. With seven chips wrapping over a few lines it went from 263px tall to 663px, and it kept growing with each chip added.

The cause. Steam's filter area is declared grid-template-rows: 2fr 1fr, and Steam's own buckets occupy the 2fr row. Anything appended to that grid lands in the 1fr row — so every pixel of height it needs costs three, because the native row is forced to twice ours regardless of what its own content asks for. The native row was sitting at 442px while its content only needed 175px.

The fix. Steam has the same problem with its own Language and Genre buckets, and solves it by placing them in a sibling container outside the grid. The buckets now go into a container of their own built from that same class, so they inherit its layout and breakpoints and land just after it. Measured on the same collection, the panel stays at 263px with seven chips.

Two things fall out of that: the explicit CSS order the buckets needed to sort correctly among Steam's own is no longer necessary, and teardown removes the container along with them. Still append-only — no element of Steam's is modified, moved or restyled.

pnpm install --frozen-lockfile && pnpm run build from a clean export of the tracked files still reproduces my local bundle byte for byte.

Documentation and source comments only: punctuation cleanup, no behaviour
change and no version bump.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant